article
README
🚀 Go Playground MCP 服务器
Go Playground MCP 服务器是一个集成了 Go Playground API 的模型上下文协议(MCP)服务器,可用于执行 Go 代码并生成可共享的 URL。
🚀 快速开始
此服务器可与任何兼容 MCP 的客户端配合使用。服务器提供了三种工具:
run_go_code- 执行 Go 代码并返回结果share_go_code- 共享 Go 代码并获取一个 URLrun_and_share_go_code- 执行代码并同时获取结果和共享 URL
将以下内容添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"go-playground": {
"command": "npx",
"args": ["-y", "go-playground-mcp"]
}
}
}
✨ 主要特性
- 运行 Go 代码:在 Go Playground 沙箱中执行 Go 代码。
- 共享代码:为 Go 代码片段生成可共享的 URL。
- 运行并共享:在一次操作中执行代码并获取结果和共享 URL。
- MCP 集成:完全符合模型上下文协议。
📦 安装指南
克隆仓库
git clone https://github.com/samber/go-playground-mcp.git
cd go-playground-mcp
安装依赖
npm install
构建项目
npm run build
运行服务器
# 开发模式
npm run dev
# 生产模式
npm run build
npm start
将以下内容添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"go-playground": {
"command": "node",
"args": ["dist/index.js"]
}
}
}
🤝 贡献代码
- 在 Twitter 上联系我 @samuelberthe(私信、提及等方式均可)。
- 分叉 项目。
- 修复 开放问题 或请求新功能。
不要犹豫哦 ;)
👤 贡献者
💫 支持项目
如果这个项目对您有帮助,请给它一个 ⭐️!
📄 许可证
版权所有 © 2025 Samuel Berthe。
本项目采用 MIT 许可证。
微信扫一扫