内容
# go-mcp
[](https://github.com/dstotijn/go-mcp/tags)
[](https://pkg.go.dev/github.com/dstotijn/go-mcp)
[](LICENSE)
[](https://goreportcard.com/report/github.com/dstotijn/go-mcp)
Go 语言库,用于实现 [模型上下文协议](https://modelcontextprotocol.io/)(MCP)。
## 功能特点
- [x] 支持协议修订版 [2024-11-05](https://spec.modelcontextprotocol.io/specification/2024-11-05/)
- [x] 服务器支持
- [x] 客户端支持
- [x] 无需反射的类型安全 RPC 处理程序
- [x] 工具参数的内置验证
## 安装
```
go get github.com/dstotijn/go-mcp
```
## 使用示例
请参阅 [examples/server/main.go](/examples/server/main.go) 以获取服务器实现的详细示例。
## 许可证
[Apache License 2.0](/LICENSE)
2025 David Stotijn