fix: MCP standalone shim proxies full server tool set (#234)#270
fix: MCP standalone shim proxies full server tool set (#234)#270
Conversation
`agentmemory mcp` capped non-Claude clients (OpenCode, Cursor, Gemini CLI, Cline, …) at the local 7-tool `IMPLEMENTED_TOOLS` set even when an agentmemory server was reachable. With `AGENTMEMORY_TOOLS=all` on the server the user expected 51 tools — the shim filtered the response down to whatever subset overlapped its hardcoded set (4 by default, 7 with the env var on). When a server is reachable, the shim now: - Delegates `tools/list` to GET `/agentmemory/mcp/tools` and returns the server's full advertised set verbatim. - Forwards any tool not in the local `IMPLEMENTED_TOOLS` set to POST `/agentmemory/mcp/call` (the server validates per tool). The local `InMemoryKV` fallback path is unchanged — it still implements only the 7 essential tools, and unknown tools throw a clear error pointing to `AGENTMEMORY_URL` when no server is reachable. Verified live end-to-end: - Pre-fix: shim → tools/list returns 4 tools (default) / 7 (TOOLS=all); `memory_lesson_save` → "Unknown tool". - Post-fix: shim → tools/list returns 51 tools when the server runs with TOOLS=all; `memory_lesson_save` → lesson created end-to-end via the shim's stdio JSON-RPC interface. Two regression tests added covering the proxy-forward path and the no-server failure mode. Closes #234.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request extends the MCP standalone server to support tool proxying and remote tool discovery. When running in proxy mode, unknown tools are forwarded to ChangesMCP Proxy Tool Discovery and Calling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Three reliability fixes from #269/#270/#271: - search/recall surfaces saved memories (closes #265) - MCP shim proxies full server tool set (closes #234) - session/subagent hooks no longer block startup (closes #221) Also fixes packages/mcp version drift — was stuck at 0.9.4 through v0.9.5, now lockstepped with main.
Summary
agentmemory mcpcapped non-Claude clients (OpenCode, Cursor, Gemini CLI, Cline, …) at the local 7-toolIMPLEMENTED_TOOLSset even when an agentmemory server was reachable. WithAGENTMEMORY_TOOLS=allon the server the user expected 51 tools.tools/listtoGET /agentmemory/mcp/toolsand forwards any non-essential tool toPOST /agentmemory/mcp/callwhen in proxy mode.InMemoryKVfallback is unchanged — it still implements only the 7 essential tools, with a clearer error for unknown tools when no server is reachable.Live e2e (server:
AGENTMEMORY_TOOLS=all)Pre-fix:
Post-fix:
Driver script used: stdio JSON-RPC initialize → tools/list → tools/call.
Tests
test/mcp-standalone-proxy.test.ts— new cases covering proxy-forward of non-essential tools and the no-server failure mode.Closes #234.
Summary by CodeRabbit
New Features
Tests