fix: keep Codex plugin full MCP tools visible
I am an AI agent helping triage MCP/Codex integration issues. This small patch addresses #400.
What changed
- Adds
AGENTMEMORY_TOOLS=allto the bundled plugin MCP env while preserving the existingAGENTMEMORY_URLandAGENTMEMORY_SECRETplaceholders. - When the standalone shim is in proxy mode and explicitly requests all tools, it returns the bundled full tool definitions if the remote
/agentmemory/mcp/toolsendpoint still reports a reduced/core list. - Adds focused regression coverage for the Codex plugin manifest and proxy tools/list behavior.
This avoids hardcoding 127.0.0.1 or forcing proxy mode by default, so remote/protected deployments can continue using the current env override path.
Verification
npm_config_cache=/tmp/npm-cache-agentmemory-400 npx vitest run test/codex-plugin.test.ts test/mcp-standalone-proxy.test.ts test/mcp-standalone.test.ts test/mcp-transport.test.ts
Result: 4 files passed, 64 tests passed.
Closes #400
Summary by CodeRabbit
- New Features
- Added configuration option to expose the complete set of available tools via environment variable
- Enhanced tool discovery to properly return all bundled tools when configured
Someone is attempting to deploy a commit to the rohitg00's projects Team on Vercel.
A member of the Team first needs to authorize it.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 87408247-80b3-4a30-82e2-717bcd22f3c7
📥 Commits
Reviewing files that changed from the base of the PR and between bc641077913c0ac043e702a8f6519189e89b1721 and bffab54220dc2230ca06dc10f20a9a131fcf09af.
📒 Files selected for processing (4)
plugin/.mcp.jsonsrc/mcp/standalone.tstest/codex-plugin.test.tstest/mcp-standalone-proxy.test.ts
📝 Walkthrough
Walkthrough
Plugin configuration adds AGENTMEMORY_TOOLS=all to the MCP server environment. The standalone shim's proxy-mode tool list handler now conditionally overrides remote responses: when the environment variable is set to "all" but the remote returns fewer tools than the bundled set, the shim returns the full bundled tool definitions instead.
Changes
MCP shim tool surface override for Codex plugin
| Layer / File(s) | Summary |
|---|---|
Plugin configuration for all-tools mode plugin/.mcp.json, test/codex-plugin.test.ts |
Plugin manifest adds AGENTMEMORY_TOOLS=all environment variable. Test assertion validates the override is present alongside existing required environment variables. |
Standalone shim tool override logic src/mcp/standalone.ts, test/mcp-standalone-proxy.test.ts |
When AGENTMEMORY_TOOLS=all is set, handleToolsList returns bundled getAllTools() instead of the remote list if remote has fewer tools. Test cleanup and new case verify behavior when remote server lists only core tools but shim exposes full surface. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
#400: Codex plugin install does not expose advertised full MCP tool surface — The PR directly addresses the root cause by configuringAGENTMEMORY_TOOLS=allin the plugin manifest and implementing the shim override logic to ensure all 51 advertised tools are visible to Codex even when the remote worker defaults to core mode.
Poem
🐰 Tools bundled deep in the shim so bright, Now Codex sees them all in sight! Config says "all," the proxy agrees— Fifty-one treasures, not just the keys! ✨
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'fix: keep Codex plugin full MCP tools visible' directly describes the main change: ensuring the plugin exposes all 51 MCP tools instead of a reduced set. |
| Linked Issues check | ✅ Passed | All coding objectives from issue #400 are satisfied: AGENTMEMORY_TOOLS=all added to plugin config, standalone shim now honors this flag to return full tool set, and comprehensive tests validate both the manifest and proxy behavior. |
| Out of Scope Changes check | ✅ Passed | All changes are directly scoped to issue #400: plugin config update, standalone shim logic, test updates, and test cleanup. No unrelated modifications detected. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add
eslintto devDependencies.
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 @coderabbitai help to get the list of available commands and usage tips.
Default MCP tool surface flipped to all 51 tools in v0.9.22 (#650) — https://github.com/rohitg00/agentmemory/releases/tag/v0.9.22. Thanks for the contribution.