`import tinyagent` raises NameError with mcp >= 2.0
@tonycoder-hub đang làm issue này rồi.
Từ ngày 28/9/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
-
Cap the dependency at
mcp<2. -
mcp_client.pyrecordsmissing_mcp_errorand raises a readable ImportError frommodel_post_init, but that guard never runs:ClientSessionandMCPToolare referenced in annotations evaluated at class creation, so the module raises NameError during import first. Binding both to placeholders in theexcept ImportErrorbranch 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.
- Ngôn ngữ chính
- Python
- Star
- 34
- Fork
- 7
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mozilla-ai/tinyagent
-
Running an agent mutates the caller-provided message listCó thể đã có người làm @cyyecao-lappland đã nhận 26 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
mozilla-ai/tinyagent#27 ·
-
Add Python 3.14 supportCó thể đã có người làm @barredterra đã nhận 128 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
mozilla-ai/tinyagent#16 ·
-
Invalid JSON tool arguments abort the run or prematurely return a final-answer errorCó thể đã có người làm @cyyecao-lappland đã nhận 26 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
mozilla-ai/tinyagent#29 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
mozilla-ai/tinyagent#24 ·
-
`uses_openai` gateway prefix is unreachable since any-llm retired the `gateway` providerCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
mozilla-ai/tinyagent#23 · 2 bình luận ·
Tất cả issue của mozilla-ai/tinyagent
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
admission-deferred priority: medium status: ready work-class: scoped
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
melodic-software/claude-code-plugins#10887 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
PoCInnovation/Distribox#255 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google/langextract#598 ·
Maintainer thường phản hồi trong vòng 1 ngày