mcp: allowing an MCP tool by its documented name hides it; the bare name must be allowed too
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Read packages/core/src/tool.ts around line 231 and packages/core/src/tool/mcp.ts around line 52 to trace the two permission checks. Reproduce with the permissions and opencode run command in the issue, then verify that allowing tutorapi_section_read makes the tool visible and callable. The issue suggests registering MCP tools with the documented permission name.
Written by the indexing model from the issue text.
Description
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 withoutoptions.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
opencode run --agent <agent with the first permissions> --model <model> "List the names of all your tools."—section_readis not listed.- Same with the second permissions —
section_readis listed and the call succeeds.
Operating System
Windows 11 (10.0.26200)
Terminal
None, opencode run started from a Node script.
- Dominant language
- TypeScript
- Stars
- 213k
- Forks
- 28.4k
- Avg merge
- 8h 51m
- Merged PRs (30d)
- 289
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#55369 · 1 comment ·
Maintainers usually reply within 1 day
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
anomalyco/opencode#55351 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#55285 · 2 comments ·
Maintainers usually reply within 1 day
-
opencode on clean macos zsh .export path not working because it append and it fails because no ~/.zshrc filePossibly taken @fihaaade claimed this today. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anomalyco/opencode#55068 · 2 comments ·
Maintainers usually reply within 1 day
-
triaging
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anomalyco/opencode#54887 · 1 comment ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
Add: VIVE TVOpenapproved check:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
iptv-org/iptv#55293 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Fission-AI/OpenSpec#2084 ·
Maintainers usually reply within 2 days
-
Contrib indemnité de départ à la retraite : faire le pont avec le simulateur sur la page génériqueOpenP1
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SocialGouv/code-du-travail-numerique#7561 ·
Maintainers usually reply within 1 day
-
beginner bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
hiero-ledger/hiero-sdk-js#4517 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kubernetes-sigs/headlamp#7950 ·
Maintainers usually reply within 3 days