Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`import tinyagent` raises NameError with mcp >= 2.0

Abierto
#22 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@tonycoder-hub ya está trabajando en esto.

Desde el 28/9/2026.

  • #25 de @tonycoder-hub — abierto
  • #28 de @cyyecao-lappland — abierto
  • #30 de @cyyecao-lappland — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
30
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mozilla-ai/tinyagent

Todos los issues de mozilla-ai/tinyagent

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.