MCP Code Executor
The MCP Code Executor is an MCP server that allows LLMs to execute Python code within a specified Conda environment.
Overview
The MCP Code Executor is an MCP server that allows LLMs (Large Language Models) to execute Python code within a specified Conda environment, enabling the execution of code with access to necessary libraries and dependencies.
To use the MCP Code Executor, clone the repository, install the required Node.js dependencies, build the project, and configure the server with the appropriate paths and environment settings. Once set up, LLMs can generate and execute Python code by referencing this server in their prompts.
- Execute Python code from LLM prompts - Run code within a specified Conda environment - Configurable code storage directory
- Allowing LLMs to run complex Python scripts in a controlled environment.
- Facilitating the execution of data analysis tasks using Python libraries.
- Enabling educational tools to demonstrate Python coding in real-time.
Add to your AI client
Use these steps to connect MCP Code 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-code-executor-bazinga012": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}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-code-executor-bazinga012": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-code-executor-bazinga012": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}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-code-executor-bazinga012": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-code-executor-bazinga012": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-code-executor-bazinga012": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-code-executor-bazinga012"
]
}
}
}FAQ
What are the prerequisites for using MCP Code Executor?
You need to have Node.js and Conda installed, along with a desired Conda environment created.
Is there a specific version of Python required?
The project does not specify a Python version, but it should be compatible with the libraries in your Conda environment.
Can I contribute to the MCP Code Executor?
Yes! Contributions are welcome, and you can open an issue or submit a pull request.