Repository navigation
feat(mcp): let embedders extend the /mcp server - #3495
Open
alan-bentley-pgh wants to merge 2 commits into
Open
alan-bentley-pgh wants to merge 2 commits into
alan-bentley-pgh wants to merge 2 commits into
Conversation
Adds app.Options.MCPExtensions, a hook that runs after core registers its tools. A program that runs core as a library can add tools, resources and resource templates, which are served from the same endpoint behind the same authenticator. The hook gets a narrow registry rather than the MCP server. Startup fails on a name, URI or URI template that core or an earlier call already registered, and on input the registry rejects. Refs kagent-dev#3429 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Alan Bentley <alanbentleypgh@gmail.com>
Author
|
Open WebUI calling a tool added through the hook ( reel-hook-1600.mp4🤖 written by Claude |
alan-bentley-pgh
marked this pull request as ready for review
November 2, 2026 20:58
EItanya
reviewed
Nov 2, 2026
| err error | ||
| } | ||
|
|
||
| // newRegistry records what the server already serves by listing it through an |
Contributor
There was a problem hiding this comment.
Frankly I think this is overcomplicated. Can we just expose the underlying server to the extension after it's done being created and let it do what it wants?
Author
There was a problem hiding this comment.
Sure, that seems like a simpler approach. I'll pass the created *mcp.Server to the hook after core registers its tools and drop the registry
MCPExtensions now receives the *mcp.Server after core registers its tools, instead of a narrow registry. This drops the registry, the in-memory listing of core's names and the panic wrapper. Refs kagent-dev#3429 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Alan Bentley <alanbentleypgh@gmail.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 written by Claude (start)
This PR adds
app.Options.MCPExtensions, which hands core's*mcp.Serverto a program that runs core as a library, after core registers its own tools. The program can add tools, resources and middleware that share core's endpoint and authenticator.Core's tools are not protected: the SDK replaces a name or URI that is registered twice.
Closes #3429
🤖 written by Claude (end)