Back to Home
punkpeye icon

fastmcp

Verified Safe

by punkpeye

Overview

A TypeScript framework for building Model Context Protocol (MCP) servers, providing high-level abstractions and boilerplate handling for features like tools, prompts, resources, sessions, authentication, and HTTP streaming.

Installation

Run Command
npx fastmcp dev src/examples/addition.ts --http-stream

Environment Variables

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET
  • OAUTH_CLIENT_ID
  • OAUTH_CLIENT_SECRET
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • USER_ID
  • USERNAME
  • USER_ROLE
  • CLIENT_SECRET
  • JWT_SECRET
  • FASTMCP_TRANSPORT
  • FASTMCP_PORT
  • FASTMCP_ENDPOINT
  • FASTMCP_STATELESS
  • FASTMCP_HOST

Security Notes

The framework utilizes Zod/ArkType/Valibot for robust input validation in tools, which is a strong security practice. It provides explicit authentication hooks (`authenticate` function) and granular access control (`canAccess` on tools). The OAuth Proxy implementation includes essential security features like PKCE and `redirect_uri` validation. Encrypted token storage (`EncryptedTokenStorage`) is available for sensitive data. Potential risks include user-controlled `fetch` URLs in `DiscoveryDocumentCache` or content processing, which could lead to SSRF if not properly validated by the implementing developer. Additionally, misconfiguration of OAuth keys or persistent storage for OAuth can introduce vulnerabilities, although the framework encourages best practices and secure defaults (e.g., auto-generated strong keys for encryption/signing if not provided). JWKS verification (via `JWKSVerifier`) requires the optional `jose` package, and its absence could lead to silent failures if JWKS is expected for token validation.

Similar Servers

Stats

Interest Score100
Security Score8
Cost ClassLow
Stars2881
Forks248
Last Update2026-01-19

Tags

MCPTypeScriptFrameworkServerAPI