Graphorin API reference v0.15.1
Graphorin API reference / @graphorin/mcp / / CreateMCPClientOptions
Interface: CreateMCPClientOptions
Defined in: packages/mcp/src/client/types.ts:26
Stable
Options accepted by createMCPClient.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
authProvider? | readonly | OAuthAuthorizationProvider | Pre-built OAuth provider that resolves the bearer header on every request. Mutually exclusive with bearerToken. | packages/mcp/src/client/types.ts:32 |
bearerToken? | readonly | string | Pre-shared bearer token (rare; prefer authProvider). | packages/mcp/src/client/types.ts:34 |
clientName? | readonly | string | Operator-supplied client name advertised to the server on initialize. | packages/mcp/src/client/types.ts:53 |
clientVersion? | readonly | string | Operator-supplied client version advertised to the server on initialize. | packages/mcp/src/client/types.ts:55 |
collisionStrategy? | readonly | CollisionStrategy | Per-client default for the strategy-aware tool registry. Falls through to the per-call value on MCPClient.toTools. Default 'auto-prefix' | packages/mcp/src/client/types.ts:41 |
elicitation? | readonly | MCPElicitationHandler | Handler for server-initiated elicitation (elicitation/create) requests - the server asks the human for structured input mid-call. When provided, the client advertises the elicitation capability and routes requests here; back it with a HITL surface (e.g. a CLI prompt or the agent's approval channel). When omitted, the capability is not advertised and a conforming server will not elicit (gated; no implicit prompting). Note: an elicitation arrives while a callTool(...) JSON-RPC request is in flight, so the handler resolves in-process - it does not durably suspend a Graphorin run. Durable-suspend elicitation across the request lifetime is a follow-up. | packages/mcp/src/client/types.ts:77 |
logger? | readonly | (level, message, fields?) => void | Operator-supplied logger. | packages/mcp/src/client/types.ts:47 |
onTransportClose? | readonly | (info) => void | Called when the underlying transport closes (a stdio child dying, an HTTP session dropping beyond the SDK's SSE resume). Without it a disconnect is observable only as MCPProtocolErrors on subsequent calls. The client does NOT auto-reconnect - rebuild it via createMCPClient(...) (and re-run toTools() for the drift diff) when this fires, or use the createManagedMCPClient(...) wrapper, which does exactly that automatically (there the operator callback fires only when the wrapper's reconnect attempts are exhausted). | packages/mcp/src/client/types.ts:100 |
onTransportError? | readonly | (error, info) => void | Called on transport-level errors (see onTransportClose). | packages/mcp/src/client/types.ts:102 |
priority? | readonly | number | Per-client priority value used by the 'priority' strategy. | packages/mcp/src/client/types.ts:43 |
sampling? | readonly | MCPSamplingHandler | Handler for server-initiated sampling (sampling/createMessage) requests - the server asks the client's model to generate a completion. When provided, the client advertises the sampling capability and routes requests here; back it with a Provider. The request messages are MCP-derived (untrusted), so the backing provider should apply the usual sensitivity/redaction middleware. When omitted, the capability is not advertised (gated). | packages/mcp/src/client/types.ts:88 |
serverInfoName? | readonly | string | Operator-supplied server identity overrides. | packages/mcp/src/client/types.ts:45 |
suppressDeprecatedTransportWarning? | readonly | boolean | Skip the deprecated-transport WARN log. Useful for tests + the standalone server's startup banner. Default false | packages/mcp/src/client/types.ts:62 |
transport | readonly | MCPTransportConfig | - | packages/mcp/src/client/types.ts:27 |