refactor: 迁移到官方 MCP SDK (#167)
- 添加官方 SDK 依赖 github.com/modelcontextprotocol/go-sdk v0.7.0 - 新增 mcp_server.go 使用官方 SDK 注册 8 个 MCP 工具 - 删除自实现的 streamable_http.go(约 400 行) - 更新 routes.go 使用 mcp.NewStreamableHTTPHandler - 优化服务器优雅关闭逻辑(5秒超时 + 警告日志) - 清理 types.go 中的 JSON-RPC 相关类型 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
5
go.mod
5
go.mod
@@ -6,6 +6,8 @@ require (
|
||||
github.com/gin-gonic/gin v1.10.1
|
||||
github.com/go-rod/rod v0.116.2
|
||||
github.com/h2non/filetype v1.1.3
|
||||
github.com/mattn/go-runewidth v0.0.16
|
||||
github.com/modelcontextprotocol/go-sdk v0.7.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/stretchr/testify v1.10.0
|
||||
@@ -25,11 +27,11 @@ require (
|
||||
github.com/go-playground/validator/v10 v10.20.0 // indirect
|
||||
github.com/go-rod/stealth v0.4.9 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/google/jsonschema-go v0.3.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
@@ -37,6 +39,7 @@ require (
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
|
||||
github.com/ysmood/fetchup v0.2.3 // indirect
|
||||
github.com/ysmood/goob v0.4.0 // indirect
|
||||
github.com/ysmood/got v0.41.0 // indirect
|
||||
|
||||
Reference in New Issue
Block a user