Skip to content

Commit 0ebb3d4

Browse files
author
piexlMax(奇淼
committed
update: 更新MCP为0.29.0,并且调节对应的方法。
1 parent e7680c4 commit 0ebb3d4

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

server/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ require (
113113
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
114114
github.com/magiconair/properties v1.8.9 // indirect
115115
github.com/mailru/easyjson v0.9.0 // indirect
116-
github.com/mark3labs/mcp-go v0.26.0 // indirect
116+
github.com/mark3labs/mcp-go v0.29.0 // indirect
117117
github.com/mattn/go-isatty v0.0.20 // indirect
118118
github.com/microsoft/go-mssqldb v1.8.0 // indirect
119119
github.com/minio/md5-simd v1.1.2 // indirect

server/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4
314314
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
315315
github.com/mark3labs/mcp-go v0.26.0 h1:xz/Kv1cHLYovF8txv6btBM39/88q3YOjnxqhi51jB0w=
316316
github.com/mark3labs/mcp-go v0.26.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
317+
github.com/mark3labs/mcp-go v0.29.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
317318
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
318319
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
319320
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=

server/mcp/current_time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type CurrentTime struct {
1919
func (t *CurrentTime) Handle(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
2020
// 获取当前系统时间
2121

22-
timezone, ok := request.Params.Arguments["timezone"].(string)
22+
timezone, ok := request.GetArguments()["timezone"].(string)
2323

2424
if !ok {
2525
return nil, errors.New("参数错误:timezone 必须是字符串类型")

server/mcp/get_nickname.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (t *GetNickname) New() mcp.Tool {
2929
// Handle 处理获取昵称的请求
3030
func (t *GetNickname) Handle(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
3131
// 1. 参数验证
32-
username, ok := request.Params.Arguments["username"].(string)
32+
username, ok := request.GetArguments()["username"].(string)
3333
if !ok {
3434
return nil, errors.New("参数错误:username 必须是字符串类型")
3535
}

server/resource/mcp/tools.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (t *{{.Name | title}}) Handle(ctx context.Context, request mcp.CallToolRequ
1717
// TODO: 实现工具逻辑
1818
// 参数示例:
1919
// {{- range .Params}}
20-
// {{.Name}} := request.Params.Arguments["{{.Name}}"]
20+
// {{.Name}} := request.GetArguments()["{{.Name}}"]
2121
// {{- end}}
2222
return &mcp.CallToolResult{
2323
Content: []mcp.Content{

0 commit comments

Comments
 (0)