MCP Python Executor
Overview
MCP Python Executor is a Model Context Protocol (MCP) server designed for executing Python code and managing Python packages safely and efficiently.
To use MCP Python Executor, configure the server through environment variables and utilize the available tools to execute Python code or install packages.
- 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
- Running Python scripts in a controlled environment.
- Managing dependencies for Python projects.
- Monitoring resource usage during code execution.
Add to your AI client
Use these steps to connect MCP Python Executor in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-python-executor-bsmi021": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-python-executor-bsmi021": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-python-executor-bsmi021": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-python-executor-bsmi021": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-python-executor-bsmi021": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-python-executor-bsmi021": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-python-executor-bsmi021"
]
}
}
}FAQ
Can I execute any Python code?
Yes, you can execute any Python code within the safety constraints set by the server.
How do I install additional packages?
You can install additional packages using the install_packages tool by providing a list of package names.
What are the resource limits?
The server allows you to set memory limits, execution timeouts, and the maximum number of concurrent executions.