Client

typescript-sdk · integration, mcp-client, protocol-handshake, capability-negotiation, response-caching, infra

MCP client implementation handling connection, capability negotiation, protocol handshakes, paginated listing, caching, and request validation.

// Source: https://github.com/modelcontextprotocol/typescript-sdk | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
export class Client extends Protocol<ClientContext> {
    private _serverCapabilities?: ServerCapabilities;
    private _serverVersion?: Implementation;
    private _capabilities: ClientCapabilities;
    private _instructions?: string;
    private _jsonSchemaValidator: jsonSchemaValidator;
    /**
     * The response-cache substrate. Owns the backing store, the per-method
     * eviction-generation counter, the user-supplied/default flag, and the
     * stamp-memoized derived `name → Tool` / `name → output-validator`
     * indices — the cache-coordination state that used to live as separate
     * private fields here. The internal aggrega

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key