Skip to content

Codex plugin install does not expose advertised full MCP tool surface #400

Open
AyushKar2005/agentmemory
#1

Description

@ivkiwi

The Codex plugin path currently does not reliably expose the advertised 51 MCP tools out of the box.

Observed behavior:

  • plugin/.mcp.json starts @agentmemory/mcp without any environment.
  • @agentmemory/agentmemory starts with AGENTMEMORY_TOOLS=core by default.
  • The REST endpoint /agentmemory/mcp/tools then 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

  1. Start the worker with documented default:

    npx @agentmemory/agentmemory
  2. Query the server MCP tools endpoint:

    curl http://127.0.0.1:3111/agentmemory/mcp/tools
  3. Install/use the Codex plugin manifest from plugin/.mcp.json:

    {
      "mcpServers": {
        "agentmemory": {
          "command": "npx",
          "args": ["-y", "@agentmemory/mcp"]
        }
      }
    }
  4. Ask Codex for agentmemory tools.

Actual Result

Codex sees a reduced MCP surface instead of 51 tools.

In local testing:

  • Worker started without AGENTMEMORY_TOOLS=all exposed 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:

  1. Worker default:

    const mode = process.env["AGENTMEMORY_TOOLS"] || "core";
  2. Codex plugin .mcp.json does not set AGENTMEMORY_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/agentmemory

Validation

Added tests:

  • test/codex-plugin.test.ts: asserts Codex .mcp.json ships explicit loopback URL, all-tools mode, and force-proxy env.
  • test/mcp-standalone-proxy.test.ts: asserts the shim keeps all tools visible when AGENTMEMORY_TOOLS=all but 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.ts

Result:

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

  1. leoliner commented on May 15, 2026

    @leoliner

    same issue in claude code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions