Code Runner MCP Server
npm install mcp-server-code-runnersettings.json:
json
{
"mcp": {
"inputs": [],
"servers": {
"mcp-server-code-runner": {
"command": "npx",
"args": [
"-y",
"mcp-server-code-runner@latest"
],
}
}
}
}
`
$3
Configuration in claude_desktop_config.json:
`json
{
"mcpServers": {
"mcp-server-code-runner": {
"command": "npx",
"args": [
"-y",
"mcp-server-code-runner@latest"
],
}
}
}
`
$3
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:
`json
{
"mcp": {
"inputs": [],
"servers": {
"mcp-server-code-runner": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"formulahendry/mcp-server-code-runner"
]
}
}
}
}
`
$3
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:
`json
{
"mcp": {
"inputs": [],
"servers": {
"mcp-server-code-runner": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"mcp-server-code-runner@latest"
],
}
}
}
}
`
Run with Streamable HTTP Transport
`shell
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`