MCP ExplorerExplorer

Mcp Server Code Runner

@formulahendryon 20 days ago
165 MIT
FreeCommunity
AI Systems
Code Runner MCP Server

Overview

What is Mcp Server Code Runner

The mcp-server-code-runner is a Code Runner MCP Server designed to execute code snippets in various programming languages and display the results.

Use cases

Ideal for developers who need to quickly test code snippets, learn new programming languages, or automate tasks within their development workflow. It can also be used in educational settings for teaching programming concepts.

How to use

To use the mcp-server-code-runner, configure your development environment (like VS Code or Claude Desktop) to include the server command in the settings. Ensure the interpreter or compiler for your desired programming language is in the PATH environment variable. You can then run code snippets by sending prompts to the application.

Key features

Supports a wide range of programming languages including JavaScript, PHP, Python, Ruby, Go, and many more. It allows users to run code snippets and see the results directly within their development environment.

Where to use

undefined

Content

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:

npx for Claude Desktop

Configuration in claude_desktop_config.json:

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:

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!

Tools

No tools

Comments