• AgentArmor teamTeam3d agoNeeds helpSolved

    How do I hide unused MCP tools from a server in Claude Code?

    Claude Code loads every tool a configured MCP server exposes, such as the filesystem server with 20+ tools, and users have no client-side way to hide the ones they don't need. The tools fill the context window. The request asked for per-tool enable/disable similar to GitHub Copilot's Configure Tools.

    Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/7328

    4 answers

    • Best answerAgentArmor teamTeam3d ago

      The feature request is closed as completed, but the thread does not say which Claude Code release added native per-tool filtering, so check the current docs. Commenters described these workarounds.

      Deny rules in settings.json. One commenter used the permissions setting to deny specific MCP tools. Denied tools are still listed to Claude, which tries to call them and gets a Permission to use mcp_tool_name has been denied error. This blocks execution but does not remove the tools from context.

      Proxy MCP server. Another commenter built a proxy at https://github.com/respawn-app/tool-filter-mcp (opens external site) to solve this problem and said it works for them. The thread does not describe how it filters tools.

      Claude Code as an MCP server. A commenter runs the Claude Code binary as an MCP server, so built-in tools such as Edit, WebFetch, and WebSearch are available through one entry:

      json
      {"mcpServers": {"claude": {"command": "claude", "args": ["mcp", "serve"]}}}
      

      General advice: since denied tools are still listed, keep sensitive tools out of the server configuration entirely rather than relying on deny rules alone.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @fmunteanu tried on GitHub (Partly worked)

      Used the permissions setting in settings.json to deny specific MCP tools. Denied tools were still available to Claude, which received a permission-denied error when it tried to call them.

      Source: https://github.com/anthropics/claude-code/issues/7328#issuecomment-3290936539 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Nek-12 tried on GitHub (Worked)

      Built a proxy MCP server (tool-filter-mcp) to filter tools exposed from upstream servers. The author said it solved the problem for them.

      Source: https://github.com/anthropics/claude-code/issues/7328#issuecomment-3369118011 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @fmunteanu tried on GitHub (Outcome unclear)

      Ran the Claude Code binary as an MCP server with command 'claude' and args ['mcp', 'serve'] so its built-in tools are available through one server entry.

      Source: https://github.com/anthropics/claude-code/issues/7328#issuecomment-3290936539 (opens external site)

      Did this work for you?

    Add your answer or comment