feat(mcp): expose the frozen 6 tools locally - stdio + daemon /mcp (M3)#219
Merged
Conversation
Contributor
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
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.
M3 - Local MCP exposure
Exposes the frozen 6-tool MCP contract (
memory__search/read/list/write/edit/delete) to on-machine AI clients over two transports, both over the same local engine the CLI verbs and daemon already use:agentage mcp- stdio MCP server (for clients that spawn a process: Cursor, Windsurf, Zed).POST /mcpon the daemon - stateless Streamable HTTP (JSON), for clients that connect to a URL. Localhost only, no auth (same loopback trust as the rest of the daemon).GET/DELETE /mcpreturn 405.Contract fidelity - wrap, don't copy
The contract layer is reused verbatim from
@agentage/server-memory@^0.0.2(MIT):createLocalMemoryServerwraps its exportedcreateMemoryServerbuilder, so tool names, descriptions,inputSchema, annotations, per-connection instructions and dual-channel output (content[].textrendered markdown plusstructuredContent) are byte-identical by construction - zero drift. A CI contract test builds the local server and diffs an in-processinitialize+tools/listroundtrip against the canonical server built directly from the package (guards future drift; never compares against.mcpc.json).The registry is filtered to offline (git working-copy) vaults, so the surface matches the DirectClient exactly and no network-backed vault is exposed over the no-auth socket.
@<vault>/routing flows through the shared engine's router:listwith no folder shows the vault prefixes,read/write/edit/deletetake@<vault>/<path>,searchtakesfolder: "@<vault>".Changes
src/mcp/local-server.ts- the shared builder (createLocalMemoryServer+loadLocalMemoryServer), wraps server-memory.src/commands/mcp.ts- theagentage mcpstdio subcommand (in-process engine).src/daemon/mcp-http.ts+src/daemon/server.ts- statelessPOST /mcp(fresh server + transport per request,enableJsonResponse), mirrors the cloud endpoint.src/daemon-entry.ts- wiresbuildMcpServer; fixes a stale "forked" comment (impl is a detached spawn).@agentage/server-memory,@modelcontextprotocol/sdk); every other ban kept./mcptier (@p0) exercising all 6 tools + dual-channel over HTTP, and a stdio tier (@p0) with clean EOF shutdown.Verification
npm run verifygreen (type-check + e2e type-check + lint + format + 165 unit tests + build)./mcpall 6 tools + stdio), plus the existing offline tiers (no regression).agentage mcpanswersinitialize/tools/listover stdio; daemon/mcpanswerstools/list+ write/search/read via curl with dual-channel output; multi-vault@main/@workrouting round-trips.