Repository navigation
feat(mcp-binding): a tool is a composable function - a @preload function per tool, bound in code - #55
Merged
Conversation
…ion per tool, bound in code The binding's first shape read a tools allowlist under each server and conjured each tool's route at boot as an alias of a private mcp.tool function - a route no @preload declared. Now a tool is declared where every route is declared: bind(server, tool, schema_sha256) returns the tool as an async callable and an ordinary @preload function calls it (the extension's own mermaid.render, bound to the public Mermaid Chart MCP endpoint named in the default server file). The server file keeps servers only; boot connects every server a function binds a tool of and stops by name on an unconfigured server, a missing tool or a changed digest; mcp.tool is no longer a route. A route names the capability, never the transport. The shared vectors are version 2 (verify cases over declared bindings), byte-identical with the Node twin. Design: the engines' draft-design-specs/agent-tool-use.md (Eric's review, 2026-11-16). ruff clean, basedpyright 0 errors, pytest 410 passed; booted live against the Mermaid server and a diagram rendered through mermaid.render. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 16, 2026
acn-ericlaw
added a commit
that referenced
this pull request
Nov 16, 2026
…ded as landed Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Nov 16, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
The MCP binding is reshaped so that a tool of an MCP server is declared where every route is declared, in the code:
render = bind("mermaid", "validate_and_render_mermaid_diagram", schema_sha256="5ae6…")names the server, the remote tooland the digest of its input schema and returns the tool as an async callable, and an ordinary
@preloadfunction calls it(the extension's own
mermaid.render, bound to the public Mermaid Chart MCP endpoint named in the default server file, sothe binding serves a tool out of the box with no credential). The server file keeps what is environment-specific (transport,
command or URL, credential references, timeout) and refuses a leftover
toolsallowlist by name. Boot connects every servera function binds a tool of, lists its tools and stops the application by name when a bound server is not configured, a tool
is not offered or its schema no longer hashes to the pinned digest; a configured server nobody binds is not connected.
mcp.toolis no longer a route;mcp.healthstays;describeprints each digest, thebindline to paste and a catalogrow whose route is the developer's. A route names the capability, never the transport. The shared vector file is version 2
(
verify_casesover declared bindings), byte-identical with the Node twin;tests/test_mcp_binding.pyhas 49 tests (46before); the README, the default server file and the unreleased CHANGELOG entry describe the final shape.
ruffclean,basedpyright0 errors,pytest410 passed, 64 skipped;describe mermaidand a live boot against the Mermaid serverrendered a flowchart through
mermaid.render(200, the SVG) and refused a non-map body (400).Why
The first shape, built on 2026-11-14, read a
toolsallowlist under each server and conjured each tool's route at boot asan alias of a private
mcp.toolfunction: a route no@preloaddeclared, a route-to-tool table in a YAML file as a secondplace to look, and a mechanism a developer could forget - the Playground's
diagram.rendercalleddiagram.render.mcp,which existed only because a YAML row said so. Eric's review of 2026-11-16 (the engines'
draft-design-specs/agent-tool-use.md)settled the principle: a tool is a composable function whatever stands behind it, the MCP client is fully encapsulated,
and the route must not carry the transport, because a tool may start as an MCP tool and later be implemented another way
while the graph stays unchanged. One route per tool with the digest pinned is kept, so ADR-0033 stands untouched, and a
generic public
mcp.toolroute (the ADR's rejected alternative) was considered in the debate and set aside. The Node twinis opened in lockstep; the Playground example follows with
mermaid.render.🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com