# fastmcp-ts [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/PrefectHQ/fastmcp-ts  
**GitHub Stars:** 101  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fastmcp-ts

## Description
The official FastMCP TypeScript library for building MCP servers, clients, and apps 🏎️ 🏎️ 🏎️

## Tools
Capabilities this server exposes over MCP:

- **search_fast_mcp_ts** — Search across the FastMCP TS knowledge base to find relevant information, code examples, API references, and guides. Use this tool when you need to answer questions about FastMCP TS, find specific documentation, understand how features work, or locate implementation details. The search returns contextual content with titles and direct links to the documentation pages. If you need the full content of a specific page, use the query_docs_filesystem tool to `head` or `cat` the page path (append `.mdx` to the path returned from search — e.g. a result at `/some/page` is read with `head -200 /some/page.mdx`).
- **query_docs_filesystem_fast_mcp_ts** — Run a read-only shell-like query against a virtualized, in-memory filesystem rooted at `/` that contains ONLY the FastMCP TS documentation pages. This is NOT a shell on any real machine — nothing runs on the user's computer, the server host, or any network. The filesystem is a sandbox backed by documentation chunks.

This is how you read documentation pages: there is no separate "get page" tool. To read a page, pass its `.mdx` path to `head` or `cat` — a page at the URL path `/some/page` lives at `/some/page.mdx`. To search the docs with exact keyword or regex matches, use `rg`. To understand the docs structure, use `tree` or `ls`.

**Paths are specific to this site — never guess them.** Discover real paths with `tree / -L 2`, `ls /`, or the search tool before reading. If a path does not exist, that only means the guess was wrong; it does NOT mean the topic is undocumented — use `rg -il "keyword" /` to find where it is covered.

**Workflow:** Start with the search tool for broad or conceptual queries like "how to authenticate" or "rate limiting". Use this tool when you need exact keyword/regex matching, structural exploration, or to read the full content of a specific page by path.

Supported commands: rg (ripgrep), grep, find, tree, ls, cat, head, tail, stat, wc, sort, uniq, cut, sed, jq, plus basic text utilities. No writes, no network, no process control. Run `--help` on any command for usage.

Each call is STATELESS: the working directory always resets to `/` and no shell variables, aliases, or history carry over between calls. If you need to operate in a subdirectory, chain commands in one call with `&&` or pass absolute paths (e.g., `cd /some-directory && ls` or `ls /some-directory`). Do NOT assume that `cd` in one call affects the next call.

Examples (replace the placeholder paths with real ones from `tree` or search):
- `tree / -L 2` — see the top-level directory layout
- `rg -il "rate limit" /` — find all files mentioning "rate limit"
- `rg -C 3 "apiKey" /some-directory/` — show matches with 3 lines of context around each hit
- `head -80 /some/page.mdx` — read the top 80 lines of a specific page
- `head -80 /page-one.mdx /page-two.mdx /section/page-three.mdx` — read multiple pages in one call
- `cat /some/page.mdx` — read a full page when you need everything

Output is truncated to 30KB per call. Prefer targeted `rg -C` or `head -N` over broad `cat` on large files. To read only the relevant sections of a large file, use `rg -C 3 "pattern" /path/file.mdx`. Batch multiple file reads into a single `head` or `cat` call whenever possible.

When referencing pages in your response to the user, convert filesystem paths to URL paths by removing the `.mdx` extension. For example, `/some/page.mdx` becomes `/some/page`.
- **submit_feedback** — Report a problem with this documentation site so the docs team can fix it. Use when a documentation page is incorrect, outdated, confusing, incomplete, or has a broken example. This is for feedback about the documentation content itself — not for product support requests or feedback about this tool or assistant.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "fastmcp-ts": {
    "url": "https://fastmcp-ts.docs.prefect.io/mcp"
  }
}
```

## Documentation

## What fastmcp-ts does

fastmcp-ts provides the building blocks for creating MCP servers, MCP clients, and applications in TypeScript. A server can expose ordinary functions as tools, static or parameterized data as resources, and reusable prompt templates. Input definitions can use Standard Schema-compatible libraries such as Zod, Valibot, or ArkType, allowing the framework to infer tool schemas.

The package also includes a server-side UI component library. Applications can expose an LLM-visible entrypoint that renders components such as text, inputs, buttons, columns, rows, and tables. Backend tools can remain available only to the rendered interface. Built-in providers cover approvals, choices, file uploads, validated forms, and generative UI.

## How it works

Install the npm package and create a `FastMCP` instance with a name and optional version. Register tools, resources, prompts, middleware, authentication, or providers, then start the server with `run()`. The default transport is stdio; HTTP can be selected with a port for networked deployments.

Handlers can obtain an ambient context from the server. That context supports logging, progress reporting, LLM sampling, user elicitation, and session-specific state without passing these concerns through every function argument. Authentication can use a JWT verifier configured with a JWKS endpoint, issuer, and audience. Logging and rate-limiting middleware are available for request processing.

Servers can be composed by mounting child servers under a namespace. A remote HTTP server can be wrapped with `createProxy` and mounted alongside local servers, producing names such as `weather_forecast` or `maps_<tool_name>`.

The client API connects to a URL or a named collection of MCP servers. It can list tools, resources, and prompts; call tools; read resources; and retrieve prompts. Multi-server connections namespace capabilities by server name. Sampling adapters forward server sampling requests to Anthropic, OpenAI, or Google providers.

## Setup and configuration

Install the package with:

```bash
npm install @prefecthq/fastmcp-ts
```

The installation also provides the `fastmcp` command. It can run a TypeScript server, inspect local files or remote URLs, and call a tool without requiring a separate build step. Typical commands include `fastmcp run server.ts`, `fastmcp inspect --file server.ts`, and `fastmcp call add --file server.ts a=1 b=2`.

A client can connect with `Client.connect('http://localhost:3000')` or receive an `mcpServers` map for multiple connections. JavaScript resource management with `await using` can close a client automatically when its scope ends.

## Tools and capabilities

- Register typed tools, resources, and prompts.
- Serve over stdio or HTTP.
- Add logging, rate limiting, and JWT-based authentication.
- Mount local or proxied servers with name-prefix namespacing.
- Access progress, logging, sampling, elicitation, and session context from handlers.
- Build MCP-hosted interfaces with reusable UI components and providers.
- Use Anthropic, OpenAI, or Google sampling adapters on the client side.
- Inspect servers and invoke tools through the bundled CLI.

_Full upstream README: https://allmcps.com/mcp/fastmcp-ts/readme_

