MCP Python Executor
Enables use of NumPy library for numerical computing within executed Python code.
Enables use of pandas library for data manipulation and analysis within executed Python code.
Allows execution of Python code with safety constraints, package management, and resource monitoring.
Enables use of scikit-learn library for machine learning within executed Python code.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Python Executorcompute the first 10 Fibonacci numbers using Python"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Python Executor
A Model Context Protocol (MCP) server for executing Python code and managing Python packages.
Features
Execute Python code with safety constraints
Install and manage Python packages
Pre-configure commonly used packages
Resource monitoring and limits
Health checks and metrics
Structured logging
Related MCP server: mcp-run-python
Configuration
The server can be configured through environment variables in the MCP settings:
{
"mcpServers": {
"mcp-python-executor": {
"command": "node",
"args": ["path/to/python-executor/build/index.js"],
"env": {
"PREINSTALLED_PACKAGES": "numpy pandas matplotlib scikit-learn",
"MAX_MEMORY_MB": "512",
"EXECUTION_TIMEOUT_MS": "30000",
"MAX_CONCURRENT_EXECUTIONS": "5",
"LOG_LEVEL": "info",
"LOG_FORMAT": "json"
}
}
}
}Environment Variables
PREINSTALLED_PACKAGES: Space-separated list of Python packages to install on startupMAX_MEMORY_MB: Maximum memory limit per execution (default: 512)EXECUTION_TIMEOUT_MS: Maximum execution time in milliseconds (default: 30000)MAX_CONCURRENT_EXECUTIONS: Maximum number of concurrent executions (default: 5)LOG_LEVEL: Logging level (debug|info|error, default: info)LOG_FORMAT: Log format (json|text, default: json)
Available Tools
1. execute_python
Execute Python code and return the results.
interface ExecutePythonArgs {
code?: string; // Python code to execute (inline)
scriptPath?: string; // Path to existing Python script file (alternative to code)
inputData?: string[]; // Optional input data
}Examples:
// Example with inline code
{
"code": "print('Hello, World!!')\nfor i in range(3): print(i)",
"inputData": ["optional", "input", "data"]
}
// Example with script path
{
"scriptPath": "/path/to/your_script.py",
"inputData": ["optional", "input", "data"]
}2. install_packages
Install Python packages.
interface InstallPackagesArgs {
packages: string[];
}Example:
This server cannot be deployed
Maintenance
Related MCP Connectors
Run Python code from natural language prompts, with optional PyPI package install.
Run Python code in a secure sandbox without local setup. Declare inline dependencies and execute s…
Hosted Python sandbox for package runtime verification: pip install and usable-import evidence.
- mcp-serverOAuthai.cdbx
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceFacilitates isolated code execution within Docker containers, enabling secure multi-language script execution and integration with language models like Claude via the Model Context Protocol.5MIT

mcp-run-pythonofficial
AlicenseNot gradedqualityAmaintenanceModel Context Protocol server to run Python code in a sandbox.1,462 npm19,950MIT- FlicenseCqualityDmaintenanceEnables remote Python code execution via the Model Context Protocol for secure, real-time lab scenarios and sandbox testing. It allows AI clients like Claude and Cursor to execute and evaluate code within a virtual lab environment.1-
- AlicenseAqualityDmaintenanceEnables LLMs to interact with Python environments, execute code, manage files, and handle packages through the Model Context Protocol.9MIT