anthropics / anthropics/claude-code-action

v1 accessing (MCP) tools despite `allowedTools` being empty?

Abierto
#533 6 comentarios 0 reacciones 0 asignados Ver en GitHub
bug p1
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

Since migrating to v1, I am unable to stop Claude from accessing MCP (and other) tools that it didn't seem to need with the previous beta action. I don't understand why it's trying to load 15 different tools since these tools didn't seem to be part of the beta action and yet the code reviews were being carried out fine.

These tools are also erroring with "this command requires approval". They also seem to utilize a ton of tokens.

I tried to do this through the usage of `allowedTools` and `disallowedTools` but it doesn't seem to work. Probably my syntax is wrong too for these.

This is what I have currently (that doesn't work):

```
claude_args: |
--system-prompt "Please refer to the project's CLAUDE.md file and .claude/agents/ documentation for:
- Architecture patterns and conventions to follow
- Testing patterns and requirements
- Code style guidelines and established practices
- Technology stack and framework usage
Pay special attention to violations of established patterns documented in these files."
--allowedTools ""
--disallowedTools "*"

# Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
use_sticky_comment: true
```

**Screenshots**
Here's a screenshot of a run:

Image

**Workflow yml file**
```
name: Claude Code Review

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]

jobs:
claude-review:
if: |
(github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Claude Code Review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
Review this PR and provide ONLY specific, actionable feedback.

claude_args: |
--system-prompt "Please refer to the project's CLAUDE.md file and .claude/agents/ documentation for:
- Architecture patterns and conventions to follow
- Testing patterns and requirements
- Code style guidelines and established practices
- Technology stack and framework usage
Pay special attention to violations of established patterns documented in these files."
--allowedTools ""
--disallowedTools "*"

use_sticky_comment: true
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.