> ## Documentation Index
> Fetch the complete documentation index at: https://fastmcp-ts.docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ClientOptions

Defined in: [client/client.ts:72](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L72)

## Properties

### auth?

```ts theme={null}
optional auth?: 
  | string
  | AsyncHeaderAuth
  | OAuth
  | BearerAuth;
```

Defined in: [client/client.ts:77](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L77)

Authentication to attach to HTTP requests.
A plain string is treated as a Bearer token.

***

### autoInitialize?

```ts theme={null}
optional autoInitialize?: boolean;
```

Defined in: [client/client.ts:89](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L89)

When true (default), the MCP initialize handshake is performed
automatically inside connect().

***

### cachePartition?

```ts theme={null}
optional cachePartition?: string;
```

Defined in: [client/client.ts:136](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L136)

Opaque per-principal identifier for response-cache writes whose
server-reported `cacheScope` is `'private'`. Set this to a stable identity
of the authorization context (e.g. the auth subject) when one
`responseCacheStore` backs several principals. Passed through verbatim.

***

### defaultCacheTtlMs?

```ts theme={null}
optional defaultCacheTtlMs?: number;
```

Defined in: [client/client.ts:142](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L142)

TTL (ms) applied when a cacheable result arrives without a `ttlMs` field.
Default `0` (never served from cache, but still stored). Passed through
verbatim.

***

### defaultOptions?

```ts theme={null}
optional defaultOptions?: ClientDefaultOptions;
```

Defined in: [client/client.ts:90](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L90)

***

### handlers?

```ts theme={null}
optional handlers?: ClientHandlers;
```

Defined in: [client/client.ts:78](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L78)

***

### inputRequired?

```ts theme={null}
optional inputRequired?: InputRequiredOptions;
```

Defined in: [client/client.ts:122](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L122)

Multi-round-trip auto-fulfilment (protocol revision 2026-07-28). On the
modern era, servers obtain client input (elicitation, sampling, roots) by
answering a request with an `input_required` result instead of a
server→client request. By default the client fulfils these automatically
through the same `handlers.sampling`/`handlers.elicitation` callbacks,
retrying up to `maxRounds` times. Set `autoFulfill: false` for manual mode.
Has no effect on legacy-era connections. Passed through verbatim to the SDK
client.

***

### legacySSE?

```ts theme={null}
optional legacySSE?: boolean;
```

Defined in: [client/client.ts:150](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L150)

Allow the deprecated SSE transport when a target URL's path indicates SSE
(e.g. ends in `/sse`). Default `false` — such URLs throw a clear error
pointing at Streamable HTTP and this flag, rather than silently connecting
over a transport the MCP SDK itself marks `@deprecated`. When enabled, a
one-time deprecation warning is logged via `console.warn`.

***

### prior?

```ts theme={null}
optional prior?: PriorDiscovery;
```

Defined in: [client/client.ts:111](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L111)

A cached era verdict from a previous connection to the same server, so
connect() can skip the `server/discover` probe entirely. Takes precedence
over `versionNegotiation`. `{ kind: 'modern', discover }` adopts a prior
`DiscoverResult` with zero round trips; `{ kind: 'legacy' }` skips the probe
and runs the plain legacy `initialize` handshake. Freshness is the caller's
responsibility — a stale modern verdict fails loudly at the first request; a
stale legacy verdict succeeds silently forever. Reuse only within one
authorization context.

***

### responseCacheStore?

```ts theme={null}
optional responseCacheStore?: ResponseCacheStore;
```

Defined in: [client/client.ts:129](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L129)

The response-cache store backing cacheable results (SEP-2549 `ttlMs`/
`cacheScope` hints on `listTools`/`listResources`/`listResourceTemplates`/
`listPrompts`/`readResource`). Defaults to a fresh in-memory store per
client (the SDK's own default) when omitted. Passed through verbatim.

***

### roots?

```ts theme={null}
optional roots?: RootsValue;
```

Defined in: [client/client.ts:84](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L84)

Filesystem roots to advertise to the server.
Accepts a static array of strings / Root objects, or an async callback
invoked on each roots/list request (useful for dynamic root sets).

***

### versionNegotiation?

```ts theme={null}
optional versionNegotiation?: VersionNegotiationOptions;
```

Defined in: [client/client.ts:100](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/client.ts#L100)

Opt-in protocol version negotiation (protocol revision 2026-07-28 and later).
The default is `'legacy'`: connect() runs the plain 2025 sequence, byte-identical
to today's behavior (no probe, no new headers). Pass `{ mode: 'auto' }` to probe
with `server/discover` and use the modern era when the server supports it
(falling back to legacy otherwise), or `{ mode: { pin: '2026-07-28' } }` to
require the modern era outright. See `getProtocolEra()` to read the negotiated
result after connecting.
