mcp-server-code-runner

MCP.Pizza Chef: formulahendry

Rather than describing what a piece of code would do, your assistant can run it and show you the output, across roughly forty languages including Python, JavaScript, Ruby, Go, PowerShell, and shell scripts. The catch is that each language only works if it is already installed on your computer, and the code runs with your own permissions unless you choose the Docker version. No key or account is needed, and setup is a short block pasted into VS Code or Claude Desktop.

Coding
Data

Use This MCP server To

Check what a snippet actually prints before trusting it Do a quick calculation the model might otherwise fumble Test a small Python or JavaScript script instantly Ask a real question about my computer and get a real answer Compare how the same idea behaves in two languages

README

Code Runner MCP Server

NPM Downloads smithery badge Docker Pulls

MCP Server for running code snippet and show the result.

It supports running multiple programming languages: JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F# Script, C# Script, VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml Script, R, AppleScript, Elixir, Clojure, Racket, Scheme, AutoHotkey, AutoIt, Kotlin Script, Dart, Haskell, Ni, Lisp, Kit, V, SCSS, Sass. Full list could be seen here in constants.ts.

mcp-server-code-runner MCP server

Setup

npx for VS Code

Install the Code Runner MCP server in VS Code using below buttons:

Install in VS Code Install in VS Code Insiders

Alternatively, you can add configuration in settings.json:

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

npx for Claude Desktop

Configuration in claude_desktop_config.json:

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

Docker

Use VS Code as example. Install the Code Runner MCP server in VS Code using below buttons:

Install in VS Code Install in VS Code Insiders

Alternatively, you can add configuration in settings.json:

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

npx issue on Widnows

On Windows, MCP servers may fail to connect with npx.

You could try below two workarounds:

use bunx
  1. Install Bun.
  2. In configuration, change npx with bunx.
use cmd

Below is VS Code configuration in settings.json:

{
  "mcp": {
    "inputs": [],
    "servers": {
      "mcp-server-code-runner": {
        "command": "cmd",
        "args": [
          "/c",
          "npx",
          "-y",
          "mcp-server-code-runner@latest"
        ],
      }
    }
  }
}
npm install -g mcp-server-code-runner@latest
mcp-server-code-runner --transport http

Usage

Before using Code Runner MCP Server, please make sure interpreter or compiler of the programming language you want to run is set in PATH environment variable.

Try below prompts in the application which has configured Code Runner MCP Server:

  • Run the JavaScript Code: console.log(5+6)
  • Where is temporary folder in my OS? Use run-code tool
  • How many CPUs do I have in my machine? Use run-code tool

Build your own MCP Server

Want to build your own MCP Server? Try Yeoman Generator for MCP Server to create your MCP Server project!

mcp-server-code-runner FAQ

Do I need a key or an account?
No. It runs entirely on your own machine and costs nothing beyond what your assistant already costs.
Can I use this to run Python if Python is not installed?
No. It calls whatever is already on your computer, so a language only works once you have installed it yourself.
Is it safe to let an assistant run code on my machine?
Treat it with care. Code runs with your own permissions and can touch your files. The Docker version keeps it walled off from the rest of your computer, which is the safer choice.
Can it edit or save my project files?
Not really. It takes a snippet, runs it, and hands back the output. Anything a script writes to disk is a side effect, not a managed feature.
Which apps does it work in?
VS Code has one-click install buttons, Claude Desktop takes a pasted block, and anything with a standard MCP configuration will also work.
How hard is the setup?
Easy. Click the install button in VS Code, or paste three lines into your settings file. Windows users may need a small tweak noted in the instructions.
Is it still maintained?
Yes, though updates are occasional. The most recent code change was February 2026.