fastmcp  by punkpeye

TypeScript framework for building MCP servers handling client sessions

Created 8 months ago
2,535 stars

Top 18.4% on SourcePulse

GitHubView on GitHub
Project Summary

FastMCP is a TypeScript framework for building Model Context Protocol (MCP) servers, enabling seamless integration of LLMs with local or remote resources and tools. It targets developers building AI agents that require structured communication with external systems, offering a robust way to expose functionalities like file access, API interactions, and custom logic to LLM-powered applications.

How It Works

FastMCP leverages the MCP specification to define "Tools" (executable functions), "Resources" (data exposed via URIs), and "Prompts" (reusable LLM interaction templates). It supports various data content types including text, images, and audio, and allows flexible schema definition for tool parameters using libraries like Zod. Communication is facilitated via Server-Sent Events (SSE) for real-time updates, with built-in support for authentication and session management.

Quick Start & Requirements

  • Install via npm: npm install fastmcp
  • Requires Node.js.
  • Quickstart and examples available in the README.
  • CLI for testing: npx fastmcp dev <server_file>
  • CLI for inspection: npx fastmcp inspect <server_file>

Highlighted Details

  • Supports multiple schema validation libraries (Zod, ArkType, Valibot) for tool parameters.
  • Enables returning rich content types (text, image, audio) from tool executions.
  • Allows custom authentication mechanisms and provides typed events for client connections and session changes.
  • Features resource templates with argument auto-completion and prompt templates with similar completion capabilities.
  • Includes tool annotations for richer metadata (e.g., readOnlyHint, openWorldHint).

Maintenance & Community

The project is inspired by a Python implementation and incorporates code from LiteMCP. A showcase section lists several community-contributed MCP servers.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project's license is not clearly stated, which may impact commercial adoption. The README mentions "many real-world examples" but does not provide direct links to a showcase or specific examples within the documentation itself.

Health Check
Last Commit

6 days ago

Responsiveness

1 day

Pull Requests (30d)
8
Issues (30d)
6
Star History
138 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
3 more.

inspector by modelcontextprotocol

2.8%
6k
Debugging tool for Model Context Protocol (MCP) servers
Created 11 months ago
Updated 1 day ago
Feedback? Help us improve.