mcp-run-python
OfficialMCP Run Python
Model Context Protocol -Server zum Ausführen von Python-Code in einer Sandbox.
Der Code wird mit Pyodide in Deno ausgeführt und ist daher vom Rest des Betriebssystems isoliert.
Die vollständige Dokumentation finden Sie unter https://ai.pydantic.dev/mcp/run-python/ .
Der Server kann mit installiertem deno ausgeführt werden, indem Folgendes verwendet wird:
deno run \
-N -R=node_modules -W=node_modules --node-modules-dir=auto \
jsr:@pydantic/mcp-run-python [stdio|sse|warmup]Wo:
-N -R=node_modules -W=node_modules(Alias von--allow-net --allow-read=node_modules --allow-write=node_modules) ermöglicht Netzwerkzugriff sowie Lese- und Schreibzugriff auf./node_modules. Diese sind erforderlich, damit pyodide die Python-Standardbibliothek und -Pakete herunterladen und zwischenspeichern kann.--node-modules-dir=autoweist deno an, ein lokalesnode_modules-Verzeichnis zu verwendenstdioführt den Server mit dem Stdio MCP-Transport aus – geeignet, um den Prozess lokal als Unterprozess auszuführenssebetreibt den Server mit dem SSE MCP-Transport – er betreibt den Server als HTTP-Server für lokale oder Remote-Verbindungenwarmupführt ein minimales Python-Skript aus, um die Python-Standardbibliothek herunterzuladen und zwischenzuspeichern. Dies ist auch nützlich, um zu überprüfen, ob der Server korrekt läuft.
Hier ist ein Beispiel für die Verwendung von @pydantic/mcp-run-python mit PydanticAI:
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio
import logfire
logfire.configure()
logfire.instrument_mcp()
logfire.instrument_pydantic_ai()
server = MCPServerStdio('deno',
args=[
'run',
'-N',
'-R=node_modules',
'-W=node_modules',
'--node-modules-dir=auto',
'jsr:@pydantic/mcp-run-python',
'stdio',
])
agent = Agent('claude-3-5-haiku-latest', mcp_servers=[server])
async def main():
async with agent.run_mcp_servers():
result = await agent.run('How many days between 2000-01-01 and 2025-03-18?')
print(result.output)
#> There are 9,208 days between January 1, 2000, and March 18, 2025.w
if __name__ == '__main__':
import asyncio
asyncio.run(main())This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA 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.11
- -license-quality-maintenanceA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.12
- Flicense-qualityDmaintenanceA Python-based implementation of the Model Context Protocol that enables communication between a model context management server and client through a request-response architecture.
- FlicenseAqualityCmaintenanceA Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.10102
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
Connect AI agents to Replynodes over the Model Context Protocol.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pydantic/pydantic-ai'
If you have feedback or need assistance with the MCP directory API, please join our Discord server