- Explore MCP Servers
- mcp-server-code-runner
Mcp Server Code Runner
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
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
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
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
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
:
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:
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
- Install Bun.
- In configuration, change
npx
withbunx
.
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!
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.