Description
Local Agent MCP Tool Bridge gives a spawned coding agent temporary access to the Dots MCP tools selected for one chat turn. The adapter writes a short-lived manifest describing the allowed tools and launches a dependency-free stdio MCP sidecar. The local CLI connects to that server using its native MCP configuration, while the sidecar relays only the manifest's declared operations to the host.
The bridge is constructed per turn rather than installed globally. Tool names are validated for safe wire use, temporary paths are resolved explicitly, and provider adapters can degrade or retry according to their own MCP startup behavior. Keeping the server as a copied JavaScript sidecar means the spawned CLI can run it with bare Node without importing the TypeScript package or inheriting the application's dependency graph.
Selling Points
- Local agents can search and operate on Dots knowledge without asking users to copy records into prompts.
- Per-turn manifests expose only the tools relevant and authorized for that request, reducing ambient capability.
- A stdio transport works with the MCP support already built into major coding-agent CLIs.
- Temporary configuration avoids permanently modifying the user's global agent settings.
- The shared bridge lets multiple provider adapters reuse one Dots tool transport while retaining their native spawn contracts.
User Story
A user asks Claude Code to compare a repository change with a decision stored in Dots. The chat runtime resolves the permitted read tools, and the adapter creates a temporary MCP manifest for that turn. Claude Code calls the Dots server through stdio, retrieves the decision, and returns a grounded answer. When the turn ends, the temporary bridge is cleaned up and no broad, persistent MCP permission remains in the user's CLI configuration.
Extension Surface
This feature is extensible. packages/local-agent-adapters/src/mcp/turn-tools.ts accepts provider-neutral tool definitions and generates a manifest consumed by the sidecar, while packages/local-agent-adapters/src/spawn/contracts.ts keeps process and environment behavior injectable. New in-repo local adapters can reuse the bridge, but external servers do not register arbitrary behavior inside this package.
Capabilities & Limits
- It converts resolved turn tools into a temporary MCP manifest and stdio server configuration.
- It validates tool names and carries calls across the spawned-process boundary.
- It supports provider-specific adapters without duplicating Dots tool implementations.
- Limit: only CLIs with enforceable MCP configuration can receive the bridge; a provider that cannot honor required policy must refuse rather than run broadly.
Implementation Map
packages/local-agent-adapters/src/mcp/turn-tools.tspackages/local-agent-adapters/src/mcp/dots-mcp-stdio-server.mjspackages/local-agent-adapters/scripts/copy-mcp-server.mjspackages/local-agent-adapters/src/spawn/contracts.ts