claude-code - 💡(How to fix) Fix allowedMcpServers cannot include Claude.ai Cowork connectors — name format conflict with schema validation [3 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#48758Fetched 2026-04-16 06:51:47
View on GitHub
Comments
3
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×5commented ×3

When using allowedMcpServers in managed settings to restrict which MCP servers are allowed, Claude.ai Cowork connectors (Atlassian, Slack, Gmail, etc.) cannot be included in the allowlist. Their actual registered server names use the format "claude.ai <ServiceName>" (dot + space), but the allowedMcpServers.serverName field only accepts letters, numbers, hyphens, and underscores — rejecting any entry with dots or spaces.

Scope: Reproduced on the VS Code extension (v2.1.109). Cowork connectors sync from the claude.ai account session in the VS Code extension context — they do not appear in the CLI (claude in terminal) in the same way. The naming conflict therefore only surfaces in the VS Code extension.

Root Cause

The actual registered names of Cowork connectors (visible in ~/.claude/mcp-needs-auth-cache.json) are:

claude.ai Atlassian
claude.ai Slack
claude.ai Gmail
claude.ai Linear
claude.ai Miro
claude.ai Google Calendar

These contain a dot and space — characters explicitly rejected by the serverName validation. There is no valid way to represent these names in allowedMcpServers.

Code Example

claude.ai Atlassian
claude.ai Slack
claude.ai Gmail
claude.ai Linear
claude.ai Miro
claude.ai Google Calendar
RAW_BUFFERClick to expand / collapse

Description

When using allowedMcpServers in managed settings to restrict which MCP servers are allowed, Claude.ai Cowork connectors (Atlassian, Slack, Gmail, etc.) cannot be included in the allowlist. Their actual registered server names use the format "claude.ai <ServiceName>" (dot + space), but the allowedMcpServers.serverName field only accepts letters, numbers, hyphens, and underscores — rejecting any entry with dots or spaces.

Scope: Reproduced on the VS Code extension (v2.1.109). Cowork connectors sync from the claude.ai account session in the VS Code extension context — they do not appear in the CLI (claude in terminal) in the same way. The naming conflict therefore only surfaces in the VS Code extension.

Steps to reproduce

  1. Enable Claude.ai Cowork connectors (Atlassian, Slack, Gmail, etc.) in your claude.ai account
  2. Open Claude Code VS Code extension — Cowork connectors appear and work normally
  3. Deploy managed settings with allowedMcpServers listing Cowork connectors using the only valid format (claude_ai_Atlassian, claude_ai_Slack, etc.)
  4. Reload VS Code
  5. All Cowork connectors disappear — they are blocked

Alternatively, attempt to add { "serverName": "claude.ai Atlassian" } — Claude Code rejects the entire settings file with: "Server name can only contain letters, numbers, hyphens, and underscores"

Root cause

The actual registered names of Cowork connectors (visible in ~/.claude/mcp-needs-auth-cache.json) are:

claude.ai Atlassian
claude.ai Slack
claude.ai Gmail
claude.ai Linear
claude.ai Miro
claude.ai Google Calendar

These contain a dot and space — characters explicitly rejected by the serverName validation. There is no valid way to represent these names in allowedMcpServers.

Behaviour observed through testing

ConfigResult
allowedMcpServers with claude_ai_Atlassian (underscores)Cowork connectors blocked — names don't match
allowedMcpServers with "claude.ai Atlassian" (actual name)Settings file rejected — invalid characters
allowManagedMcpServersOnly: true with no allowedMcpServersAll servers allowed — flag is a no-op without list
No allowedMcpServers keyCowork connectors work

Impact

Organisations deploying managed settings via MDM cannot use allowManagedMcpServersOnly + allowedMcpServers to restrict MCP servers to an approved list while also allowing Cowork connectors in the VS Code extension. The two features are mutually exclusive.

Expected behaviour

One of:

  1. Cowork connectors should register under names that are valid serverName values (e.g. claude_ai_Atlassian)
  2. allowedMcpServers should support a separate field (e.g. displayName or coworkConnector) for matching Cowork connectors by their actual names
  3. allowManagedMcpServersOnly: true without allowedMcpServers should restrict to managed/Cowork servers only (currently it allows everything, making the flag a no-op)

Environment

  • macOS, Claude Code VS Code extension v2.1.109
  • Managed settings deployed via /Library/Application Support/ClaudeCode/managed-settings.json

extent analysis

TL;DR

The most likely fix is to update the allowedMcpServers validation to support dots and spaces in server names or use an alternative field for matching Cowork connectors.

Guidance

  • Consider updating the serverName validation to allow dots and spaces, enabling the use of actual Cowork connector names like "claude.ai Atlassian".
  • Alternatively, introduce a separate field (e.g., displayName or coworkConnector) in allowedMcpServers to match Cowork connectors by their actual names.
  • Review the allowManagedMcpServersOnly flag behavior to ensure it restricts servers correctly when used without allowedMcpServers.
  • Test the updated configuration to verify that Cowork connectors are allowed while other servers are restricted.

Example

No code snippet is provided as the issue is related to configuration and validation rather than code implementation.

Notes

The current implementation of allowedMcpServers and allowManagedMcpServersOnly seems to have limitations that make it difficult to restrict MCP servers while allowing Cowork connectors. Updating the validation or introducing a new field may require changes to the underlying implementation.

Recommendation

Apply a workaround by using a separate field for matching Cowork connectors, as updating the serverName validation might require significant changes. This approach allows for a more flexible and backward-compatible solution.

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