MrTechKing

5 min read

FastMCP: Build MCP Servers and Clients in Python (GitHub, Scanned)

A free Python framework for MCP: turn ordinary functions into tools that Claude, Cursor and other AI apps can call.

FastMCP logo
✅
Scan: safe. Nothing malicious. Two things to know: each server start checks PyPI for updates and prints a link to Prefect's hosting, and the README promotes Prefect's paid FastMCP Gateway. Scanned Nov 21, 2026; the full report is below.

FastMCP is a free Python framework for the Model Context Protocol (MCP), the standard way AI apps such as Claude and Cursor connect to outside tools and data. You write an ordinary Python function, add the @mcp.tool decorator, and FastMCP builds the schema, checks the inputs and handles the protocol, so in the first ten minutes you have a working server an AI assistant can call. One more command registers it with Claude Desktop, Claude Code, Cursor, Gemini CLI or Goose.

It covers both sides of MCP. Servers expose tools, resources and prompts; clients connect to any MCP server and can list and call its tools from Python or the terminal; and Apps give a tool a small interactive interface shown inside the chat. It also handles the hard parts of remote servers, such as sign-in through providers like Google, GitHub, Azure, Auth0 and WorkOS, and it can turn an existing OpenAPI spec or FastAPI app into an MCP server. FastMCP 1.0 was folded into the official MCP Python SDK in 2024, and this standalone project is where development carried on.

FastMCP is Apache-2.0 licensed and maintained by Prefect, the workflow software company, and was created by Jeremiah Lowin; the repository moved from jlowin/fastmcp to PrefectHQ/fastmcp. It has about 28,700 stars and 411 contributors and releases often: version 4.2.4 came out on 21 November 2026, three days after 4.2.2. Prefect sells FastMCP Gateway, a paid enterprise service for running MCP servers across a company, and the README promotes it.

  • Repository: github.com/PrefectHQ/fastmcp
  • Licence: Apache-2.0 (Apache License 2.0)
  • Language: Python. Stars: 28.7K. Forks: 2,634. Last push: Nov 21, 2026.
  • Scan: safe, Nov 21, 2026, commit 5ac27a2

Who it is for

Python developers who want to give an AI assistant access to their own tools, data or APIs, teams building internal MCP servers, and people building agents that call other MCP servers. You need Python 3.11 or later and some coding; the README recommends the uv installer.

Getting started

1. Install from PyPI (Python 3.11 or later), or use uv add fastmcp

pip install fastmcp

2. Save this as my_server.py

from fastmcp import FastMCP

mcp = FastMCP("Demo")

@mcp.tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

if __name__ == "__main__":
    mcp.run()

3. Run it as a local web server on port 8000

fastmcp run my_server.py:mcp --transport http --port 8000

4. Or add it to Claude Desktop

fastmcp install claude-desktop my_server.py

fastmcp install claude-desktop writes your server into Claude Desktop's claude_desktop_config.json, and similar commands exist for Claude Code, Cursor, Gemini CLI and Goose. When a server starts, FastMCP checks pypi.org for a newer version; set FASTMCP_CHECK_FOR_UPDATES=off to stop that. Our scan covers this repository, not the official MCP SDK and other packages pip installs with it.

Safety scan

We cloned PrefectHQ/fastmcp at commit 5ac27a2 on Nov 21, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • 2 secret hits, neither a real key. Both are the text -----BEGIN PRIVATE KEY-----: at tests/server/auth/test_jwt_provider.py line 208, a test checks that a freshly generated key starts with that header, and at .gitleaks.toml line 45, the leak scanner's allowlist names that same test line. No committed binaries across 2,039 files and about 480,600 lines.
  • 1 pattern hit, at fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/environments/uv.py line 121: an error message that suggests uv's official installer (curl -LsSf https://astral.sh/uv/install.sh | sh) when uv is missing. FastMCP only prints it; it never runs it.
  • No install hooks or install scripts. pip install fastmcp pulls fastmcp-slim and the official MCP SDK from PyPI. When a server starts, its banner checks pypi.org for a newer FastMCP at most every 12 hours (FASTMCP_CHECK_FOR_UPDATES=off turns it off) and shows a Deploy free link to Prefect Horizon, Prefect's hosting service.
  • 2 high advisories, both in dnspython 2.8.0 inside examples/testing_demo/uv.lock, an example project. The lockfile for FastMCP itself (uv.lock, 160 packages) and the other lockfiles have none, and there are no critical advisories.
  • Tracing uses OpenTelemetry and records nothing unless you set up an exporter yourself; we found no analytics in the library. The docs site, gofastmcp.com, uses Amplitude analytics. 31 workflows, with all 30 third-party actions pinned to commits. Three use pull_request_target to label pull requests and check issue links; none checks out pull request code, and the AI triage bot gets read-only access with its labels checked against a fixed list. Releases publish to PyPI through trusted publishing after a maintainer approves. Security policy, Renovate, contributing guide and code of conduct present; no CodeQL.

