mcp_code_executor

MCP.Pizza Chef: bazinga012

Nine commands make that possible: run a snippet, build up a longer script piece by piece, read it back, run the finished file, install packages, check what is already installed, and switch between environments. It uses a Python setup you created yourself with Conda, virtualenv or uv, so your existing libraries are all available. There is no key and nothing to pay for. There is also no sandbox, so whatever it runs, runs with your permissions. The code has not changed since May 2025.

Unmaintained · no code changes since May 2025
Coding
Data

Use This MCP server To

Crunch a spreadsheet with pandas and show me the result Draw a chart from data I paste into the chat Run a script too long to fit in one message Install a Python package and try it straight away Check whether a library is installed before writing code

README

MCP Code Executor

smithery badge

The MCP Code Executor is an MCP server that allows LLMs to execute Python code within a specified Python environment. This enables LLMs to run code with access to libraries and dependencies defined in the environment. It also supports incremental code generation for handling large code blocks that may exceed token limits.

Code Executor MCP server

Features

  • Execute Python code from LLM prompts
  • Support for incremental code generation to overcome token limitations
  • Run code within a specified environment (Conda, virtualenv, or UV virtualenv)
  • Install dependencies when needed
  • Check if packages are already installed
  • Dynamically configure the environment at runtime
  • Configurable code storage directory

Prerequisites

  • Node.js installed
  • One of the following:
    • Conda installed with desired Conda environment created
    • Python virtualenv
    • UV virtualenv

Setup

  1. Clone this repository:
git clone https://github.com/bazinga012/mcp_code_executor.git
  1. Navigate to the project directory:
cd mcp_code_executor
  1. Install the Node.js dependencies:
npm install
  1. Build the project:
npm run build

Configuration

To configure the MCP Code Executor server, add the following to your MCP servers configuration file:

mcp_code_executor FAQ

Do I need a key or a paid account?
No. Everything runs locally on your own machine, so there is nothing to sign up for and nothing to pay.
What do I need installed first?
Node, plus a Python environment you have already set up with Conda, virtualenv or uv. It uses your environment rather than creating one for you.
Can I use this to analyze a spreadsheet?
Yes — if pandas is in your environment, ask it to load the file, work through the numbers, and print or plot the answer.
Is it safe?
Be careful. Code runs with your own account permissions and there is no sandbox, so it can read, change or delete files on your computer.
How hard is setup?
This is the developer end. You clone the project, install its dependencies and build it, then point your app at the built file. A Docker image is offered as an alternative.
Can it handle a long script?
Yes. It can start a file, add to it in pieces, read it back and then run it, which gets around message length limits.
Is the project still updated?
Not recently. The last code change was May 2025, so treat it as finished rather than actively developed.
Does the Docker option work with any setup?
Only partly. The maintainer notes the image was tested with the uv environment type alone, so the others may need extra work.