Code Runner
Run code snippets in various programming languages and view the output.
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
- Install Bun.
- In configuration, change
npx
withbunx
.
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!
Related Servers
Supergateway
A gateway to run MCP stdio servers over various transports like SSE, WebSockets, and Streamable HTTP.
Simple MCP Server
A starter MCP server built with TypeScript and the official MCP SDK, featuring example tools like echo, add, time, and flight status.
FastMCP ThreatIntel
An AI-powered threat intelligence analysis tool for multi-source IOC analysis, APT attribution, and interactive reporting.
SourceSync.ai
An MCP server for the SourceSync.ai API to manage and synchronize source code context.
Django MCP Server
A Django extension to enable AI agents to interact with Django apps through the Model Context Protocol.
Postman Tool Generation
Generates AI agent tools from Postman collections and requests using the Postman API.
Multichain MCP Server
A toolkit for building and deploying AI agents with blockchain capabilities, featuring a Model Context Protocol (MCP) server.
IDA Pro
Interact with IDA Pro for reverse engineering and binary analysis tasks.
MCP-Compose
Orchestration tool for managing multiple MCP servers with a Docker Compose-style interface and a unified HTTP proxy.
IBM wxflows
Tool platform by IBM to build, test and deploy tools for any data source