-
Notifications
You must be signed in to change notification settings - Fork 3
feat: allow for specifying mcp clients and convert functions to async #55
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
Conversation
| description=_("JSON configuration for the MCP"), | ||
| type=SettingsFieldType.TEXT, | ||
| default="", | ||
| placeholder="{\"weather\": {\"url\": \"https://weather.internet/mcp\",\"transport\": \"streamable_http\"}}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can make this a bit nicer. Could we leave out the transport, since we shouln't allow stdio anyway? Passing JSON in a setting is a bit cumbersome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some other parameters that are useful like the headers parameter if you need any authorization. Also not sure if just overwriting one of the parameters is an expected user experience. WDYT
client = MultiServerMCPClient({
"github": {
"transport": "streamable_http", #
"url": "https://my-github-mcp-server/mcp",
"headers": {
"Authorization": f"Bearer {user['github_token']}" # This one
}
}
})There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Then I guess it's ok. Can we add an explanation there to make sure people know what to input there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also be worth it to add more details to the context agent documentation.
|
If you rebase on main, you'll get working CI again :) |
Signed-off-by: Lukas Schaefer <[email protected]>
bbc7c9d to
8ed6bec
Compare
|
CI fails with: |
Should be fixed in the last commit. |
Signed-off-by: Lukas Schaefer <[email protected]>
0936258 to
5f2057f
Compare
Signed-off-by: Lukas Schaefer <[email protected]>
|
Tested and works well! Good work! 🎉 A few concerns:
|
Signed-off-by: Lukas Schaefer <[email protected]>
I did change the description to give a short explanation of the format and I added |
|
Awesome, then it's good to go :) |
feat: allow for specifying mcp clients and convert functions to async
The client for mcp servers required it to be an async function so a lot of code was converted to async that also means that context agent can now concurrently deal with multiple requests.
Currently the config is a little basic and only available for admins:

For a very simple config to try this out use the config below and ask something about a public github repo:
{"deepwiki": { "url": "https://mcp.deepwiki.com/mcp", "transport": "streamable_http" }}Also might be worth it to talk about stdio MCP servers. For more info go to https://modelcontextprotocol.io/specification/2025-06-18/basic/transports. Theoretically possible with this code as long as the dependencies for the program exist, but discussed with Julien that we can probable just ignore that type of MCP server.
Also this can't deal with oauth authentication.