基本能力
产品定位
Hello MCP Go 是一个教育性质的示例项目,旨在帮助开发者了解如何使用 Go 语言构建 MCP 服务器。
核心功能
- 构建 MCP 服务器
- 提供两个工具:
hello
和calculate
hello
工具接受Submitter
和Content
参数calculate
工具接受A
和B
参数,例如 "calculate 2 and 4"
适用场景
- 学习 MCP 协议
- 开发自定义 MCP 服务器
- 与 GitHub Copilot 集成
工具列表
hello
工具:用于提交内容和提交者信息calculate
工具:用于简单的数学计算
常见问题解答
文档中未提供具体常见问题解答。
使用教程
使用依赖
需要安装 Go 语言环境。
安装教程
- 克隆仓库:
bash
git clone https://github.com/your-username/hello-mcp-go.git
cd hello-mcp - 安装依赖:
bash
go mod tidy - 构建项目:
Windows:
bash
go build -ldflags="-s -w" -o server.exe main.go
Linux:
bash
go build -ldflags="-s -w" -o server main.go - 运行服务器:
bash
./server
调试方式
- 确保
mcp.json
文件中的command
指向可执行文件的绝对路径 - 在 GitHub Copilot 中选择 Agent 模式
- 点击播放图标
- 测试工具,例如输入 "calculate 2 and 4"