Code Runner MCP 服务器
MCP 服务器用于运行代码片段并显示结果。
它支持运行多种编程语言: 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 。完整列表可以在这里的constants.ts中查看。
设置
VS Code 的 npx
使用以下按钮在 VS Code 中安装 Code Runner MCP 服务器:
或者,您可以在settings.json
中添加配置:
克劳德桌面版的 npx
claude_desktop_config.json
中的配置:
Docker
以 VS Code 为例,使用以下按钮在 VS Code 中安装 Code Runner MCP 服务器:
或者,您可以在settings.json
中添加配置:
Widnows 上的 npx 问题
在 Windows 上, MCP 服务器可能无法连接npx
。
您可以尝试以下两种解决方法:
使用bunx
- 安装Bun 。
- 在配置中,将
npx
更改为bunx
。
使用 cmd
以下是settings.json
中的 VS Code 配置:
使用可流式 HTTP 传输运行
用法
在使用 Code Runner MCP Server 之前,请确保您要运行的编程语言的解释器或编译器已在PATH
环境变量中设置。
在已配置 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
构建您自己的 MCP 服务器
想要构建自己的 MCP 服务器吗?试试Yeoman Generator for MCP 服务器,创建你的 MCP 服务器项目!
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
MCP 服务器用于运行代码片段并显示结果。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server to run commands.Last updated -2265150TypeScriptMIT License
- AsecurityAlicenseAqualityMCP server for collecting code from files and directories into a single markdown document.Last updated -24PythonMIT License
- AsecurityAlicenseAqualityA MCP server for managing and storing code snippets in various programming languages, allowing users to create, list, and delete snippets via a standardized interface.Last updated -34JavaScriptMIT License
- AsecurityAlicenseAqualityThis project aims to build a Claude Code MCP server and implement its associated tools (explain\_code, review\_code, fix\_code, edit\_code, test\_code, simulate\_command, your\_own\_query). The server is implemented using Node.js and the MCP SDK. It receives tool requests from clients via Stdio, dynamicallyLast updated -73018JavaScriptMIT License