What the scanner counted

CheckResult
Secrets2 candidates found and read; see the notes above.
Suspicious code1 pattern hit found and read; every one is listed under the raw findings.
Install-time codeNone: nothing runs at install beyond the package manager itself.
Committed binariesNone.
CI workflows31 workflows. 3 use pull_request_target, none check out the pull request head. 0 of 30 third-party actions pinned to a tag rather than a commit.
Network hosts40 distinct hosts referenced from source; most often api.example.com, auth.example.com, myserver.com, github.com. No URLs to bare IP addresses.
Known vulnerabilities2 advisories across 324 pinned packages: 0 critical, 2 high, 0 moderate, 0 low. .github/agentic/uv.lock: 112 packages, 0 advisories; examples/smart_home/uv.lock: 90 packages, 0 advisories; examples/testing_demo/uv.lock: 85 packages, 2 advisories; uv.lock: 160 packages, 0 advisories.
Project hygieneHas security policy, automated dependency updates, licence file, contributing guide. Missing CodeQL.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Secret candidates (2, redacted)
WhereRuleMatch
.gitleaks.toml:45private-key-----B…--- (27 chars)
tests/server/auth/test_jwt_provider.py:208private-key-----B…--- (27 chars)
Pattern hits (1)
WhereRuleMatch
fastmcp_slim/fastmcp/utilities/mcp_server_config/v1/environments/uv.py:121download-piped-to-shell"curl -LsSf https://astral.sh/uv/install.sh | sh"
Worst known vulnerabilities (2 of 2)
AdvisorySeverityPackageSummary
GHSA-45c3-73f7-pv4mhighdnspython@2.8.0dnspython dns.name.from_wire_parser() excessive CPU use
GHSA-vvf4-9x63-8xvvhighdnspython@2.8.0dnspython has excessive memory and CPU use
Workflows worth a look

By the numbers

Stars28.7K
Forks2,634
Contributors411
Commits4,614
Open issues171
Open pull requests68
Releases151
Latest releasev4.2.4
LicenceApache-2.0
Main languagePython
Project age1 year
Last pushNov 21, 2026
Tracked files2,039
Lines of code480.6K
Checkout size62 MB

Lines by language: Python 320K, Markdown 141.3K, JSON 6,813, YAML 5,211, JavaScript 3,470, Shell 1,481.

Questions

Is FastMCP free?

Yes. FastMCP is free and open source under the Apache 2.0 licence. Prefect, which maintains it, sells FastMCP Gateway, a paid enterprise service for deploying and managing MCP servers across a company, and the start-up banner links to its Horizon hosting. You need neither to use FastMCP.

Does FastMCP send my data anywhere?

No. Your server runs where you run it. FastMCP asks PyPI whether a newer version exists when a server starts, which you can switch off, and its OpenTelemetry tracing sends nothing unless you configure an exporter.

Is there a TypeScript version?

Yes. The same team maintains FastMCP for TypeScript in a separate repository, PrefectHQ/fastmcp-ts, installed with npm install @prefecthq/fastmcp-ts.

Do I need to know how to code?

Yes. FastMCP is a Python library: you write your tools as Python functions and run them from a terminal. If you only want to use MCP servers others have built, apps like Claude Desktop can add many of them without code.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.