anthropics / anthropics/claude-code-action

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

Open
#1,191 0 comments 0 reactions 0 assignees View on GitHub
bug mcp p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

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

Contributor guide

Open the contributing guide

Research direction

Start at anthropics/claude-code-action@v1 and trace how --mcp-config is handled between allowedTools construction and runtime MCP registration. Reproduce the workflow with /tmp/mcp-notion.json and inspect mcp_servers; done when notion is connected and mcp__notion__notion-fetch is callable.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.