MCP.so
Sign In

MCP Python Executor

@bsmi021

About MCP Python Executor

No overview available yet

Basic information

Category

Other

License

MIT license

Runtime

node

Transports

stdio

Publisher

bsmi021

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "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"
      }
    }
  }
}

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP Python Executor?

MCP Python Executor is a Model Context Protocol (MCP) server that allows AI models and other MCP clients to execute Python code and manage Python packages. It enforces safety constraints, resource limits, and provides health checks and structured logging, making it suitable for controlled code execution environments.

How to use MCP Python Executor?

Configure the server in your MCP settings with the command node path/to/python-executor/build/index.js. Customize behavior via environment variables such as PREINSTALLED_PACKAGES, MAX_MEMORY_MB, EXECUTION_TIMEOUT_MS, and MAX_CONCURRENT_EXECUTIONS. Then use the provided tools—execute_python to run inline or file-based Python code, and install_packages to install Python packages.

Key features of MCP Python Executor

  • Execute Python code with safety constraints
  • Install and manage Python packages dynamically
  • Pre-configure commonly used packages on startup
  • Resource monitoring with configurable memory and time limits
  • Health checks and structured logging (JSON or text)

Use cases of MCP Python Executor

  • Run Python code snippets from an AI assistant to perform calculations or data transformations
  • Execute pre-existing Python scripts by providing a script path
  • Install additional Python packages on demand during a session
  • Manage concurrent code executions with defined memory and timeout limits

FAQ from MCP Python Executor

What kind of Python code can be executed?

Any valid Python code can be run inline via the code parameter or from a file via scriptPath. The server applies memory limits, timeouts, and concurrency restrictions to ensure safe execution.

What are the runtime dependencies?

The server runs on Node.js and requires a Python environment. The specific Python version is not stated in the README; the server attempts to use the system’s default Python.

How do I pre-install packages?

Set the PREINSTALLED_PACKAGES environment variable to a space-separated list of package names (e.g., numpy pandas matplotlib scikit-learn). These are installed on server startup using pip.

What resource limits are enforced?

You can configure per‑execution memory limit (MAX_MEMORY_MB, default 512), timeout (EXECUTION_TIMEOUT_MS, default 30000), and maximum concurrent executions (MAX_CONCURRENT_EXECUTIONS, default 5). No authentication or transport details are specified in the README.

How does logging work?

Logging level and format are controlled by LOG_LEVEL and LOG_FORMAT environment variables, supporting debug, info, error levels and json or text formats.

Comments

More Other MCP servers