-
Notifications
You must be signed in to change notification settings - Fork 1.7k
External MCP servers (e.g. Notion) listed in allowedTools but never connected at runtime #1191
Description
Bug: External MCP servers (e.g. Notion) listed in allowedTools but never connected at runtime
Summary
In GitHub Actions (anthropics/claude-code-action@v1), Notion MCP tools are present in SDK options.allowedTools, but the Notion MCP server is never connected at runtime.
As a result, Claude returns NOTION_MCP_UNAVAILABLE and ToolSearch cannot find mcp__notion__* tools.
Environment
Key | Value -- | -- Action | anthropics/claude-code-action@v1 Claude Code version (from logs) | 2.1.92 Runner | ubuntu-24.04 Workflow run date | 2026-04-07 Auth mode | claude_code_oauth_token show_full_output | trueMinimal Repro Setup
Workflow passes:
--mcp-config /tmp/mcp-notion.json--allowed-tools "mcp__notion__notion-fetch,..."NOTION_TOKENpresent (non-empty, verified)- MCP config file exists at
/tmp/mcp-notion.jsonbefore action starts
Timing Evidence (rules out file creation race condition)
14:29:05.856 → /tmp/mcp-notion.json written
14:29:05.891 → NOTION_TOKEN is set
14:29:05.905 → MCP config present (verified via cat)
14:29:05.946 → anthropics/claude-code-action@v1 starts
14:29:25.389 → SDK options.allowedTools contains mcp__notion__* ✅
14:29:27.905 → mcp_servers shows only `github_comment: connected` ❌
Conclusion: --mcp-config is read for allowedTools construction but apparently not used for actual MCP server registration at runtime.
Expected Behavior
mcp_servers should include:
notion: connected
and mcp__notion__notion-fetch should be callable.
Actual Behavior
Runtime init shows only:
github_comment: connected
No notion MCP server appears in mcp_servers.
ToolSearch output:
- query
select:mcp__notion__notion-fetch→No matching deferred tools found - query
notion→No matching deferred tools found
Final assistant result: NOTION_MCP_UNAVAILABLE
Evidence from Logs
CLAUDE_ARGSincludes:--mcp-config /tmp/mcp-notion.json --allowed-tools "mcp__notion__notion-fetch,..."SDK options.allowedToolsincludes allmcp__notion__*entries ✅mcp_serverscontains onlygithub_comment(connected), nonotion❌ToolSearchcannot find notion tools- Assistant posts
NOTION_MCP_UNAVAILABLE
Control Test (rules out token/permission issues)
Direct Notion API smoke test in a separate workflow (without Claude action) succeeds:
NOTION_TOKEN present
HTTP/2 200
NOTION_FETCH_OK
Page ID: 325765e5-dc96-81fc-b772-e7a3cf48dfa5
Token and page permissions are confirmed valid. The issue is isolated to the action runtime.
Hypothesis
The claude-code-action appears to have two separate code paths:
- Tool allowlist: reads
--mcp-configand populatesallowedTools✅ - MCP server registration: does not use
--mcp-configto connect the server ❌
github_comment connects because it is hardcoded inside the action.
External servers passed via --mcp-config / claude_args seem to be ignored at the connect step.
Specific Question for Maintainers
Does
--mcp-configpassed viaclaude_argsget forwarded to the SDK's MCP server registration step, or only toallowedToolsparsing?
Is connecting external MCP servers via--mcp-configcurrently supported inclaude-code-action, or must servers be hardcoded in the action itself?
Full run links and sanitized logs available on request.