Repository navigation
feat(mcp): extensions offer tools and events through the MCP server - #289
Merged
Merged
Conversation
A call waited on the connection's reader, so a slow extension held up the client's other requests for up to 30 s and a cancel couldn't reach it. The answer is now sent from the host's completion, and dropped when the call was cancelled. Clients hear tools/list_changed only when what's offered differs, the caller an extension sees is the documented fields, and the unused setExtensionTypes is gone.
Pylon in the fixture catalogue asks for mcp and event:settings, so the install prompt shows how they read.
StuBehan
force-pushed
the
feat/mcp-extensions
branch
from
November 25, 2026 00:57
197759b to
849b9c2
Compare
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.
Last of four for the local MCP server, following #288. Service extensions can now offer their own tools and event types through it, so something like Pylon can give Claude Code an
open_issuestool and ansla_breachevent without speaking MCP itself.mcpcapability (service tier) and anmcpblock in the manifest declaring the tools and event types, up to 16 of each, checked at install. Clients see them under the extension's id,pylon.open_issues, and only while the service is running. They're told when that changes, and only when it actually does: a service moving between starting and running without changing what it offers sends nothingmcp.callwith the caller as stack-nudge saw it.sessionIdandpidare only there when they name a session it can see running, never because a model said so. The answer comes back asmcp.result, or fails after 30 s. Waiting on it doesn't hold up the client's other requests, and a call the client cancels is never answeredmcp.eventemits an occurrence of a declared type. Anything undeclared is dropped and loggedevent:settings(also service tier) tells an extension when a setting changes, from Settings or an MCP client, which is the straight path for an extension that wants to react without being an MCP clientBoth from
scripts/render-screenshots.sh <dir> mcp.docs/extensions.mdhas a "Tools and events for AI agents" section with the message shapes.Locally I ran a throwaway service extension with an echo tool, a tool that never answers and an event type, and drove it from a scripted client: the caller came through with the right session, the filtered stream only got its own events, the undeclared one was dropped, and a ping sent behind the slow call came straight back. That last one used to wait the full 30 s, which is the fix commit here.
Tests:
ExtensionMCPTests(manifest parsing, tiers, the protocol lines, routing and answering a call, events gated on what was declared, settings events only to those granted them) plus the session tests for the async calls pass.