by punkpeye
A TypeScript framework for building MCP servers.
# Add to your Claude Code skills
git clone https://github.com/punkpeye/fastmcpGuides for using mcp servers skills like fastmcp.
Last scanned: 12/1/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@modelcontextprotocol/inspector: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "@modelcontextprotocol/inspector-client: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "@modelcontextprotocol/inspector-server: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "@npmcli/arborist: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/config: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/map-workspaces: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@npmcli/metavuln-calculator: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@semantic-release/github: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@semantic-release/npm: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@sigstore/tuf: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@tufjs/models: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@wong2/mcp-cli: wong2 mcp-cli Command Injection Vulnerability",
"severity": "low"
},
{
"type": "npm-audit",
"message": "esbuild: esbuild allows arbitrary file read when running the development server on Windows",
"severity": "low"
},
{
"type": "npm-audit",
"message": "glob: Glob: AbortSignal cancellation bypass allows post-timeout filesystem traversal",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "ignore-walk: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "libnpmdiff: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "libnpmexec: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "libnpmfund: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "libnpmpack: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "libnpmpublish: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "minimatch: minimatch has potential denial of service via globparts amplification",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "npm: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "npm-packlist: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "pacote: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "semantic-release: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "sigstore: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "tar: node-tar UnpackSync never completes sync-stream extraction after any failing entry (PEND/UNPEND imbalance)",
"severity": "high"
},
{
"type": "npm-audit",
"message": "tuf-js: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "zod: Zod can exhaust memory while validating oversized constrained collections",
"severity": "high"
}
],
"status": "WARNING",
"scannedAt": "2026-12-01T22:58:49.933Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}fastmcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by punkpeye. A TypeScript framework for building MCP servers. It has 3,288 GitHub stars.
fastmcp returned warnings in AgentsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/punkpeye/fastmcp" and add it to your Claude Code skills directory (see the Installation section above).
fastmcp is primarily written in TypeScript. It is open-source under punkpeye on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh fastmcp against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
A TypeScript framework for building MCP servers capable of handling client sessions.
[!IMPORTANT]
FastMCP implements the legacy, handshake-based MCP revisions (
2025-11-25and earlier). It does not support the current specification,2026-07-28, which made the protocol stateless — noinitializehandshake and noMcp-Session-Id. For a framework targeting the current spec, use ViteMCP.
FastMCP is built on top of the official SDK.
The official SDK provides foundational blocks for building MCPs, but leaves many implementation details to you:
FastMCP eliminates this complexity by providing an opinionated framework that:
When to choose FastMCP: You want to build MCP servers quickly without dealing with low-level implementation details.
When to use the official SDK: You need maximum control or have specific architectural requirements. In this case, we encourage referencing FastMCP's implementation to avoid common pitfalls.
npm install fastmcp
[!NOTE]
There are many real-world examples of using FastMCP in the wild. See the Showcase for examples.
import { FastMCP } from "fastmcp";
import { z } from "zod"; // Or any validation library that supports Standard Schema
const server = new FastMCP({
name: "My Server",
version: "1.0.0",
});
server.addTool({
name: "add",
description: "Add two numbers",
parameters: z.object({
a: z.number(),
b: z.number(),
}),
execute: async (args) => {
return String(args.a + args.b);
},
});
server.start({
transportType: "stdio",
});
That's it! You have a working MCP server.
You can test the server in terminal with:
git clone https://github.com/punkpeye/fastmcp.git
cd fastmcp
pnpm install
pnpm build
# Test the addition server example using CLI:
npx fastmcp dev src/examples/addition.ts
# Test the addition server example using MCP Inspector:
npx fastmcp inspect src/examples/addition.ts
FastMCP supports multiple transport options for remote communication, allowing an MCP hosted on a remote machine to be accessed over the network.
HTTP streaming provides a more efficient alternative to SSE in environments that support it, with potentially better performance for larger payloads.
You can run the server with HTTP streaming support:
server.start({
transportType: "httpStream",
httpStream: {
port: 8080,
},
});
This will start the server and listen for HTTP streaming connections on http://localhost:8080/mcp.
Note: You can also customize the endpoint path using the
httpStream.endpointoption (default is/mcp).
Note: To serve HTTP streaming and built-in OAuth routes under an issuer path, set
httpStream.basePath(for example,/issuer1). This exposes authorization server metadata at/.well-known/oauth-authorization-server/issuer1per RFC 8414.
Note: This also starts an SSE server on
http://localhost:8080/sse.
You can connect to these servers using the appropriate client transport.
For HTTP streaming connections:
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client(
{
name: "example-client",
version: "1.0.0",
},
{
capabilities: {},
},
);
const transport = new StreamableHTTPClientTransport(
new URL(`http://localhost:8080/mcp`),
);
await client.connect(transport);
For SSE connections:
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
const client = new Client(
{
name: "example-client",
version: "1.0.0",
},
{
capabilities: {},
},
);
const transport = new SSEClientTransport(new URL(`http://localhost:8080/sse`));
await client.connect(transport);
FastMCP supports HTTPS for secure connections by providing SSL certificate options:
server.start({
transportType: "httpStream",
httpStream: {
port: 8443,
sslCert: "./path/to/cert.pem",
sslKey: "./path/to/key.pem",
sslCa: "./path/to/ca.pem", // Optional: for client certificate authentication
},
});
This will start the server with HTTPS on https://localhost:8443/mcp.
SSL Options:
sslCert - Path to SSL certificate filesslKey - Path to SSL private key filesslCa - (Optional) Path to CA certificate for mutual TLS authenticationFor testing, you can generate self-signed certificates:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
For production, obtain certificates from a trusted CA like Let's Encrypt.
See the https-server example for a complete demonstration.
By default, FastMCP enables CORS with a standard set of allowed headers.
A server bound to a loopback address, which is the default (localhost), answers browser requests from loopback origins only, such as http://localhost:6274. A page served from any other origin cannot open a session or send a message: those requests are refused with a 403. A local server is out of the network's reach but not out of a browser's: without this, any web page you visit could call its tools. Requests without an Origin header, which is every client that is not a web page, are not affected, and a server bound to another address answers every origin.
To answer pages served from elsewhere, name their origins in cors.origin. That list replaces the loopback default, so include a local page's origin too if you use one. Credentials (credentials: true) are only granted to origins named there.
server.start({
transportType: "httpStream",
httpStream: {
port: 8080,
cors: {
origin: ["https://app.example.com", "http://localhost:6274"],
allowedHeaders: [
"Content-Type",
"Authorization",
"Accept",
"Mcp-Session-Id",
"Mcp-Protocol-Version",
"Last-Event-Id",
"X-Custom-Header",
],
credentials: true,
},
},
});
The cors option accepts:
true - enable CORS for every originfalse - disable CORS entirelyorigin - a string, array of strings, or a function (origin: string) => boolean. On a server bound to loopback these are the origins it answers, and "*" answers all of them. An extension's or app's origin, such as chrome-extension://…, can be named as it isallowedHeaders - a string or array of stringsmethods - array of allowed HTTP methods