MCP.so
登录

MCP Python Executor

@bsmi021

关于 MCP Python Executor

暂无概览

基本信息

分类

其他

许可证

MIT license

运行时

node

传输方式

stdio

发布者

bsmi021

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

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

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

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.

评论

其他 分类下的更多 MCP 服务器