Skip to content

Commit 31029b6

Browse files
committed
design.md
1 parent 15eb8a6 commit 31029b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

design/design.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Sessions are created from either `Client` or `Server` using the `Connect` method
323323
324324
```go
325325
type Client struct { /* ... */ }
326-
func NewClient(name, version string, opts *ClientOptions) *Client
326+
func NewClient(impl *Implementation, opts *ClientOptions) *Client
327327
func (*Client) Connect(context.Context, Transport) (*ClientSession, error)
328328
func (*Client) Sessions() iter.Seq[*ClientSession]
329329
// Methods for adding/removing client features are described below.
@@ -338,7 +338,7 @@ func (*ClientSession) Wait() error
338338
// For example: ClientSession.ListTools.
339339

340340
type Server struct { /* ... */ }
341-
func NewServer(name, version string, opts *ServerOptions) *Server
341+
func NewServer(impl *Implementation, opts *ServerOptions) *Server
342342
func (*Server) Connect(context.Context, Transport) (*ServerSession, error)
343343
func (*Server) Sessions() iter.Seq[*ServerSession]
344344
// Methods for adding/removing server features are described below.
@@ -356,7 +356,7 @@ func (*ServerSession) Wait() error
356356
Here's an example of these APIs from the client side:
357357
358358
```go
359-
client := mcp.NewClient("mcp-client", "v1.0.0", nil)
359+
client := mcp.NewClient(&mcp.Implementation{Name:"mcp-client", Version:"v1.0.0"}, nil)
360360
// Connect to a server over stdin/stdout
361361
transport := mcp.NewCommandTransport(exec.Command("myserver"))
362362
session, err := client.Connect(ctx, transport)
@@ -371,7 +371,7 @@ A server that can handle that client call would look like this:
371371
372372
```go
373373
// Create a server with a single tool.
374-
server := mcp.NewServer("greeter", "v1.0.0", nil)
374+
server := mcp.NewServer(&mcp.Implementation{Name:"greeter", Version:"v1.0.0"}, nil)
375375
mcp.AddTool(server, &mcp.Tool{Name: "greet", Description: "say hi"}, SayHi)
376376
// Run the server over stdin/stdout, until the client disconnects.
377377
if err := server.Run(context.Background(), mcp.NewStdioTransport()); err != nil {

0 commit comments

Comments
 (0)