FastAPI-native package that exposes FastAPI endpoints as Model Context Protocol tools while preserving schemas, docs, and existing authentication dependencies.
FastAPI-MCP can expose real API operations as tools; do not blindly expose admin, destructive, payment, credential, or production-write endpoints., Preserve and test FastAPI authentication dependencies before letting agents call protected tools., Review request models, side effects, rate limits, and authorization boundaries for each endpoint., Prefer explicit allowlists and non-production deployments for early MCP testing.
Privacy notes
Request schemas, response schemas, OpenAPI docs, route names, validation errors, and endpoint outputs may be visible to the MCP client and model., Endpoint calls can expose user data, internal identifiers, tokens in payloads, and business logic., Keep API credentials, service secrets, and test-user tokens out of prompts, repository files, and logs.
Author
Tadata
Submitted by
oktofeesh1
Claim status
unclaimed
Last verified
2026-06-05
Decision playbook
Review trust signals before you adopt
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
Compare context
Selected
0
Current score
63
Baseline
—
Delta
No baseline selected
No major trust-signal divergence detected in the current selection.
Source and provenance checks
Needs review
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Done
Source provenance statusRequired
Marked as source-backed.
Done
Metadata reviewed
No reviewed flag detected in metadata.
Pending
Safety and privacy checks
Complete
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Done
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Done
Trust level risk gateRequired
Trust level does not block evaluation.
Done
Package and install checks
Needs review
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Done
Package verification flag
No package verification flag provided.
Pending
Checksum metadata
No checksum provided for downloaded artifact.
Pending
Compare-driven decision checks
Needs review
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
4 safety and 3 privacy notes across 4 risk areas. Review closely: credentials & tokens, permissions & scopes, network access.
4 areas
SafetyCredentials & tokensFastAPI-MCP can expose real API operations as tools; do not blindly expose admin, destructive, payment, credential, or production-write endpoints.
SafetyGeneralPreserve and test FastAPI authentication dependencies before letting agents call protected tools.
SafetyPermissions & scopesReview request models, side effects, rate limits, and authorization boundaries for each endpoint.
SafetyGeneralPrefer explicit allowlists and non-production deployments for early MCP testing.
PrivacyNetwork accessRequest schemas, response schemas, OpenAPI docs, route names, validation errors, and endpoint outputs may be visible to the MCP client and model.
PrivacyCredentials & tokensEndpoint calls can expose user data, internal identifiers, tokens in payloads, and business logic.
PrivacyCredentials & tokensKeep API credentials, service secrets, and test-user tokens out of prompts, repository files, and logs.
Safety notes
FastAPI-MCP can expose real API operations as tools; do not blindly expose admin, destructive, payment, credential, or production-write endpoints.
Preserve and test FastAPI authentication dependencies before letting agents call protected tools.
Review request models, side effects, rate limits, and authorization boundaries for each endpoint.
Prefer explicit allowlists and non-production deployments for early MCP testing.
Privacy notes
Request schemas, response schemas, OpenAPI docs, route names, validation errors, and endpoint outputs may be visible to the MCP client and model.
Endpoint calls can expose user data, internal identifiers, tokens in payloads, and business logic.
Keep API credentials, service secrets, and test-user tokens out of prompts, repository files, and logs.
Prerequisites
Python 3.10 or newer, with Python 3.12 recommended by the project.
Existing FastAPI application or a reviewed FastAPI service design.
uv or pip for installing fastapi-mcp.
Clear endpoint allowlist and authentication policy before exposing API operations to an agent.
MCP client that can connect to the mounted or separately deployed MCP endpoint.
Schema details
Install type
cli
Troubleshooting
No
Source repository stats
Scope
Source repo
Collection metadata
Estimated setup
15 minutes
Difficulty
intermediate
Full copyable content
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount_http()
About this resource
Content
FastAPI-MCP is a FastAPI-native package for exposing FastAPI endpoints as MCP
tools. It preserves request and response schemas, endpoint documentation, and
FastAPI dependency-based authentication patterns instead of treating an API only
as a generic OpenAPI document.
The simplest documented pattern mounts an HTTP MCP server directly into a
FastAPI app so the MCP endpoint becomes available from the application at
/mcp.
These sources were reviewed on 2026-06-07. Prefer live documentation for
current installation, mounting, deployment, authentication, and endpoint
selection options.
Features
Expose FastAPI endpoints as MCP tools.
Preserve request models, response models, and route documentation.
Use existing FastAPI dependencies for authentication and authorization.
Mount the MCP server into the same app or deploy it separately.
Use ASGI transport directly with the FastAPI app.
Add MCP support with minimal code for existing services.
Installation
Install with uv:
uv add fastapi-mcp
Or install with pip:
pip install fastapi-mcp
Basic FastAPI integration:
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount_http()
When the app runs on port 8000, the generated Streamable HTTP MCP endpoint is
available at http://localhost:8000/mcp.
Give an internal agent controlled access to selected FastAPI operations.
Add MCP tooling to a FastAPI backend without writing a custom MCP server.
Preserve existing Pydantic schema descriptions as tool context.
Reuse FastAPI authentication dependencies for protected MCP tools.
Test an API as agent-callable tools in staging before production rollout.
Safety and Privacy
Treat FastAPI-MCP as a way to expose live API capabilities, not just docs. Review
which endpoints become tools, preserve authentication, and block destructive or
sensitive operations unless they are explicitly intended for agent use.
Endpoint schemas, payloads, validation errors, and responses may reveal internal
data models or user data. Use redacted test data and non-production environments
when experimenting.
Duplicate Check
Existing entries include generic OpenAPI and API tooling, but no
tadata-org/fastapi_mcp entry was found in content/mcp. This entry is for
the FastAPI-native MCP framework package and uses the documented local
Streamable HTTP endpoint.
Show that FastAPI-MCP Server is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/mcp/fastapi-mcp)
How it compares
FastAPI-MCP Server side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
3 trust signals differ across this comparison (Package trust, Source provenance, Submitter).
FastAPI-native package that exposes FastAPI endpoints as Model Context Protocol tools while preserving schemas, docs, and existing authentication dependencies.
Django extension that exposes MCP endpoints and stdio transport for Django apps, with declarative model query tools, custom toolsets, DRF create/list/ update/delete tool publishing, serializer output, and MCP inspection.
The official SingleStore MCP server (singlestore-mcp-server) that lets AI assistants manage SingleStore from natural language — running SQL on a workspace, inspecting organizations, workspace groups, and workspaces, managing starter workspaces, notebooks, scheduled jobs, and Stage files — with no API keys required thanks to browser-based OAuth.
Configure MCP servers in the Claude Desktop app by editing claude_desktop_config.json. Grounded walkthrough covering config file locations, the mcpServers JSON structure, the filesystem server, and how to verify and troubleshoot the connection.
✓FastAPI-MCP can expose real API operations as tools; do not blindly expose admin, destructive, payment, credential, or production-write endpoints.
Preserve and test FastAPI authentication dependencies before letting agents call protected tools.
Review request models, side effects, rate limits, and authorization boundaries for each endpoint.
Prefer explicit allowlists and non-production deployments for early MCP testing.
✓Django MCP Server can expose Django model querysets, custom Python methods, DRF create/list/update/delete views, serializers, resources, and low-level FastMCP tools to an MCP client.
Published DRF create, update, and delete tools can mutate application data if their serializers, views, and authentication rules permit it.
The README notes that built-in DRF authentication classes, permission classes, filter backends, and pagination are disabled for published DRF tools in favor of MCP authentication; review this carefully before reusing production views.
Query tools can evaluate QuerySets and return database records; restrict queryset scope and fields before exposing sensitive models.
Require confirmation and application-level authorization before exposing write tools, email-sending methods, admin-like actions, or tools that touch customer, employee, financial, health, or regulated data.
✓The `run_sql` tool executes SQL against a connected workspace with the authenticated user's permissions, so it can read and modify data; scope the SingleStore account/role to least privilege.
Workspace and job tools can create and terminate starter workspaces and create or delete scheduled jobs (`create_starter_workspace`, `terminate_starter_workspace`, `create_job_from_notebook`, `delete_job`), which affect real cloud resources and billing.
Stage tools can upload, move, and delete files in a deployment's Stage file system (`stage_upload_file`, `stage_move`, `stage_delete`); treat them as write/delete-capable.
Authentication is the boundary — the standard flow stores browser-OAuth session credentials, and the Docker flow uses a Management API key, so restrict what the authenticated identity can reach.
Point the server at a non-production organization or a least-privilege identity when letting an agent act autonomously.
✓Local MCP servers run as processes on your machine with your user account's privileges, so they can perform any file or system operation you can. Only add servers you trust, and restrict filesystem server paths to the minimum directories the workflow needs.
Each Claude Desktop tool call (file write, delete, move) requires your explicit approval before it executes; review every request before approving.
Privacy notes
✓Request schemas, response schemas, OpenAPI docs, route names, validation errors, and endpoint outputs may be visible to the MCP client and model.
Endpoint calls can expose user data, internal identifiers, tokens in payloads, and business logic.
Keep API credentials, service secrets, and test-user tokens out of prompts, repository files, and logs.
✓Django sessions, request headers, model names, field names, primary keys, QuerySet results, serializer output, DRF request bodies, custom tool arguments, and tool responses can be exposed to the MCP client.
Exposed models may contain user accounts, permissions, customer records, orders, messages, files, logs, internal notes, audit trails, or application-specific secrets.
Remote streamable HTTP deployments can move application data outside the original Django UI and audit path if MCP auth, OAuth metadata, and retention are not configured correctly.
Stdio usage can still expose data through local MCP client logs, transcripts, and tool traces.
Keep MCP endpoint access, serializer fields, queryset filters, and tool docstrings intentionally narrow for each app.
✓The server connects to your SingleStore account and workspaces; user and organization details, SQL results, notebook contents, and Stage files it returns are passed to the LLM/MCP client.
SQL query results can include sensitive or PII data stored in your databases, and organization/workspace metadata can reveal infrastructure details.
OAuth session credentials (standard setup) or the `MCP_API_KEY` (Docker) grant account access — keep client config out of version control and restrict access to it.
Notebook and Stage tools can read and write files in SingleStore Spaces/Stage; treat that stored content as retained data.
✓Configured servers receive the prompts, file contents, and directory data needed to run their tools, and may store credentials (API keys, tokens) passed through the env block.
The claude_desktop_config.json file holds server commands, file paths, and environment-variable names; keep it private and do not commit it to public repositories.
Prerequisites
Python 3.10 or newer, with Python 3.12 recommended by the project.
Existing FastAPI application or a reviewed FastAPI service design.
uv or pip for installing fastapi-mcp.
Clear endpoint allowlist and authentication policy before exposing API operations to an agent.
Django 4 or 5 application with Python 3.10 or newer.
mcp_server added to INSTALLED_APPS and mcp_server.urls included in the Django URL configuration.
Review of which Django models, querysets, custom methods, DRF views, serializers, and request context should be exposed to MCP clients.
Authentication classes configured through DJANGO_MCP_AUTHENTICATION_CLASSES before exposing non-public data over streamable HTTP.
Python 3.10 or newer and the `uv`/`uvx` package manager (or `pip install singlestore-mcp-server`)
A SingleStore account; the standard setup signs in through browser-based OAuth on first start
For Docker runs only, a SingleStore Management API key (`MCP_API_KEY`), since the OAuth flow is not supported inside containers
An MCP-compatible client (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini, etc.)
Claude Desktop installed and running (macOS, Windows, or Linux)