Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`import tinyagent` raises NameError with mcp >= 2.0

Aperta
#22 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@tonycoder-hub ci sta già lavorando.

Dal 28/9/2026.

  • #25 di @tonycoder-hub — aperta
  • #28 di @cyyecao-lappland — aperta
  • #30 di @cyyecao-lappland — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
30
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mozilla-ai/tinyagent

Tutte le issue di mozilla-ai/tinyagent

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.