Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

mcp: allowing an MCP tool by its documented name hides it; the bare name must be allowed too

Aperta Adatta ai principianti
#54,919 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
security, tooling

Direzione di ricerca

Leggi packages/core/src/tool.ts intorno alla riga 231 e packages/core/src/tool/mcp.ts intorno alla riga 52 per seguire i due controlli delle autorizzazioni. Riproduci il problema con le autorizzazioni e il comando opencode run dell’issue, quindi verifica che consentire tutorapi_section_read renda lo strumento visibile e invocabile. L’issue suggerisce di registrare gli strumenti MCP con il nome di autorizzazione documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

What we want: an agent that may use only one MCP tool — section_read from the local MCP server tutorapi.

As the docs say — does not work, the agent does not see the tool:

permissions:
  - { action: "*", resource: "*", effect: deny }
  - { action: tutorapi_section_read, resource: "*", effect: allow }

What works — the same tool allowed twice, also by its bare name:

permissions:
  - { action: "*", resource: "*", effect: deny }
  - { action: section_read, resource: "*", effect: allow }
  - { action: tutorapi_section_read, resource: "*", effect: allow }

Why: OpenCode checks the permission twice, under different names:

  • section_read — when it decides whether to show the tool to the agent;
  • tutorapi_section_read — when the agent calls the tool.

Where in the code (v2.0.27):

  • packages/core/src/tool.ts:231 — tool list: whollyDisabled(tool.options?.permission ?? name, rules). MCP tools are registered without options.permission, so the bare name is checked.
  • packages/core/src/tool/mcp.ts:52 — tool call: permission.assert({ action: name(tool.server, tool.name), ... }).
  • Possible fix: register MCP tools with options.permission: name(tool.server, tool.name).
Plugins

opencode-claude (local plugin), openchamber agent-tool

OpenCode version

2.0.25 (the same code is in v2.0.27)

Steps to reproduce
  1. opencode run --agent <agent with the first permissions> --model <model> "List the names of all your tools." — section_read is not listed.
  2. Same with the second permissions — section_read is listed and the call succeeds.
Operating System

Windows 11 (10.0.26200)

Terminal

None, opencode run started from a Node script.

Lingua principale
TypeScript
Stelle
213k
Fork
28.4k
Merge medio
8h 32m
PR unite (30g)
253

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.