返回 MCP 目录
public公开dns本地运行

go-playground-mcp

Go Playground MCP服务器是一个集成Go Playground API的工具,可通过MCP协议执行Go代码并生成可分享的URL链接

article

README

🚀 Go Playground MCP 服务器

Go Playground MCP 服务器是一个集成了 Go Playground API 的模型上下文协议(MCP)服务器,可用于执行 Go 代码并生成可共享的 URL。

tag Build Status Coverage npm License

🚀 快速开始

此服务器可与任何兼容 MCP 的客户端配合使用。服务器提供了三种工具:

  1. run_go_code - 执行 Go 代码并返回结果
  2. share_go_code - 共享 Go 代码并获取一个 URL
  3. run_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"]
    }
  }
}

🤝 贡献代码

不要犹豫哦 ;)

👤 贡献者

Contributors

💫 支持项目

如果这个项目对您有帮助,请给它一个 ⭐️!

GitHub Sponsors

📄 许可证

版权所有 © 2025 Samuel Berthe

本项目采用 MIT 许可证。

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端