[Feature Request] Print mode support MCP servers
Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 7 comments · opened Mar 24, 2025 · closed Mar 25, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
Would be great to have MCP support in print mode. I've tried several various ways to get Claude code with print/non interactive mode (-p) to use an MCP but it just ignores it. I also tried included the tool used by the MCP server in the allowed tools list but did not have any luck.
The same command in interactive mode successfully calls the MCP
7 Comments
This is something we support. Can you share more details about the command you're providing? Also any details about the MCP server configuration if possible (
claude mcp get <serverName>).Yeah! Let me try to provide some more info:
Inside the claude interactive, same dir:
And then it asks me if I want to proceed or allow-list it for the directory.
With print mode:
This is fixed in 0.2.54!
NIce! Can you provide an example for what the
allowedToolsstring should be?MCP server tools get provided to the model as
mcp__${serverName}__${toolName}. So you'd probably want:or if you wanted to allow multiple, you could do something like
We'll be making it a bit easier to allow everything from a single server soon, as well as adding this to the public-facing docs.
Ah works great, thank you!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.