Repository navigation
Codex plugin install does not expose advertised full MCP tool surface #400
Description
The Codex plugin path currently does not reliably expose the advertised 51 MCP tools out of the box.
Observed behavior:
plugin/.mcp.jsonstarts@agentmemory/mcpwithout any environment.@agentmemory/agentmemorystarts withAGENTMEMORY_TOOLS=coreby default.- The REST endpoint
/agentmemory/mcp/toolsthen returns only the core tool set. - The standalone MCP shim returns the remote server tool list as-is, so Codex sees a reduced tool surface instead of the README-advertised 51 tools.
There is also a docs/install mismatch: the README says to run codex plugin install agentmemory, but the tested Codex CLI only exposed codex plugin marketplace {add,upgrade,remove} and no plugin install subcommand.
Environment
- OS: macOS Darwin 25.5.0 arm64
- Node: v26.0.0
- npm: 11.14.1
- Package:
@agentmemory/agentmemory@0.9.13 - MCP shim:
@agentmemory/mcp@0.9.13 - Codex CLI:
/opt/homebrew/bin/codex
Reproduction
-
Start the worker with documented default:
npx @agentmemory/agentmemory
-
Query the server MCP tools endpoint:
curl http://127.0.0.1:3111/agentmemory/mcp/tools
-
Install/use the Codex plugin manifest from
plugin/.mcp.json:{ "mcpServers": { "agentmemory": { "command": "npx", "args": ["-y", "@agentmemory/mcp"] } } } -
Ask Codex for
agentmemorytools.
Actual Result
Codex sees a reduced MCP surface instead of 51 tools.
In local testing:
- Worker started without
AGENTMEMORY_TOOLS=allexposed only a small/core tool set from/agentmemory/mcp/tools. - Standalone shim used the remote reduced list as authoritative.
- If no worker was reachable, local fallback exposed only 7 implemented tools.
Expected Result
The Codex plugin should expose all advertised agentmemory MCP tools when a worker is running, matching README language:
"you get 51 MCP tools ... without any extra config step"
Root Cause
Two config layers disagree:
-
Worker default:
const mode = process.env["AGENTMEMORY_TOOLS"] || "core";
-
Codex plugin
.mcp.jsondoes not setAGENTMEMORY_TOOLS=all, so the worker endpoint can return only core tools.
The standalone shim then returns the remote tool list unchanged:
if (remote && Array.isArray(remote.tools)) {
return { tools: remote.tools };
}So AGENTMEMORY_TOOLS=all on the shim side is not enough if the worker was started with default core mode.
Workaround
Start the worker with all tools and configure the Codex MCP shim explicitly:
AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemory{
"mcpServers": {
"agentmemory": {
"command": "npx",
"args": ["-y", "@agentmemory/mcp"],
"env": {
"AGENTMEMORY_URL": "http://127.0.0.1:3111",
"AGENTMEMORY_TOOLS": "all",
"AGENTMEMORY_FORCE_PROXY": "1"
}
}
}
}Using 127.0.0.1 avoids loopback resolution differences between hosts/sandboxes.
Proposed Fix
Patch plugin/.mcp.json:
{
"mcpServers": {
"agentmemory": {
"command": "npx",
"args": ["-y", "@agentmemory/mcp"],
"env": {
"AGENTMEMORY_URL": "http://127.0.0.1:3111",
"AGENTMEMORY_TOOLS": "all",
"AGENTMEMORY_FORCE_PROXY": "1"
}
}
}
}Patch src/mcp/standalone.ts so the shim honors AGENTMEMORY_TOOLS=all even if the remote worker returns a core list:
if (
process.env["AGENTMEMORY_TOOLS"] === "all" &&
remote.tools.length < getAllTools().length
) {
return { tools: getAllTools() };
}Update README Codex quickstart:
AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemoryValidation
Added tests:
test/codex-plugin.test.ts: asserts Codex.mcp.jsonships explicit loopback URL, all-tools mode, and force-proxy env.test/mcp-standalone-proxy.test.ts: asserts the shim keeps all tools visible whenAGENTMEMORY_TOOLS=allbut the remote server lists core tools.
Focused verification:
AGENTMEMORY_URL=http://127.0.0.1:9 npx -y vitest run \
test/codex-plugin.test.ts \
test/mcp-standalone-proxy.test.ts \
test/mcp-standalone.test.ts \
test/mcp-transport.test.tsResult:
Test Files 4 passed (4)
Tests 59 passed (59)
Runtime verification after workaround:
agentmemory status: healthy
viewer: http://127.0.0.1:3113
/agentmemory/mcp/tools: 51 tools
Codex tool registry: mcp__agentmemory__ tools available after restart
Activity
leoliner commentedon May 15, 2026
same issue in claude code
fix(codex-plugin): expose full MCP tool surface (rohitg00#400)