mcp: NewClient and NewServer take Implementation (#113)
Change the name and version arguments to NewClient and NewServer to a `*Implementation`, to future-proof against the spec. Fixes #109.
This commit is contained in:
parent
b4febf129b
commit
6c6243c0b0
1 changed files with 76 additions and 69 deletions
|
|
@ -42,7 +42,7 @@ func PromptHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.GetPromptP
|
|||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
server := mcp.NewServer("greeter", "v0.0.1", nil)
|
||||
server := mcp.NewServer(&mcp.Implementation{Name: "greeter"}, nil)
|
||||
mcp.AddTool(server, &mcp.Tool{Name: "greet", Description: "say hi"}, SayHi)
|
||||
server.AddPrompt(&mcp.Prompt{Name: "greet"}, PromptHi)
|
||||
server.AddResource(&mcp.Resource{
|
||||
|
|
|
|||
Loading…
Reference in a new issue