Replies: 2 comments
|
This is covered in the scope of my SMCP RFC: https://github.com/orgs/modelcontextprotocol/discussions/689 |
|
You have hit one of the hardest unsolved problems in MCP server design. Here is where the spec stands and what patterns work in practice today. Where the spec standsThe MCP spec does not currently define a standard for per-user credentials in proxy scenarios. This is a known gap. The spec defines OAuth 2.0 for server-to-client authorization (the client authenticates to the server), but not for server-to-upstream-API credential propagation (the server authenticating as the user to GitHub/Slack/etc.). You are correct that the OAuth On-Behalf-Of (OBO) flow would be the ideal solution but is blocked by the lack of trusted relationships between identity providers. This is not an MCP problem — it is a fundamental federated identity problem that the industry has been working on for decades (SAML, SCIM, etc.). Your three questions, answered1. Will the spec define a standard for this?The closest thing in progress is SEP-1036: URL Mode Elicitation (PR #887), which you already found. It allows the server to ask the client to open a browser URL where the user can complete an out-of-band interaction (like entering API keys). This is the "secure storage alternative" you mentioned — and yes, your read is accurate. There is also SEP for Authorization being discussed that covers resource-level access control. But a full "multi-tenant proxy credential" standard is not yet on the roadmap as a formal SEP. 2. Is passing credentials via custom headers acceptable?It works, but it is a security anti-pattern in the general case. The concern is the "confused deputy" problem: if the MCP client blindly forwards user credentials in headers, a malicious or compromised MCP server could exfiltrate them. The spec's guidance against passing OAuth tokens through is based on this risk. However, in an enterprise deployment where:
...this pattern is pragmatic and widely used. Many production MCP deployments pass 3. Recommended patterns for multi-user proxy serversHere is what works in production today, from simplest to most robust: Pattern A: Session-based credential mapping (simplest) Pros: clean, no custom headers needed. Cons: requires credential storage infrastructure. Pattern B: Header-based identity forwarding (pragmatic) This is what most enterprise deployments do today. The Pattern C: Elicitation-based credential collection (spec-aligned future) This is the SEP-1036 approach and will be the "correct" spec-aligned answer once merged. Concrete recommendation for your transitionFor moving from local STDIO to remote service:
One critical security noteWhatever pattern you choose, never log upstream credentials. Your MCP server will handle API keys for multiple users — a logging mistake that leaks one user's GitHub token to another user's log output is catastrophic. Use structured logging with automatic credential redaction from day one. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pre-submission Checklist
Question Category
Your Question
We currently run an enterprise MCP server that exposes tools for multiple APIs (GitHub, Slack, Rally, New Relic, PagerDuty, etc.). Today, each user launches the MCP server locally via STDIO, supplying their user-specific API keys as environment variables at startup.
We’d like to transition to offering this MCP server as a remote service (following our standard deployment lifecycle), so users don’t need to maintain local versions to benefit from updates. The challenge:
Questions:
In my opinion, the spec could benefit from guidance on multi-user scenarios and how an MCP server should behave as a proxy in a way that preserves user context securely.
EDIT
I did a little more digging and landed at Proposal: Fine-Grained Resource Control for Multi-User Authorization which seemed somewhat related, but that lead me to PR 475, which then lead to open PR 887: SEP-1036: URL Mode Elicitation for secure out-of-band interactions. It looks like the solution is to essentially use elicitations to have the client open a browser that allows the user to enter a key into some, essentially doing the secure storage alternative I mentioned above. Is that accurate?
All reactions