MCP-Mirror

Code Runner MCP Server

Community MCP-Mirror
Updated

Code Runner MCP Server

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.

Setup

npx for VS Code

Configuration in settings.json:

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

npx for Claude Desktop

Configuration in claude_desktop_config.json:

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

Docker

Use VS Code as example. Configuration in settings.json:

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

Installing via Smithery

NOTE: This will run Code Runner MCP Server in a remote Container environment hosted by Smithery.

To install Code Runner MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @formulahendry/mcp-server-code-runner --client claude

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

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 · Populars

MCP Server · New

    PraneshASP

    Foundry MCP Server

    An experimental MCP Server for foundry built for Solidity devs

    Community PraneshASP
    karakeep-app

    Karakeep MCP Server

    A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

    Community karakeep-app
    karakeep-app

    karakeep

    A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

    Community karakeep-app
    prisma

    Prisma

    Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

    Community prisma
    iannuttall

    Flux UI MCP Server

    MCP Server

    Community iannuttall