mcp-pyodide
A Pyodide server implementation for the Model Context Protocol (MCP).
Documentation

mcp-pyodide
A Pyodide server implementation for the Model Context Protocol (MCP). This server enables Large Language Models (LLMs) to execute Python code through the MCP interface.
Features
- Python code execution capability for LLMs using Pyodide
- MCP compliant server implementation
- Support for both stdio and SSE transport modes
- Robust implementation written in TypeScript
- Available as a command-line tool
Installation
npm install mcp-pyodideUsage
As a Server
import { runServer } from "mcp-pyodide";
// Start the server
runServer().catch((error: unknown) => {
console.error("Error starting server:", error);
process.exit(1);
});As a Command-line Tool
Start in stdio mode (default):
mcp-pyodideStart in SSE mode:
mcp-pyodide --sseSSE Mode
When running in SSE mode, the server provides the following endpoints:
- SSE Connection: `http://localhost:3020/sse`
- Message Handler: `http://localhost:3020/messages`
Example client connection:
const eventSource = new EventSource("http://localhost:3020/sse");
eventSource.onmessage = (event) => {
console.log("Received:", JSON.parse(event.data));
};Project Structure
mcp-pyodide/
├── src/
│ ├── formatters/ # Data formatting handlers
│ ├── handlers/ # Request handlers
│ ├── lib/ # Library code
│ ├── tools/ # Utility tools
│ ├── utils/ # Utility functions
│ └── index.ts # Main entry point
├── build/ # Build artifacts
├── pyodide-packages/ # Pyodide-related packages
└── package.jsonDependencies
- `@modelcontextprotocol/sdk`: MCP SDK (^1.4.0)
- `pyodide`: Python runtime environment (^0.27.1)
- `arktype`: Type validation library (^2.0.1)
- `express`: Web framework for SSE support
- `cors`: CORS middleware for SSE support
Development
Requirements
- Node.js 18 or higher
- npm 9 or higher
Setup
# Clone the repository
git clone
# Install dependencies
npm install
# Build
npm run buildScripts
- `npm run build`: Compile TypeScript and set execution permissions
- `npm start`: Run server in stdio mode
- `npm run start:sse`: Run server in SSE mode
Environment Variables
- `PYODIDE_CACHE_DIR`: Directory for Pyodide cache (default: "./cache")
- `PYODIDE_DATA_DIR`: Directory for mounted data (default: "./data")
- `PORT`: Port for SSE server (default: 3020)
License
MIT
Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -am 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Create a Pull Request
Important Notes
- This project is under development, and the API may change
- Thoroughly test before using in production
- Exercise caution when executing untrusted code for security reasons
- When using SSE mode, ensure proper CORS configuration if needed
Support
Please use the Issue tracker for problems and questions.
Frequently asked questions
What is mcp-pyodide?
mcp-pyodide is A Pyodide server implementation for the Model Context Protocol (MCP).
How do I install mcp-pyodide?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-pyodide open source?
Yes — it is hosted on GitHub at https://github.com/yonaka15/mcp-pyodide and has 15 stars.
Related MCP tools
🍒 Cherry Studio is a desktop client that supports for multiple LLM providers. Built for the Model Context Protocol to enhance AI capabilities.
Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini...
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, ...
Composio equips your AI agents & LLMs with 100+ high-quality integrations via function calling for the Model Context Protocol. Enhance AI assistants with powerf
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Lan...
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Ag...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP