Repository navigation
Breaking
- A STATIC client of
createMcpServerwhose startup toolsets fail to register their tools now gets a JSON-RPC error (-32603, HTTP 500, "Failed to load toolsets for this client.") oninitializeinstead of connecting with only some of its tools. The failed bundle is dropped, so the client's nextinitializeretries the load. (#33)ServerOrchestrator.isReady()now returnsfalse, andensureReady()throws, when registering a startup toolset's tools fails (for example a duplicate tool name, within a toolset or across toolsets whennamespaceToolsWithSetKeyis off). It used to report ready.createMcpServertherefore rejects at startup for such a catalog in STATIC mode, where it used to start with the partial toolset.enableToolsetresults (and theenable_toolsetmeta-tool output) gain an optionalcodeon that failure.createPermissionBasedMcpServeris not affected: it enables each client's permitted toolsets itself, still connects a client when only some of them fail (failedToolsets), and still answers 403 when all of them fail.- Toolsets refused before registration (exposure policy, duplicate names in
startup.toolsets) and module loader errors do not count as failures. - Migration: before upgrading, make sure no two startup toolsets register the same tool name (rename or remove the duplicate, or turn on
namespaceToolsWithSetKey). A catalog that only worked because the collision was swallowed will now failinitialize, or fail at startup in STATIC mode.
Added
http.allowedOriginsvalidates theOriginheader on the/mcpendpoints, as the MCP spec requires. A request with anOriginoutside the list gets403; requests without anOriginheader are always allowed. Whencorsis on, only the listed origins get CORS access. Not set by default, so existing deployments behave as before. (#32)- Migration: none needed. To turn it on, pass
http: { allowedOrigins: ["https://app.example.com"] }.
- Migration: none needed. To turn it on, pass
Changed
disable_toolsetnow removes the toolset's tools from the MCP server, so clients no longer list or call them, and the toolset can be enabled again. Before, it only changed the toolset's state and the tools stayed callable. The disable message ends withRemoved N tools.; a partly failed enable also rolls back the tools it had registered. Clients get onetools/list_changedper removed tool plus the batched one. (#31)- Migration: code that relied on a disabled toolset's tools staying callable must stop doing so.
enable_toolsetanddisable_toolsetare advertised withdestructiveHint: false, idempotentHint: true. They only change which tools are exposed, so clients no longer need to treat them as destructive. (#29)
Fixed
PermissionAwareFastifyTransportwaits for the client's orchestrator to be ready before connecting and, likeFastifyTransport, answers500/-32603and drops the bundle when it is not ready. Internal hardening: the class is not part of the public API andcreatePermissionBasedMcpServeralready loaded toolsets before returning, so its behaviour is unchanged. (#30)
What's Changed
- feat(http): validate Origin on /mcp via http.allowedOrigins by @imbenrabi in #32
- fix: wait for the orchestrator before connecting a permission-aware client by @imbenrabi in #30
- fix: mark enable_toolset and disable_toolset as non-destructive by @imbenrabi in #29
- fix: reject STATIC clients whose startup toolsets failed to load by @imbenrabi in #33
- fix: disable_toolset unregisters the toolset's tools by @imbenrabi in #31
- chore(release): 0.8.0 by @imbenrabi in #34
Full Changelog: v0.7.0...v0.8.0