Code Runner MCP
Execute JavaScript and Python code in a secure sandbox. Supports Deno for JS/TS and Pyodide for Python, with configurable permissions.
Code Runner MCP
🚀 Let AI execute JavaScript/Python code with any package imports!
✨ Core Value
- 🔒 Secure Sandbox: Isolated execution environment protecting your host system
- 📦 Install-on-Demand: Dynamically import any npm/PyPI packages
- 🎯 Reduce Hallucinations: Let AI verify logic by executing code
- ⚡ Quick Validation: Test if packages meet your needs without local installation
🌐 Try it online: smithery.ai
🚀 Quick Start
Option 1: Using Deno (Recommended)
{
"mcpServers": {
"code-runner": {
"command": "deno",
"args": ["run", "--allow-all", "jsr:@mcpc/code-runner-mcp/bin"],
"env": {
"DENO_PERMISSION_ARGS": "--allow-net",
"NODEFS_ROOT": "/tmp",
"NODEFS_MOUNT_POINT": "/tmp"
},
"transportType": "stdio"
}
}
}
Option 2: Using Node.js
{
"mcpServers": {
"code-runner": {
"command": "npx",
"args": ["-y", "deno", "run", "--allow-all", "jsr:@mcpc/code-runner-mcp/bin"],
"env": {
"DENO_PERMISSION_ARGS": "--allow-net",
"NODEFS_ROOT": "/tmp",
"NODEFS_MOUNT_POINT": "/tmp"
},
"transportType": "stdio"
}
}
}
💡 Use Cases
JavaScript/TypeScript
// Import npm packages directly to test functionality
import { z } from "npm:zod";
import { serve } from "jsr:@std/http";
const schema = z.object({ name: z.string() });
console.log(schema.parse({ name: "test" }));
Python
# Dynamically install and use Python packages
import requests
response = requests.get("https://api.github.com")
print(f"Status code: {response.status_code}")
File System Access
# Access host file system (via NODEFS_ROOT and NODEFS_MOUNT_POINT)
import os
files = os.listdir('/tmp') # List files at the mount point
print(f"Found {len(files)} files")
⚙️ Environment Variables
DENO_PERMISSION_ARGS: JS/TS execution permissions (e.g.,--allow-env --allow-net)NODEFS_ROOT: Host file system root directory path for Python accessNODEFS_MOUNT_POINT: Mount point path in Python environment (defaults to NODEFS_ROOT if not specified)PYODIDE_PACKAGE_BASE_URL: Custom package download source for Pyodide (e.g., private mirror CDN)
🛡️ Security Features
- Deno Sandbox: Strict permission control with explicit authorization
- Pyodide WASM: WebAssembly isolated environment
- File System Isolation: Controlled host file access
📋 Technical Architecture
- JavaScript/TypeScript: Powered by Deno runtime
- Python: Powered by Pyodide WebAssembly technology
- Package Management: Dynamic installation from npm, JSR, and PyPI
💬 Issues & Feedback: GitHub Issues
🌟 Repository: GitHub Repository
Related Servers
FreeCAD
Integrate with FreeCAD, a free and open-source parametric 3D modeler, via a Python bridge.
AIO-MCP Server
An MCP server with integrations for GitLab, Jira, Confluence, and YouTube, providing AI-powered search and development utility tools.
Translator AI
Translate JSON i18n files using Google Gemini or local Ollama models, with incremental caching support.
Safe Local Python Executor
A tool for safely executing local Python code without requiring external data files.
Drupal Modules MCP
Retrieve detailed information about Drupal modules from drupal.org, including version compatibility, installation instructions, and documentation.
Authless Cloudflare MCP Server
An example of a remote MCP server deployed on Cloudflare Workers without authentication.
VectorMCP
A Ruby gem for building Model Context Protocol (MCP) servers to expose tools, resources, and prompts to LLM clients.
MCP-Creator-MCP
Create new MCP servers using AI-guided workflows and intelligent templates.
MCP Jenkins Intelligence
AI-powered Jenkins pipeline intelligence platform with natural language interface. Provides comprehensive pipeline analysis, failure prediction, optimization suggestions, and automated Jenkinsfile reconstruction using Model Context Protocol (MCP) integration.
Tailwind Svelte Assistant
Provides documentation and code snippets for SvelteKit and Tailwind CSS.