Skip to content

feat(mcp-binding): a tool is a composable function - a preload function per tool, bound in code - #122

Merged
acn-ericlaw merged 1 commit into
mainfrom
feat/mcp-binding-function-per-tool
Nov 16, 2026
Merged

acn-ericlaw merged 1 commit into
mainfrom
feat/mcp-binding-function-per-tool

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Contributor

What

The twin of the Python pack's reshaping of the MCP binding, in lockstep. A tool of an MCP server is declared where every
route is declared, in the code: const render = bind('mermaid', 'validate_and_render_mermaid_diagram', { schemaSha256: '5ae6…' })
names the server, the remote tool and the digest of its input schema and returns the tool as an async function, 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, so the binding serves a tool out of the box with no credential). The server file keeps
what is environment-specific and refuses a leftover tools allowlist by name. Boot connects every server a 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.tool is no
longer a route; mcp.health stays; describe prints each digest, the bind line to paste and a catalog row whose route is
the developer's. createBinding no longer takes a registry, since the binding registers no route. The shared vector file is
version 2, byte for byte the Python pack's; test/mcp-binding.test.mjs has 49 tests (46 before); the README, the default
server file and the unreleased CHANGELOG entry describe the final shape. npm test: 469 tests, 405 passed, 0 failed, 64
skipped; a live boot against the Mermaid server rendered a flowchart through mermaid.render (200, the SVG) and refused a
non-map body (400).

Why

The first shape, built on 2026-11-14, conjured each tool's route at boot from a YAML row as an alias of a private mcp.tool
function: a route no preload declared and a mechanism a developer could forget. 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. The Python twin is Accenture/mercury-python#55; the Playground example follows with mermaid.render.

🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

…on per tool, bound in code

The twin of the Python pack's reshaping. 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. Now a tool is declared where every route is declared: bind(server, tool,
{ schemaSha256 }) returns the tool as an async function 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, byte-identical
with the Python twin. Design: the engines' draft-design-specs/agent-tool-use.md (Eric's
review, 2026-11-16). npm test 469 tests, 405 passed, 0 failed; booted live against the
Mermaid server and a diagram rendered through mermaid.render.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit 5157070 into main Nov 16, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/mcp-binding-function-per-tool branch November 16, 2026 04:52
acn-ericlaw added a commit that referenced this pull request Nov 16, 2026
…rded 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant