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
|
|
@ -20,7 +20,7 @@ func TestSSEServer(t *testing.T) {
|
|||
for _, closeServerFirst := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("closeServerFirst=%t", closeServerFirst), func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
server := NewServer("testServer", "v1.0.0", nil)
|
||||
server := NewServer(testImpl, nil)
|
||||
AddTool(server, &Tool{Name: "greet"}, sayHi)
|
||||
|
||||
sseHandler := NewSSEHandler(func(*http.Request) *Server { return server })
|
||||
|
|
@ -47,7 +47,7 @@ func TestSSEServer(t *testing.T) {
|
|||
HTTPClient: customClient,
|
||||
})
|
||||
|
||||
c := NewClient("testClient", "v1.0.0", nil)
|
||||
c := NewClient(testImpl, nil)
|
||||
cs, err := c.Connect(ctx, clientTransport)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue