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

`import tinyagent` raises NameError with mcp >= 2.0

オープン
#22 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@tonycoder-hub がすでに取り組んでいます。

2026年9月28日 から。

  • #25 @tonycoder-hub による — オープン
  • #28 @cyyecao-lappland による — オープン
  • #30 @cyyecao-lappland による — オープン

評価

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

調査の方向性

Start by reproducing the failure with the pip install and python import commands from the issue. Inspect the dependency declaration and tinyagent/tools/mcp/mcp_client.py, including its ImportError handling and annotations. Done means mcp is capped below 2 and importing tinyagent succeeds or produces the existing readable ImportError instead of a NameError.

索引モデルが issue の本文から書いたものです。

説明

mozilla-ai-tinyagent 0.1.1 declares mcp without an upper bound, and mcp 2.0 renamed mcp.client.streamable_http.streamablehttp_client to streamable_http_client. A fresh install resolves mcp 2.2.0 and the package cannot be imported.

pip install mozilla-ai-tinyagent
python -c "import tinyagent"
File ".../tinyagent/tools/mcp/mcp_client.py", line 88, in MCPClient
    async def list_raw_tools(self) -> list[MCPTool]:
NameError: name 'MCPTool' is not defined

Two fixes, both worth making:

  1. Cap the dependency at mcp<2.

  2. mcp_client.py records missing_mcp_error and raises a readable ImportError from model_post_init, but that guard never runs: ClientSession and MCPTool are referenced in annotations evaluated at class creation, so the module raises NameError during import first. Binding both to placeholders in the except ImportError branch makes the existing guard work, so a future mcp change degrades instead of breaking the import.

This also breaks any-agent, which imports tinyagent.config at package import and now hard-depends on this package. any-agent is capping mcp on its side, but that does not help direct tinyagent users.

Note: this issue was drafted by Claude Opus 5 via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's.

主要言語
Python
スター
33
フォーク
7
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

mozilla-ai/tinyagent のほかの issue

mozilla-ai/tinyagent の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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