Skip to content

Support for OAuth Authenticated Remote Servers #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
navinpai opened this issue May 15, 2025 · 8 comments
Open

Support for OAuth Authenticated Remote Servers #44

navinpai opened this issue May 15, 2025 · 8 comments
Labels
enhancement New feature or request

Comments

@navinpai
Copy link

A popular way to authenticate remote MCP servers has been using oAuth, which is also part of the MCP protocol. A sample MCP Server that do this is Linear MCP Server

How does mcpadapt handle (or plan to adapt) these oAuth-authenticated MCP servers, both in standalone as well as when working in a library like langchain/crewai?

@grll
Copy link
Owner

grll commented May 15, 2025

Hey @navinpai we currently don't have a plan around this I would need to take some time and wrap my head around it. Or feel free to propose something if you feel like it. This is indeed an interesting feature that could be added.

@joejoe2
Copy link
Contributor

joejoe2 commented May 16, 2025

Is there any example in mcp python sdk repo ?

@navinpai
Copy link
Author

Is there any example in mcp python sdk repo ?

https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-auth

@grll
Copy link
Owner

grll commented May 16, 2025

thanks for sharing the example it's very interesting!

The issue I see is that from my understanding, it looks specific to that use case of github oauth I am not sure how well does it generalize to other providers.
Also there are a lot of oauth implementations out there / libraries I am not sure it should be on MCPadapt to reimplement the OAuth protocol internally probably we should use something existing to bring auth support.

What do you think?

@grll
Copy link
Owner

grll commented May 16, 2025

For example this could be promising: https://github.com/authlib/authlib

@grll grll added the enhancement New feature or request label May 20, 2025
@grll
Copy link
Owner

grll commented May 24, 2025

I have been reading quite a lot today at both example in the official sdk. And overall documentation of the protocol for authentication support.

I think we could implement something closer to the client-auth example instead of the server example linked above. The issue I see at the moment is that in the oauth flow, the MCP client needs to prompt the user to go to the auth provider url, fill in a login / consent form. We would need to somehow coordinate with the various framework integration to make that seamless in their framework.

Maybe the default behavior without any framework integration could be to print the url in the console and ask the user to go to the link and we could make the program wait until the callback is called or timeout.

@joejoe2
Copy link
Contributor

joejoe2 commented May 25, 2025

modelcontextprotocol/python-sdk#751 Maybe we can investigate this first ?

@grll
Copy link
Owner

grll commented May 25, 2025

modelcontextprotocol/python-sdk#751 Maybe we can investigate this first ?

Yes this is exactly what I was looking at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants