Ejecutar Python en MCP
Servidor de protocolo de contexto de modelo para ejecutar código Python en un entorno sandbox.
El código se ejecuta utilizando Pyodide en Deno y, por lo tanto, está aislado del resto del sistema operativo.
Consulte https://ai.pydantic.dev/mcp/run-python/ para obtener la documentación completa.
El servidor se puede ejecutar con deno
instalado usando:
dónde:
-N -R=node_modules -W=node_modules
(alias de--allow-net --allow-read=node_modules --allow-write=node_modules
) permite el acceso de red y de lectura y escritura a./node_modules
. Estos son necesarios para que pyodide pueda descargar y almacenar en caché la biblioteca estándar y los paquetes de Python.--node-modules-dir=auto
le dice a deno que use un directorionode_modules
localstdio
ejecuta el servidor con el transporte MCP de Stdio , adecuado para ejecutar el proceso como un subproceso localmentesse
ejecuta el servidor con el transporte SSE MCP , ejecutando el servidor como un servidor HTTP para conectarse local o remotamentewarmup
ejecutará un script mínimo de Python para descargar y almacenar en caché la biblioteca estándar de Python. Esto también es útil para comprobar el correcto funcionamiento del servidor.
Aquí hay un ejemplo del uso de @pydantic/mcp-run-python
con PydanticAI:
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Servidor de protocolo de contexto de modelo para ejecutar código Python en un entorno sandbox.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that allows management and execution of Blender Python scripts, enabling users to create, edit and run scripts in a headless Blender environment through natural language interfaces.Last updated -4Python
- -securityAlicense-qualityA Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.Last updated -2PythonMIT License
- -securityAlicense-qualityA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.Last updated -14PythonMIT License
- -securityFlicense-qualityA Python-based implementation of the Model Context Protocol that enables communication between a model context management server and client through a request-response architecture.Last updated -Python