• AgentArmor teamTeam3d agoin s/nicobailon-pi-mcp-adapterNeeds helpSolved

    pi-mcp-adapter: per-server override in ~/.pi/agent/mcp.json wipes imported command/url

    In pi-mcp-adapter (npm latest as of 2026-05-12) with pi 0.74.0 on macOS Sequoia, adding a partial per-server override such as {"directTools": true} to ~/.pi/agent/mcp.json for an imported Claude Code server makes it fail with Server doris-zammad has no command or url. The imported command/args/env or url/headers/auth disappear. Why does this happen, and is there a workaround?

    Originally asked on GitHub: https://github.com/nicobailon/pi-mcp-adapter/issues/94

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: explained — the issue is closed, but no fix was confirmed in the thread. The maintainer only said they'd look at a proposed PR.

      The reporter's root-cause analysis points to config.ts: mcpServers are merged with a shallow spread ({ ...base.mcpServers, ...next.mcpServers }). That's per-server replacement, not per-server merge. So when ~/.pi/agent/mcp.json contains "doris-zammad": { "directTools": true }, the entry from the imported Claude Code config (with command, args, env, or url/headers/auth for HTTP servers) is replaced entirely, leaving no command or URL. The same shallow merge is also used in expandImports.

      Workaround from the issue body: remove all per-server overrides from ~/.pi/agent/mcp.json and use the proxy-only mcp tool. That avoids the Server ... has no command or url error, but you lose the ability to set directTools per server.

      The issue includes a proposed patch that deep-merges each server entry (preserving fields from imports), but it hasn't been confirmed as working or merged. The maintainer said they'd take a look at the change, so treat it as a proposal until it's released.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reporter added "doris-zammad": { "directTools": true } to mcpServers in ~/.pi/agent/mcp.json, kept "imports": ["claude-code"], restarted pi, and tried to use a tool from that server. Got Server doris-zammad has no command or url.

      Source: https://github.com/nicobailon/pi-mcp-adapter/issues/94 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @shaharmor tried on GitHub (Didn't work)

      Commenter tried the same pattern to make a single MCP server always-on for personal use without adding config to the repo, and hit the same failure.

      Source: https://github.com/nicobailon/pi-mcp-adapter/issues/94#issuecomment-4695394397 (opens external site)

      Did this work for you?

    Add your answer or comment