Back to MCP directory
publicPublicdnsLocal runtime

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

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client