MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / runBasicClient

Function runBasicClient

conformance/everything-client/main.go:79–92  ·  view source on GitHub ↗

============================================================================ Basic scenarios ============================================================================

(ctx context.Context, serverURL string, _ map[string]any)

Source from the content-addressed store, hash-verified

77// ============================================================================
78
79func runBasicClient(ctx context.Context, serverURL string, _ map[string]any) error {
80 session, err := connectToServer(ctx, serverURL)
81 if err != nil {
82 return err
83 }
84 defer session.Close()
85
86 _, err = session.ListTools(ctx, nil)
87 if err != nil {
88 return fmt.Errorf("session.ListTools(): %v", err)
89 }
90
91 return nil
92}
93
94func runToolsCallClient(ctx context.Context, serverURL string, _ map[string]any) error {
95 session, err := connectToServer(ctx, serverURL)

Callers

nothing calls this directly

Calls 3

connectToServerFunction · 0.85
ListToolsMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…