anthropics / anthropics/claude-code-action

Tag mode filters user MCP tools to only mcp__github_* - was this intentional?

Open
#695 1 comment 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

## Question

In tag mode (`src/modes/tag/index.ts`), user-specified MCP tools from `--allowedTools` are filtered to only include GitHub MCP tools:

```typescript
const userAllowedMCPTools = parseAllowedTools(userClaudeArgs).filter(
(tool) => tool.startsWith("mcp__github_"),
);
```

This was introduced in PR #556 to fix issue #548 (GitHub MCP tools not loading).

**Was this intentional to only allow GitHub MCP servers in tag mode?**

## The Problem

Users who add custom MCP servers via `--mcp-config` cannot use them in tag mode because their tools get filtered out. For example:

```yaml
claude_args: |
--mcp-config .github/custom-mcp.json
--allowed-tools "mcp__custom_server__some_tool"
```

The `mcp__custom_server__some_tool` is filtered out and never added to `tagModeTools`, so Claude gets permission denied when trying to use it.

## Agent Mode Works Differently

In agent mode (`src/modes/agent/index.ts`), there's no such filter - user's `claude_args` are passed through as-is:

```typescript
// Append user's claude_args (which may have more --mcp-config flags)
claudeArgs = `${claudeArgs} ${userClaudeArgs}`.trim();
```

## Expected Behavior

Users should be able to add custom MCP servers to tag mode the same way they can in agent mode, as documented in `docs/configuration.md`:

> You can add custom MCP (Model Context Protocol) servers to extend Claude's capabilities using the `--mcp-config` flag in `claude_args`. These servers merge with the built-in GitHub MCP servers.

## Suggested Fix

Remove the `.filter((tool) => tool.startsWith("mcp__github_"))` and allow all user-specified MCP tools:

```typescript
const userAllowedMCPTools = parseAllowedTools(userClaudeArgs);
// Include ALL user-specified MCP tools, not just mcp__github_ ones
```

The MCP server configs for non-GitHub servers come from the user's `--mcp-config` flag, not from `prepareMcpConfig()`, so the filter isn't needed.

## References

- PR #556 that introduced the filter
- Issue #548 that #556 was fixing
- `docs/configuration.md` documenting custom MCP server support

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.