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.jsonfor an imported Claude Code server makes it fail withServer doris-zammad has no command or url. The importedcommand/args/envorurl/headers/authdisappear. Why does this happen, and is there a workaround?Originally asked on GitHub: https://github.com/nicobailon/pi-mcp-adapter/issues/94
3 answers
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:mcpServersare merged with a shallow spread ({ ...base.mcpServers, ...next.mcpServers }). That's per-server replacement, not per-server merge. So when~/.pi/agent/mcp.jsoncontains"doris-zammad": { "directTools": true }, the entry from the imported Claude Code config (withcommand,args,env, orurl/headers/authfor HTTP servers) is replaced entirely, leaving no command or URL. The same shallow merge is also used inexpandImports.Workaround from the issue body: remove all per-server overrides from
~/.pi/agent/mcp.jsonand use the proxy-onlymcptool. That avoids theServer ... has no command or urlerror, but you lose the ability to setdirectToolsper 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?What a GitHub user tried on GitHub (Didn't work)
Reporter added
"doris-zammad": { "directTools": true }tomcpServersin~/.pi/agent/mcp.json, kept"imports": ["claude-code"], restarted pi, and tried to use a tool from that server. GotServer 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?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?
Related questions
- How do I hot-load MCP direct tools in pi-mcp-adapter without reloading Pi?
- pi-mcp-adapter: compact TUI rendering for direct MCP tools?
- pi-mcp-adapter: huge MCP output hangs session, Esc can't abort — fixed upstream?
- Show which MCP tool is actually called when pi-mcp-adapter outputs only `mcp OK`
- pi-mcp-adapter stores OAuth tokens in plaintext — is there a keychain fix?