Code Runner

io.github.formulahendry由 GitHub 账号 formulahendry 发布v0.1.9更新于 Oct 24, 2026

Code Runner MCP Server which can run code in various programming languages.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

让助手执行多种编程语言的代码片段并返回运行结果。

可以做什么
Code Runner 提供一个 run-code 工具,用于执行代码片段并显示结果。它支持大量语言,包括 JavaScript、TypeScript、Python、PHP、Ruby、Go、Lua、PowerShell、BASH/SH、C# Script、F# Script、R、Swift、Julia、Kotlin Script、Dart 和 Haskell。它可以通过 npx 或 Docker 以 stdio 方式在本地启动,也支持 Streamable HTTP 传输。
适用场景
适合希望助手真正运行小程序、验证计算,或通过脚本查看本机情况的场景,而不只是写出代码。更适合快速试验和一次性片段,而不是完整的项目构建。
运行要求
需要本地运行时:npm 包(npx)需要 Node.js,容器镜像需要 Docker。想运行的每种语言都需要安装对应的解释器或编译器,并加入 PATH 环境变量。未声明需要账号、API 密钥或环境变量。
安装前请注意
run-code 工具会在服务器所在机器上以该进程的权限执行任意代码,因此片段可以读取、修改或删除本地文件并发起网络请求。只运行你信任的代码,处理不可信输入时优先使用隔离的容器或沙箱。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Code Runner,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Code Runner MCP Server

[NPM Downloads] [smithery badge] [Docker Pulls]

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.

[mcp-server-code-runner MCP server]

Setup

npx for VS Code

Install the Code Runner MCP server in VS Code using below buttons:

[Install in VS Code] [Install in VS Code Insiders]

Alternatively, you can add configuration in settings.json:

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:

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:

[Install in VS Code] [Install in VS Code Insiders]

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"        ]      }    }  }}

npx issue on Widnows

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@latestmcp-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!

来源:README.md,提交 529b5ed

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.9最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分