PluginBench
MCP Server
Stale
MIT

io.github.formulahendry/code-runner MCP Server

io.github.formulahendry/code-runner

Run code snippets in 40+ programming languages directly from Claude or Cursor.

What is the io.github.formulahendry/code-runner MCP server?

The Code Runner MCP Server is an MCP server that executes code snippets in multiple programming languages including JavaScript, Python, Ruby, Go, PHP, and 35+ others, returning the execution results. It enables AI agents to run and test code directly within conversations.

This server lets Claude and Cursor execute code in dozens of languages and show results instantly. Use it to run quick scripts, verify code logic, check system information, or test algorithms without leaving your chat interface. Requires the relevant language interpreters/compilers installed on your system.

How to install io.github.formulahendry/code-runner

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "code-runner": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-code-runner"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • run-code — Execute code snippets in supported programming languages and return the output

Use cases

  • Run JavaScript, Python, or other code snippets to verify logic or test algorithms
  • Check system information like CPU count or temporary folder location
  • Execute quick scripts to solve problems or perform calculations
  • Test code in multiple languages without switching tools
  • Validate syntax or behavior of code before deployment

io.github.formulahendry/code-runner MCP server FAQ

What is the Code Runner MCP Server?

It's an MCP server that executes code snippets in 40+ programming languages (JavaScript, Python, Ruby, Go, PHP, Perl, Lua, Scala, Swift, Julia, Kotlin, Dart, Haskell, and many more) and returns the results.

How do I install it in VS Code?

Use the one-click install buttons in the README, or manually add the configuration to settings.json with the command 'npx' and args ['-y', 'mcp-server-code-runner@latest'].

How do I install it in Claude Desktop?

Add the server configuration to claude_desktop_config.json with the npx command and the same arguments, or use the Docker image instead.

Is there a cost to use this server?

No, it's free and open-source. You only need the relevant language interpreters/compilers installed on your system.

What do I need to run code in a specific language?

The interpreter or compiler for that language must be installed and available in your system's PATH environment variable.

Can I use this on Windows?

Yes, but if npx fails to connect on Windows, you can use bunx (after installing Bun) or wrap the command with cmd /c as a workaround.

README (reference)

Source of truth, from the repository.

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.

<a href="https://glama.ai/mcp/servers/d3mluq4vy9"> <img width="380" height="200" src="https://glama.ai/mcp/servers/d3mluq4vy9/badge" alt="mcp-server-code-runner MCP server" /> </a>

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"
        ],
      }
    }
  }
}

Run with Streamable HTTP Transport

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

usage confirm

usage result

Build your own MCP Server

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

Related MCP servers

MCP Server for MCP Registry to discover and search for available MCP servers in the registry

4
TypeScript
View repository →

Structured spec-driven development with requirements, design, and code generation workflows.

436
TypeScript
MIT
View repository →
AGAgentiSend logo

Transactional email API for AI agents: verified domains, a per-sender budget, and a kill switch.

0
MIT
View repository →
POPostDashPro logo

Social post scheduling for AI agents: queue or draft posts to 12 connected networks.

0
MIT
View repository →

x402 paywall layer for creator sites and agents: paid content, tips, pricing, reputation, ledger.

0
JavaScript
View repository →

x402 paying-fetch client for AI agents. Spending caps, approval, receipts. Non-custodial.

0
TypeScript
MIT
View repository →