mcp-server-code-runner
The mcp-server-code-runner allows you to execute code snippets in various programming languages and returns the results.
Execute code snippets: Run code in multiple languages including JavaScript, PHP, Python, Ruby, and many others as defined in the constants.ts file
Simple usage: Provide your code and specify the language to get execution results
Flexible setup options: Install via npx in VS Code and Claude Desktop, or use Docker
Windows compatibility: Alternative methods using
bunxorcmdfor Windows usersAdvanced features: Supports Streamable HTTP Transport for enhanced communication
Integration capabilities: Works with applications configured to use the MCP Server
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
Provides ability to execute CoffeeScript code and view results
Provides execution environment for Crystal code snippets with output
Enables running Dart code snippets with output display
Supports execution of Elixir code snippets with result display
Enables execution of F# Script code with output display
Provides execution environment for Haskell code snippets with results
Allows execution of JavaScript code snippets and returns the results
Enables running Julia code snippets with result display
Allows running Kit code snippets and viewing execution output
Supports execution of Kotlin Script code snippets with output display
Allows running Lua code snippets and viewing execution results
Allows running OCaml Script code snippets and viewing results
Provides ability to run Perl code snippets and view the output
Enables running PHP code snippets and displays execution results
Supports execution of Python code snippets with output display
Provides ability to execute Racket code snippets and view output
Enables execution of Ruby code fragments with result display
Supports processing and execution of Sass code snippets with result display
Allows running Scala code snippets with output display
Provides ability to run BASH/SH shell scripts and view results
Supports execution of Swift code snippets and shows results
Enables running TypeScript code snippets with result display
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-code-runnerrun this Python code: print('Hello, World!')"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
npxwithbunx.
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"
],
}
}
}
}Related MCP server: MCP Expr Lang
Run with Streamable HTTP Transport
npm install -g mcp-server-code-runner@latest
mcp-server-code-runner --transport httpUsage
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 toolHow 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!
Available Tools
1 toolrun-codeC
Run code snippet and return the result.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Code Snippet | |
| languageId | Yes | Language ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions running code and returning results but lacks critical details like execution environment, security implications, timeout limits, error handling, or resource constraints, which are essential for safe and effective use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It is appropriately sized for the tool's function, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of code execution (which involves security, performance, and error handling), the description is insufficient. With no annotations, no output schema, and minimal behavioral details, it fails to provide complete context for safe and informed use, especially for a tool that could have significant side effects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description does not add meaning beyond the input schema, which has 100% coverage with clear descriptions for both parameters (code and languageId). Since the schema fully documents the parameters, the baseline score of 3 is appropriate, as the description provides no additional semantic context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Run code snippet and return the result' clearly states the action (run) and resource (code snippet) with a specific outcome (return result). It distinguishes the tool's function effectively, though it lacks sibling differentiation since no sibling tools exist, making a 5 unnecessary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool, such as for testing, debugging, or specific contexts, and offers no alternatives or exclusions. It only states what the tool does without usage context, leaving the agent to infer applicability.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
run-code
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'run-code' has a clearly distinct and singular purpose.
The single tool name 'run-code' follows a clear verb_noun pattern. Since there is only one tool, consistency is inherently perfect with no deviations.
A single tool for a code runner server feels thin and limited in scope. It suggests the server may not fully cover the domain, as typical code execution might benefit from additional tools like listing environments or managing sessions.
The tool surface is severely incomplete for a code runner domain. It only provides execution without supporting operations like listing available languages, checking code syntax, or managing execution environments, which are common in such contexts.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server to assist with JxBrowser development.
MCP server for understanding Javascript internals from ECMAScript specification.
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceMCP server for collecting code from files and directories into a single markdown document.28MIT
- AlicenseNot gradedqualityDmaintenanceMCP Server around https://expr-lang.org1MIT
- AlicenseAqualityAmaintenanceMCP Server to previewing mermaid diagrams. https://github.com/veelenga/claude-mermaid/2536203MIT
- AlicenseBqualityDmaintenanceMCP server for managing Claude Code conversation sessions1278MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/formulahendry/mcp-server-code-runner'
If you have feedback or need assistance with the MCP directory API, please join our Discord server