Skip to main content
FastMCP TypeScript is the TypeScript framework for building Model Context Protocol servers, clients, and apps. It is the official TypeScript counterpart to FastMCP for Python — built and maintained by the same team at Prefect. Built on the official @modelcontextprotocol/sdk, FastMCP handles the protocol plumbing so you can focus on what your server actually does.
import { FastMCP } from '@prefecthq/fastmcp-ts/server'
import { z } from 'zod'

const server = new FastMCP({ name: 'my-server', version: '1.0.0' })

server.tool(
  {
    name: 'add',
    description: 'Add two numbers',
    input: z.object({ a: z.number(), b: z.number() }),
  },
  ({ a, b }) => a + b
)

await server.run()

The three pillars

Servers

Turn TypeScript functions into MCP tools, resources, and prompts — with middleware, auth, composition, and long-running tasks.

Clients

Connect to one or many MCP servers, call tools, and wire LLM sampling to Anthropic, OpenAI, or Google with one line.

Apps

Build interactive UIs rendered directly in MCP host conversations using a server-side component library.

Get going

Quickstart

Build, run, and call your first MCP server in a few minutes.

CLI

Run, inspect, call, and install servers from the command line with fastmcp.

Ecosystem

PackageRole
@modelcontextprotocol/sdkOfficial low-level MCP protocol implementation — this library’s foundation
fastmcp (PyPI)The Python original this project models its API after
@modelcontextprotocol/ext-appsOfficial MCP Apps extension — foundation for the Apps pillar