Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#54,919 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
security, tooling

調査の方向性

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 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.

主要言語
TypeScript
スター
213k
フォーク
28.4k
平均マージ
7時間 22分
マージ済み PR(30日)
276

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。