mcp-pyodide
A Pyodide server for executing Python code by Large Language Models (LLMs) via the Model Context Protocol (MCP).
yonaka15
Tools
read-image
Read an image from a mounted directory
execute-python
Execute Python code using Pyodide with output capture. When generating images, they will be automatically saved to the output directory instead of being displayed. Images can be accessed from the saved file paths that will be included in the output.
install-python-packages
Install Python packages using Pyodide
get-mount-points
List mounted directories
list-mounted-directory
List contents of a mounted directory
README
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.
<a href="https://glama.ai/mcp/servers/pxls43joly"> <img width="380" height="200" src="https://glama.ai/mcp/servers/pxls43joly/badge" alt="mcp-pyodide MCP server" /> </a>
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-pyodide
Usage
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-pyodide
Start in SSE mode:
mcp-pyodide --sse
SSE 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.json
Dependencies
@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 supportcors
: CORS middleware for SSE support
Development
Requirements
- Node.js 18 or higher
- npm 9 or higher
Setup
# Clone the repository
git clone <repository-url>
# Install dependencies
npm install
# Build
npm run build
Scripts
npm run build
: Compile TypeScript and set execution permissionsnpm start
: Run server in stdio modenpm 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -am 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.