Skip to content

External MCP servers (e.g. Notion) listed in allowedTools but never connected at runtime #1191

@oiramsch

Description

@oiramsch

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 | true

Minimal Repro Setup

Workflow passes:

  • --mcp-config /tmp/mcp-notion.json
  • --allowed-tools "mcp__notion__notion-fetch,..."
  • NOTION_TOKEN present (non-empty, verified)
  • MCP config file exists at /tmp/mcp-notion.json before 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

  1. CLAUDE_ARGS includes:
    --mcp-config /tmp/mcp-notion.json --allowed-tools "mcp__notion__notion-fetch,..."
  2. SDK options.allowedTools includes all mcp__notion__* entries ✅
  3. mcp_servers contains only github_comment (connected), no notion 
  4. ToolSearch cannot find notion tools
  5. 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:

  1. Tool allowlist: reads --mcp-config and populates allowedTools 
  2. MCP server registration: does not use --mcp-config to 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-config passed via claude_args get forwarded to the SDK's MCP server registration step, or only to allowedTools parsing?
Is connecting external MCP servers via --mcp-config currently supported in claude-code-action, or must servers be hardcoded in the action itself?


Full run links and sanitized logs available on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmcpp2Non-showstopper bug or popular feature request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions