Authentication #64
Replies: 9 comments 6 replies
-
A reflection: when the user is running the MCP server locally, auth is essentially a solved problem (just bake credentials into the server implementation). If the intention is to support a 'canonical' remote server for each different integration, there are no guarantees about what 'shape' those credentials will take. So necessarily, the protocol will need some intermediate adapter between the MCP auth abstraction and the remote service's auth abstraction. Does this necessitate creating the concept of an MCP user identity that can be paired to remote service credentials? Perhaps the client stores credentials in local storage, and the protocol specifies where and how to extract them? I'm just spitballing here to get the conversation started! |
Beta Was this translation helpful? Give feedback.
-
Thanks for getting the conversation started here! We've thought a bit about this, but definitely not enough to bake something into the spec yet. A few principles we probably want to prioritize include:
This led us to brainstorm this initial shape of thing:
In this design:
However, this maybe feels a bit too bespoke—and maybe too suspiciously similar to some OAuth variants—that there's probably a better thing to coalesce around. |
Beta Was this translation helpful? Give feedback.
-
First of all, congratulations to Anthropic on MCP! It's a significant milestone in the standardization and democratization of LLM integration into workflows. In my personal project, I’ve been working on something similar for months—not aiming to create a standard, but specifically focusing on authentication and authorization challenges. Your perspective on MCP servers as "servers" is natural, but I believe it brings additional complexity to authentication and authorization. By shifting the perspective, the solution, in my view, becomes simpler and more streamlined. Instead of thinking of an MCP server as a server, consider it as a "resource provider". This essentially makes it a client in its own right. Typically, consumers don’t connect to multiple servers—they connect to multiple providers or a single server. Treating the MCP server as a resource provider shifts the burden of full authorization away from each individual connection and instead shares it between client and provider. With this perspective, OAuth 2.0 fits perfectly. Here’s how:
OAuth can handle both authentication and authorization in most scenarios. For instance:
Importantly, identification during communication should be considered separately. For example, commands from a user with multiple open chats must be mapped to the correct threads or contexts. This should not be conflated with the auth process. In conclusion, OAuth 2.0 is the best candidate for handling these challenges. It covers all use cases, is highly standardized, and avoids introducing bespoke solutions that may duplicate existing functionality. By keeping authorization and authentication out of the MCP protocol, the protocol remains focused, interoperable, and robust. Additionally, in my opinion, an MCP server should offer three different modes for authentication:
These modes provide flexibility for different stages of development and deployment, while ensuring the protocol remains adaptable to varying levels of security needs. |
Beta Was this translation helpful? Give feedback.
-
Let me walk through an example. Suppose we have an MCP server called "filesystem."
|
Beta Was this translation helpful? Give feedback.
-
Proposal: A W3C DID-Based Solution for Identity AuthenticationCurrently, most discussions revolve around OAuth-based solutions. While OAuth is functional and standardized enough to leverage existing infrastructure, its overall process is still quite complex. I would like to propose a completely new solution based on the W3C DID (Decentralized Identifiers) standard. We have been researching and exploring this approach for a long time, primarily to solve identity authentication and encrypted communication challenges between agents. I believe this approach could also be applied to identity authentication between MCP clients and MCP servers. Why DID?First, I fully agree that the communication protocols of future AI systems (e.g., MCP) should be open and avoid relying on centralized trust authorities. This aligns perfectly with the W3C DID standard, which advocates for users to have full control over their identity information without depending on centralized authentication entities. Overview of the DID all MethodWe designed a DID method called 1. Identity Generation
2. Identity Authentication
3. Encrypted Communication
Use Case ExamplesFile System Access
Pizza Ordering
Challenges and OpportunitiesWhile DID-based solutions have clear advantages, they also have limitations:
I hope this proposal sparks interest and discussion. Please consider this approach for your projects. Related Resources
Finally, feel free to reach out to me if you have any questions. I would be more than happy to discuss this topic. |
Beta Was this translation helpful? Give feedback.
-
👋 we are Auth0 would love to be part of these MCP + auth conversations We've been doing some work already to support apps talking to APIs considering the user's permissions, particularly thinking about GenAI apps and how they look to integrate with other apps/APIs: https://demo.auth0.ai/docs/call-apis-on-users-behalf As @MartinSchlott mentioned, thinking of MCP servers as resource servers should help here. Considering the OAuth covered surface it should be a good place to start with production implementations, learn the gotchas to later implement other approaches (that might or might not be DID related). |
Beta Was this translation helpful? Give feedback.
-
Proposal: did:wba, a Web-based Decentralized Identifier1. Introductiondid:wba is a Web-based Decentralized Identifier (DID) specification designed to support cross-platform authentication and agent communication. The did:wba method leverages existing mature technologies and Web infrastructure to implement decentralized authentication without requiring a complete overhaul of existing systems. Platforms can maintain their centralized account systems while issuing did:wba DIDs to users, enabling interoperability between platforms. Similar to email, did:wba allows platforms to maintain their centralized account systems while enabling cross-platform communication and interoperability. 2. Cross-Platform Authenticationdid:wba can be integrated with HTTP protocol to complete identity authentication, permission verification, and data exchange in a single HTTP request without additional interactions. Below is the interaction flow of did:wba with HTTP protocol:
3. Use Cases
Alice has stored a file on example.com and wants to access it through an AI assistant. She first creates a did:wba-based DID on the AI assistant, logs into example.com, associates this DID with her account, and grants file access permissions to the DID. After setup, the AI assistant can log into example.com using this DID, and upon authentication, example.com allows the AI assistant to access Alice's stored files. This DID can be configured on other websites to enable the AI assistant to access files across different platforms.
Alice wants to call APIs of a third-party service named "example" through an AI assistant. She first creates a did:wba-based DID on the AI assistant and uses it to subscribe to services on the example platform. The example service authenticates using the DID, confirms Alice as the purchaser, and records her DID. After authentication, Alice can use this DID through the AI assistant to call example service's APIs.
4. CodeWe are currently under development and expect to complete it next week. 5. References |
Beta Was this translation helpful? Give feedback.
-
@k6l3 has started a concrete proposal here, centered around OAuth. I think it's broadly in line with a lot of the comments in this thread—thank you all for the input and thought here! |
Beta Was this translation helpful? Give feedback.
-
The PR submitted by k613 regarding authentication (#101) has already defined the framework for extending authentication schemes. Building on that, we have added the Once k613's PR is merged, we will submit a new PR. However, before that, we’d like to gather feedback from everyone. Below is some information about We believe
Using did:wba can lower the barrier for users to access MCP servers. Taking API services like exa as an example, if exa also supports did:wba and provides an API subscription interface, users won't need to log in to exa for registration, configuration, and subscription operations. The MCP client can directly use the API and the user's DID to subscribe to exa's services, then send requests with authentication information to exa's MCP server for identity verification and API calls. This makes it much more convenient for users to utilize various MCP servers. Relevant documentation links: |
Beta Was this translation helpful? Give feedback.
-
First of all - thanks for open-sourcing MCP and all the effort that has been put in to-date. I'm truly excited about the integration possibilities this protocol enables. Of course, a lot of those integrations will need authentication!
Since authentication and authorization are not currently part of the specification, I'm starting a discussion for this topic. I saw @alexalbertt tweeted that remote server support with enterprise-grade is being built, so I'm curious if any further details can be shared as a starting point.
Beta Was this translation helpful? Give feedback.
All reactions