mcp-server-code-runner

Integrations

  • Allows running AutoHotkey code snippets with result display

  • Supports execution of AutoIt code snippets and shows results

  • Enables running Clojure code snippets and displays execution results

Code Runner MCP Server

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

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

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:

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

Build your own MCP Server

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

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

MCP Server for running code snippet and show the result.

  1. Setup
    1. npx for VS Code
    2. npx for Claude Desktop
    3. Docker
    4. npx issue on Widnows
  2. Run with Streamable HTTP Transport
    1. Usage
      1. Build your own MCP Server

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          An MCP server to run commands.
          Last updated -
          2
          204
          104
          JavaScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          MCP server for collecting code from files and directories into a single markdown document.
          Last updated -
          2
          4
          Python
          MIT License
        • A
          security
          A
          license
          A
          quality
          A MCP server for managing and storing code snippets in various programming languages, allowing users to create, list, and delete snippets via a standardized interface.
          Last updated -
          3
          4
          JavaScript
          MIT License
        • A
          security
          A
          license
          A
          quality
          This project aims to build a Claude Code MCP server and implement its associated tools (explain\_code, review\_code, fix\_code, edit\_code, test\_code, simulate\_command, your\_own\_query). The server is implemented using Node.js and the MCP SDK. It receives tool requests from clients via Stdio, dynamically
          Last updated -
          7
          80
          13
          JavaScript
          MIT License
          • Linux

        View all related MCP servers

        ID: d3mluq4vy9