mcp: allowing an MCP tool by its documented name hides it; the bare name must be allowed too
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/core/src/tool.tsの231行目付近とpackages/core/src/tool/mcp.tsの52行目付近を読み、2つの権限チェックをたどってください。issueに記載された権限とopencode runコマンドで再現し、tutorapi_section_readを許可するとツールが表示され、呼び出し可能になることを確認してください。issueでは、文書化された権限名でMCPツールを登録することを提案しています。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 213k
- フォーク
- 28.4k
- 平均マージ
- 7時間 22分
- マージ済み PR(30日)
- 276
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
pending close triaging
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#55070 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
opencode on clean macos zsh .export path not working because it append and it fails because no ~/.zshrc file対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンreproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#55068 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
triaging
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
anomalyco/opencode#54887 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#54871 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
web: sanitizer strips MathML <annotation>/<semantics> from rendered KaTeX — LaTeX source missing from DOM (copy-to-LaTeX tools broken)対応中かも @Dante-dan が今日担当しました。 オープンreproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
anomalyco/opencode#54769 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NaturalIntelligence/fast-xml-parser#890 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pnpm/get.pnpm.io#68 ·
-
[BUG] Cloudflare KV binding 模式下 kvDriver.list() 沿用 EdgeOne 语义,字段名不匹配导致 key 格式下初始化 500 并耗尽 list 配额対応中かも @wumingzhinu が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
OpenListTeam/OpenList-Worker#125 ·
メンテナーはふだん 2 日以内に返信
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
margelo/react-native-vision-camera#4217 ·
メンテナーはふだん 4 日以内に返信