> ## 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.

# Installation

> Install FastMCP TypeScript and its optional peer dependencies

FastMCP TypeScript installs as a single package with a bundled CLI. Once it's in place, the [quickstart](/quickstart) walks you through building and running your first server.

## Requirements

The server entrypoint, `@prefecthq/fastmcp-ts/server`, runs on **Node.js 22 or later** — serving MCP depends on Node APIs like subprocesses and the filesystem.

The client entrypoint, `@prefecthq/fastmcp-ts/client`, runs on Node.js 22 or later and also **bundles for the browser**. Any bundler that honors the package's `browser` field — Vite, webpack, esbuild, Rollup — produces a build with no Node built-ins, so a web app can talk to an MCP server over HTTP. The Node-only pieces, the stdio [transport](/clients/transports#browser-builds) and filesystem token storage, load lazily and drop out of a browser build; [authenticating a browser client](/clients/auth#browser-apps) uses a popup or redirect OAuth flow and web-backed token storage.

## Install the package

```bash theme={null}
npm install @prefecthq/fastmcp-ts
```

The package exposes two subpath entrypoints, so you only pull in what you use:

```typescript theme={null}
import { FastMCP } from '@prefecthq/fastmcp-ts/server'
import { Client } from '@prefecthq/fastmcp-ts/client'
```

It also installs the [`fastmcp` CLI](/cli) as a self-contained binary:

```bash theme={null}
npx fastmcp --help
```

## Schema library

Input and output schemas work with any [Standard Schema](https://standardschema.dev)-compatible validation library — Zod, Valibot, ArkType, and others. Most examples in these docs use Zod:

```bash theme={null}
npm install zod
```

## Optional peer dependencies

The client's [sampling adapters](/clients/sampling) forward LLM sampling requests to your AI provider. Each adapter requires its provider SDK, declared as an optional peer dependency — install only the one you use:

| Adapter                    | Install                         |
| -------------------------- | ------------------------------- |
| `AnthropicSamplingAdapter` | `npm install @anthropic-ai/sdk` |
| `OpenAISamplingAdapter`    | `npm install openai`            |
| `GoogleSamplingAdapter`    | `npm install @google/genai`     |

Nothing breaks if these are absent — the adapters import provider types with `import type`, so there is no runtime cost or error unless you actually instantiate one.
