claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE REQUEST] Claude Code - Disable specific functions in MCP to save Context Tokens

Open AuthenTech-AI opened this issue 4 months ago • 8 comments

Currently in Claude Desktop, I can disable and enable specific functions within a MCP.

I searched the Documentation, asked Claude Code and have searched, but everything I've found said I could not disable specific MCP functions running in Claude Code.

My goal is to decrease the Context usage for MCP functions that I do not need.

Thanks!

AuthenTech-AI avatar Aug 28 '25 18:08 AuthenTech-AI

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4906
  2. https://github.com/anthropics/claude-code/issues/4380
  3. https://github.com/anthropics/claude-code/issues/3206

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 28 '25 18:08 github-actions[bot]

We absolutely need this. When I start a Claude code chat, right off the bat 33% of my context window is taken up by MCP tools I never use.

to illustrate

when running /context I see just for the Supabase MCP:

 └ mcp__supabase__search_docs (supabase): 2.7k tokens
     └ mcp__supabase__list_tables (supabase): 437 tokens
     └ mcp__supabase__list_extensions (supabase): 395 tokens
     └ mcp__supabase__list_migrations (supabase): 395 tokens
     └ mcp__supabase__apply_migration (supabase): 468 tokens
     └ mcp__supabase__execute_sql (supabase): 457 tokens
     └ mcp__supabase__get_logs (supabase): 499 tokens
     └ mcp__supabase__get_advisors (supabase): 499 tokens
     └ mcp__supabase__get_project_url (supabase): 398 tokens
     └ mcp__supabase__get_anon_key (supabase): 400 tokens
     └ mcp__supabase__generate_typescript_types (supabase): 399 tokens
     └ mcp__supabase__list_edge_functions (supabase): 402 tokens
     └ mcp__supabase__deploy_edge_function (supabase): 707 tokens
     └ mcp__supabase__create_branch (supabase): 518 tokens
     └ mcp__supabase__list_branches (supabase): 424 tokens
     └ mcp__supabase__delete_branch (supabase): 413 tokens
     └ mcp__supabase__merge_branch (supabase): 420 tokens
     └ mcp__supabase__reset_branch (supabase): 453 tokens
     └ mcp__supabase__rebase_branch (supabase): 434 tokens

and yet I only ever use ONE of those, the mcp__supabase__execute_sql

hyper-lode avatar Sep 01 '25 11:09 hyper-lode

Yes we really need to have this feature asap

freezscholte avatar Sep 10 '25 11:09 freezscholte

I've tried global deny permissions but that does not limit the context usage of the tool definition. This is my root ~/.claude/settings.json definition:

{
    "permissions": {
        "deny": [
            "mcp__atlassian__atlassianUserInfo",
            "mcp__atlassian__getAccessibleAtlassianResources",
            "mcp__atlassian__getConfluenceSpaces",
            "mcp__atlassian__getConfluencePage",
            "mcp__atlassian__getPagesInConfluenceSpace",
            "mcp__atlassian__getConfluencePageFooterComments",
            "mcp__atlassian__getConfluencePageInlineComments",
            "mcp__atlassian__getConfluencePageDescendants",
            "mcp__atlassian__createConfluencePage",
            "mcp__atlassian__updateConfluencePage",
            "mcp__atlassian__createConfluenceFooterComment",
            "mcp__atlassian__createConfluenceInlineComment",
            "mcp__atlassian__searchConfluenceUsingCql"
        ]
    }
}

After closing and reopening my claude session these tool calls are still consuming precious context:

Image

clafollett avatar Sep 17 '25 11:09 clafollett

Hey guys! Since there was no response and there was no tool to accomplish this task, I vibe-coded a proxy mcp with one purpose - to solve this problem.

https://github.com/respawn-app/tool-filter-mcp

Let me know if it works for you! So far I was able to remove 25+ tools at work and am not having any issues.

Nek-12 avatar Oct 01 '25 12:10 Nek-12

Can someone from @ah-anthropic comment if this is on the roadmap or not?

hyper-lode avatar Oct 02 '25 07:10 hyper-lode

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 07 '25 10:12 github-actions[bot]

That would still be very useful.

mrclrchtr avatar Dec 07 '25 12:12 mrclrchtr