claude-code - 💡(How to fix) Fix Feature: per-project MCP server scoping (exclude account-level integrations) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49638Fetched 2026-04-17 08:35:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Fix Action

Fix / Workaround

  • Claude Code `~/.claude/settings.json` / `.mcp.json`: can ADD project-scoped MCP servers, but cannot EXCLUDE account-level ones
  • Claude.ai account integrations: load globally — no per-project filter
  • No `disabledMcpServers`, no CLI flag, no env var to scope per-session
  • Workaround: disconnect integrations from the account entirely — but this removes them from ALL sessions, including ones that need them
RAW_BUFFERClick to expand / collapse

Problem

When Claude.ai account-level MCP integrations are connected (e.g. Canva, Gmail, Google Calendar, Lucid Chart, GitHub MCP, Dropbox, Context7), all of them load into every Claude Code session regardless of project context. There's no way to scope which integrations are active per project.

This creates unnecessary context window overhead for sessions that only need a subset. A coding session in a Python backend repo gets ~100 deferred tool definitions from Canva, Gmail, and Calendar that will never be called. Meanwhile a PM/design project legitimately needs those same tools.

Current state

  • Claude Code `~/.claude/settings.json` / `.mcp.json`: can ADD project-scoped MCP servers, but cannot EXCLUDE account-level ones
  • Claude.ai account integrations: load globally — no per-project filter
  • No `disabledMcpServers`, no CLI flag, no env var to scope per-session
  • Workaround: disconnect integrations from the account entirely — but this removes them from ALL sessions, including ones that need them

Impact

Even with deferred tool schemas (names listed but schemas not loaded until `ToolSearch` is called), the tool-name listing in system reminders consumes ~2-3K tokens per session. For users with 5-10+ integrations connected, this adds up — especially in long coding sessions where context budget matters.

Proposal

Allow per-project MCP server scoping. Two possible mechanisms:

Option A: `disabledMcpServers` in project config

In `.claude/settings.json` (project-level):

```json { "disabledMcpServers": ["Canva", "Gmail", "Google_Calendar", "Lucid_Chart"] } ```

Account-level integrations matching these names would not load for sessions in this project.

Option B: `allowedMcpServers` (allowlist)

```json { "allowedMcpServers": ["Context7", "GitHub_MCP", "DropBox"] } ```

Only these integrations load; all others are excluded. Simpler mental model but requires updating the list when adding new servers.

Option C: Claude.ai project-level integration scoping

In the Claude.ai web UI, allow per-project integration settings — "this project uses Context7 + GitHub; that project uses the full set."

Use case

  • Coding project (Python/TS backend): needs Context7 (docs), GitHub MCP (issues/PRs), maybe Dropbox (screenshots)
  • PM/design project: needs Canva (design), Gmail (comms), Calendar (scheduling), plus the above
  • Both projects share the same Claude.ai account — currently impossible to give each only what it needs

Environment

  • Claude Code CLI on macOS (Mac Mini M4)
  • 7 account-level MCP integrations connected
  • Multiple projects with different tooling needs

extent analysis

TL;DR

Implementing a project-level configuration to scope MCP servers, such as using disabledMcpServers or allowedMcpServers in the project's .claude/settings.json, is likely to resolve the issue of unnecessary integrations loading into every Claude Code session.

Guidance

  1. Evaluate Option A: Add a disabledMcpServers list to the project's .claude/settings.json to exclude specific account-level integrations from loading in that project.
  2. Consider Option B: Implement an allowedMcpServers allowlist in the project configuration to only load specified integrations, simplifying the mental model but requiring updates when adding new servers.
  3. Explore Option C: Develop a project-level integration scoping feature in the Claude.ai web UI to manage per-project integration settings directly.
  4. Test with a small set of projects: Start by configuring a few projects with different integration needs to verify the effectiveness of the chosen solution.
  5. Monitor performance impact: Observe the reduction in context window overhead and token consumption after implementing the project-level scoping solution.

Example

{
  "disabledMcpServers": ["Canva", "Gmail", "Google_Calendar"]
}

or

{
  "allowedMcpServers": ["Context7", "GitHub_MCP", "DropBox"]
}

Notes

The proposed solutions require modifications to the project configuration or the Claude.ai web UI. It is essential to test these changes with a small set of projects before rolling them out to all projects to ensure the desired outcome and minimal disruption.

Recommendation

Apply a workaround by implementing Option A (disabledMcpServers) or Option B (allowedMcpServers) in the project configuration, as these seem to be the most straightforward solutions to achieve per-project MCP server scoping.

FAIL-SAFE: If the provided information is insufficient, a minimal TL;DR and 1-2 safe guidance points would be:

TL;DR

Implement project-level configuration to scope MCP servers.

Guidance

  1. Evaluate possible solutions for project-level MCP server scoping.
  2. Test any proposed solution with a small set of projects before wider implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature: per-project MCP server scoping (exclude account-level integrations) [1 comments, 2 participants]