feat: allow for specifying mcp clients and convert functions to async - #55
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.
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.
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.
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.
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 <lukas@lschaefer.xyz>
bbc7c9d to
8ed6bec
Compare
|
CI fails with: |
Should be fixed in the last commit. |
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
0936258 to
5f2057f
Compare
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
|
Tested and works well! Good work! 🎉 A few concerns:
|
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
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.