home / mcp / code runner mcp server

Code Runner MCP Server

Code Runner MCP Server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "formulahendry-mcp-server-code-runner": {
      "command": "npm",
      "args": [
        "install",
        "-g",
        "mcp-server-code-runner@latest"
      ]
    }
  }
}

The Code Runner MCP Server lets you run code snippets in many languages and return the results through a programmable MCP interface. It’s useful for testing small code blocks, educational tips, or automating quick evaluations in your workflows.

How to use

Configure your MCP client to connect to the Code Runner MCP Server using one of the supported local, stdio-based start methods. You can run via your editor, a desktop client, or a container, then send code snippets to be executed and receive the results. The server base supports numerous languages and executes code in a controlled environment so you can verify outputs, errors, and behavior of small code samples.

How to install

Prerequisites: you need Node.js installed (for npm/npx usage) and, if you choose the Docker route, Docker installed on your system.

Choose one of the supported local start methods and add the corresponding configuration to your MCP client.

Code Runner MCP server configurations

{
  "mcp": {
    "inputs": [],
    "servers": {
      "code_runner_vscode": {
        "command": "npx",
        "args": [
          "-y",
          "mcp-server-code-runner@latest"
        ]
      }
    }
  }
}

Claude Desktop configuration

{
  "mcpServers": {
    "code_runner_claude": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-code-runner@latest"
      ]
    }
  }
}

Docker configuration

{
  "mcp": {
    "inputs": [],
    "servers": {
      "code_runner_docker": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "formulahendry/mcp-server-code-runner"
        ]
      }
    }
  }
}

Run with Streamable HTTP Transport

npm install -g mcp-server-code-runner@latest
mcp-server-code-runner --transport http

Notes on usage

Before running, ensure the interpreter or compiler for your chosen language is available in your PATH. You can then prompt the server with code snippets like JavaScript, Python, Ruby, or many other supported languages to see immediate results.

Available tools

run_code

Executes a provided code snippet in the configured language and returns the output.