fastmcp
Verified Safeby punkpeye
Overview
Build Model Context Protocol (MCP) servers in TypeScript with features like session management, authentication (including OAuth), streaming, and type-safe tool/resource/prompt definitions.
Installation
npx fastmcp dev src/examples/addition.tsEnvironment Variables
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- GITHUB_CLIENT_ID
- GITHUB_CLIENT_SECRET
- AZURE_CLIENT_ID
- AZURE_CLIENT_SECRET
- OAUTH_CLIENT_ID
- OAUTH_CLIENT_SECRET
- FASTMCP_TRANSPORT
- FASTMCP_PORT
- FASTMCP_ENDPOINT
- FASTMCP_STATELESS
- FASTMCP_HOST
- USER_ID
- USERNAME
- USER_ROLE
- JWT_SECRET
Security Notes
The framework demonstrates strong security practices, especially around OAuth flows, token storage (encryption and token swap by default), and PKCE implementation. Sensitive keys are expected to be provided via environment variables, not hardcoded. The `authenticate` function, `imageContent` and `audioContent` helpers allow custom logic or fetching from external/local paths; developers using the framework must ensure proper input sanitization and validation for user-controlled inputs to prevent risks like SSRF or path traversal. The optional 'jose' dependency for JWKS verification is a well-regarded cryptographic library.
Similar Servers
mcp-server-typescript
This server acts as a Model Context Protocol (MCP) gateway, enabling AI assistants to interact with DataForSEO APIs for various SEO data, including keyword research, SERP analysis, backlink monitoring, and on-page optimization.
frontmcp
Develop and integrate third-party API services using the Model Context Protocol (MCP) framework, enabling AI models to interact with external systems through defined tools, resources, and prompts.
boilerplate-mcp-server
This boilerplate provides a production-ready foundation for developing custom Model Context Protocol (MCP) servers in TypeScript to connect AI assistants with external APIs and data sources, exemplified by an IP geolocation lookup tool.
mcp-typescript-template
This server acts as a template for building remote Model Context Protocol (MCP) servers using TypeScript, handling MCP tool registration and session management over HTTP.