🔌 MCP Servers

Python execute

Run Python code in a secure sandbox without local setup. Declare inline dependencies and execute snippets instantly. Prototype, test, and share reproducible results with ease.

❤️ 0
⬇️ 5.2k
👁 2
Share

Description

# py_execute_mcp

MCP stdio server that executes Python code inside Pyodide (WASM) using Bun as the runtime and bundler.

Prerequisites

  • Bun v1.2 or newer (install script: powershell -Command "iwr https://bun.sh/install.ps1 -UseBasicParsing | iex")

Install dependencies

bun install

Run the server (development)

bun run src/index.ts

Expose bun run src/index.ts as an MCP stdio endpoint in Claude Desktop, Cherry Studio, or any compliant client.

Package as a single executable

bun build src/index.ts --compile --outfile mcp-python

Optional: Offline Pyodide

Download a Pyodide distribution and set PYODIDE_INDEX_URL before launching:

set PYODIDE_INDEX_URL=file:///absolute/path/to/pyodide/full/
./mcp-python

Minimum example request

# /// script
# dependencies = ['pydash']
# ///
import sys
print(sys.version)
print(sum([1, 2, 3]))
"done"

python_execute will stream stdout/stderr and return the expression result under __RESULT__ when present.

Reviews (0)

Sign in to write a review.

No reviews yet. Be the first to review!

Comments (0)

Sign in to join the discussion.

No comments yet. Be the first to share your thoughts!

Compatible Platforms

Pricing

Free

Related Configs