Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/mcp / / CreateMCPClientOptions

Interface: CreateMCPClientOptions

Defined in: packages/mcp/src/client/types.ts:26

Options accepted by createMCPClient.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
authProvider?readonlyOAuthAuthorizationProviderPre-built OAuth provider that resolves the bearer header on every request. Mutually exclusive with bearerToken.packages/mcp/src/client/types.ts:32
bearerToken?readonlystringPre-shared bearer token (rare; prefer authProvider).packages/mcp/src/client/types.ts:34
clientName?readonlystringOperator-supplied client name advertised to the server on initialize.packages/mcp/src/client/types.ts:53
clientVersion?readonlystringOperator-supplied client version advertised to the server on initialize.packages/mcp/src/client/types.ts:55
collisionStrategy?readonlyCollisionStrategyPer-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?readonlyMCPElicitationHandlerHandler for server-initiated elicitation (elicitation/create) requests - the server asks the human for structured input mid-call (WI-13 / P2-2). 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?) => voidOperator-supplied logger.packages/mcp/src/client/types.ts:47
onTransportClose?readonly(info) => voidmcp-skills-10: 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 W-080 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) => voidmcp-skills-10: called on transport-level errors (see onTransportClose).packages/mcp/src/client/types.ts:102
priority?readonlynumberPer-client priority value used by the 'priority' strategy.packages/mcp/src/client/types.ts:43
sampling?readonlyMCPSamplingHandlerHandler for server-initiated sampling (sampling/createMessage) requests - the server asks the client's model to generate a completion (WI-13 / P2-2). 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?readonlystringOperator-supplied server identity overrides.packages/mcp/src/client/types.ts:45
suppressDeprecatedTransportWarning?readonlybooleanSkip the deprecated-transport WARN log. Useful for tests + the standalone server's startup banner. Default falsepackages/mcp/src/client/types.ts:62
transportreadonlyMCPTransportConfig-packages/mcp/src/client/types.ts:27