Code Runner MCP Server logo

Code Runner MCP Server

by formulahendry

MCP Server for running code snippets and displaying the results. It supports multiple programming languages, allowing users to execute code directly within applications like VS Code and Claude Desktop.

View on GitHub

Last updated: N/A

What is Code Runner MCP Server?

Code Runner MCP Server is a server that allows you to execute code snippets in various programming languages and view the output. It acts as a bridge between applications and the execution environment, enabling users to run code directly from their preferred tools.

How to use Code Runner MCP Server?

The server can be set up using npx or Docker within VS Code or Claude Desktop. Configuration involves specifying the command and arguments for running the server. Once configured, you can use prompts within the application to execute code snippets, ensuring that the interpreter or compiler for the desired language is in the PATH environment variable.

Key features of Code Runner MCP Server

  • Supports multiple programming languages (JavaScript, Python, PHP, etc.)

  • Integration with VS Code and Claude Desktop

  • Easy setup using npx or Docker

  • Allows execution of code snippets directly from applications

  • Provides real-time output of code execution

Use cases of Code Runner MCP Server

  • Executing code snippets for quick testing and prototyping

  • Running code examples within documentation or tutorials

  • Integrating code execution capabilities into chat applications

  • Validating code logic and algorithms

FAQ from Code Runner MCP Server

What programming languages are supported?

The server supports a wide range of languages, including JavaScript, PHP, Python, Perl, Ruby, Go, Lua, Groovy, PowerShell, and many more. A full list can be found in the constants.ts file.

How do I install the server?

You can install the server using npx or Docker. Instructions are provided for both VS Code and Claude Desktop.

What is MCP?

MCP stands for Model Context Protocol. It's a protocol for communication between applications and servers.

Why is the interpreter/compiler required in PATH?

The server relies on the interpreter or compiler being in the PATH environment variable to execute the code snippets correctly.

What if I have issues with npx on Windows?

The documentation provides workarounds for npx issues on Windows, such as using bunx or cmd.