Before allowing browsers to call MCP endpoints directly, decide where you want to enforce control and hide sensitive details.
You typically have two options:
Direct browser → MCP server
- Browser JavaScript calls
https://your-mcp-server/mcp directly. - The MCP server must handle CORS, authentication from the browser, and request validation.
Browser → App backend → MCP server (recommended for most production scenarios)
- Browser calls your own application backend (REST or GraphQL).
- Your backend makes MCP calls on behalf of the browser.
- The backend enforces business rules, scopes, and hides MCP internals.
If you choose direct browser access, treat MCP as a public-facing API with all associated security and stability requirements.