跳到主要内容
Supermarket
返回能力市场
MCP Server
programming
MIT

fastapi_mcp

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

tadata-orgtadata-org
75/ 100

公开评测 · 综合采用结论

核心能力可用,建议在受控范围内试用

查看评测依据 评测我的项目基于公开项目证据,非安全认证或安装推荐
12.0kstars
962forks
最近更新 10个月前
评测生成时间(北京时间)
本报告引擎
v3.10.0
当前引擎
v3.16.0

本报告与当前引擎使用不同规则;原分数不会自动更新,不同版本的分数不宜直接对比。

重新评测此项目

进入后确认来源与额度,提交才会创建任务。

Evaluation report

综合采用结论

75
B
满分 100
值得试用低风险
决策摘要

核心能力可用,建议在受控范围内试用

72%
中置信度
80
文档
100
安全
72
质量
30
活跃
68
采用
  • 基础评测完成+25/25确定性评分与静态安全扫描已完成
  • README 有效证据+9/253,573 个去重后的有效字符
  • 独立证据来源+8/202 类非重复证据,重复文件不叠加
  • 仓库元数据+10/10已取得仓库状态与采用数据
  • 活跃记录+5/5已取得最近提交时间
  • AI 复核+15/15已完成结构化 AI 证据复核
How it works · 时序图

FastAPI-MCP挂载与调用流程

README展示了客户端通过MCP服务器调用FastAPI端点,涉及请求和响应,适合sequence图。

AI 提取 · 证据约束

左右滑动查看完整图示

FastAPI-MCP挂载与调用流程README展示了客户端通过MCP服务器调用FastAPI端点,涉及请求和响应,适合sequence图。MCP客户端发起请求MCP服务器处理MCP协议FastAPI应用执行端点调用工具ASGI请求响应返回结果
图示依据
  • • ASGI transport: Communicates directly with your FastAPI app using its ASGI interface
  • • mcp.mount() 挂载MCP服务器
  • • Expose your FastAPI endpoints as MCP tools
五维表现
解决将FastAPI端点暴露为MCP工具的真实需求,支持认证和零配置,价值明确。文档清晰但缺少限制和错误处理说明,示例简单,高级用法依赖外部文档。
质量证据
  • Features: Authentication built in, using your existing FastAPI dependencies
  • Basic Usage: mcp.mount() 后自动生成MCP服务器
  • Installation: uv add fastapi-mcp 或 pip install fastapi-mcp
  • Requirements: Python 3.10+, uv
  • License: MIT License
采用建议
优势
  • 问题与用途描述
  • 有效 README
  • 安装或接入步骤
  • 可执行示例
  • 未发现已知高风险模式
关注点
  • 设计分因边界与失败处理证据缺失,由 13 校准为 12
  • 缺少限制、权限或边界
  • 缺少错误处理或排障
  • 缺少限制、权限或边界说明
  • 缺少错误处理或排障指南
适合

已有FastAPI应用需快速暴露MCP工具、需要利用现有认证依赖的开发者、希望保留API文档和模型的团队、偏好零配置集成的场景

不建议直接用于

需要详细错误处理文档的场景、需要离线或完整文档的环境

也有自己的公开项目?先看完证据,再用当前规则生成独立报告。

评测我的项目 →
文档证据
80/100
问题与用途描述10 分
有效 README12 分
安装或接入步骤14 分
可执行示例16 分
输入、参数或工具说明11 分
输出或结果说明9 分
限制、权限或边界12 分
错误处理或排障8 分
许可证信息5 分
结构化章节3 分
安全证据
低风险
未发现已知高风险模式

静态扫描不是安全保证,生产接入前仍应人工复核权限和数据边界。

优先改进清单
  1. 01补充限制、权限或边界
  2. 02补充错误处理或排障
方法、证据与局限展开
数据来源

GitHub Repository API

扫描范围

2 个文件 · 6,717 字符

评测引擎

v3.10.0 · AI 复核已启用(deepseek-chat)

局限
  • 静态评测不会安装或执行项目代码
  • 安全扫描基于高信号文件与已知模式,不能替代人工审计
  • 流行度只反映采用程度,不代表安全或工程质量

30 天热度趋势

README

fastapi-to-mcp

Built by Tadata

FastAPI-MCP

tadata-org%2Ffastapi_mcp | Trendshift

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

PyPI version Python Versions FastAPI CI Coverage

fastapi-mcp-usage

Features

  • Authentication built in, using your existing FastAPI dependencies!

  • FastAPI-native: Not just another OpenAPI -> MCP converter

  • Zero/Minimal configuration required - just point it at your FastAPI app and it works

  • Preserving schemas of your request models and response models

  • Preserve documentation of all your endpoints, just as it is in Swagger

  • Flexible deployment - Mount your MCP server to the same app, or deploy separately

  • ASGI transport - Uses FastAPI's ASGI interface directly for efficient communication

Hosted Solution

If you prefer a managed hosted solution check out tadata.com.

Installation

We recommend using uv, a fast Python package installer:

uv add fastapi-mcp

Alternatively, you can install with pip:

pip install fastapi-mcp

Basic Usage

The simplest way to use FastAPI-MCP is to add an MCP server directly to your FastAPI application:

from fastapi import FastAPI
from fastapi_mcp import FastApiMCP

app = FastAPI()

mcp = FastApiMCP(app)

# Mount the MCP server directly to your FastAPI app
mcp.mount()

That's it! Your auto-generated MCP server is now available at https://app.base.url/mcp.

Documentation, Examples and Advanced Usage

FastAPI-MCP provides comprehensive documentation. Additionaly, check out the examples directory for code samples demonstrating these features in action.

FastAPI-first Approach

FastAPI-MCP is designed as a native extension of FastAPI, not just a converter that generates MCP tools from your API. This approach offers several key advantages:

  • Native dependencies: Secure your MCP endpoints using familiar FastAPI Depends() for authentication and authorization

  • ASGI transport: Communicates directly with your FastAPI app using its ASGI interface, eliminating the need for HTTP calls from the MCP to your API

  • Unified infrastructure: Your FastAPI app doesn't need to run separately from the MCP server (though separate deployment is also supported)

This design philosophy ensures minimum friction when adding MCP capabilities to your existing FastAPI services.

Development and Contributing

Thank you for considering contributing to FastAPI-MCP! We encourage the community to post Issues and create Pull Requests.

Before you get started, please see our Contribution Guide.

Community

Join MCParty Slack community to connect with other MCP enthusiasts, ask questions, and share your experiences with FastAPI-MCP.

Requirements

  • Python 3.10+ (Recommended 3.12)
  • uv

License

MIT License. Copyright (c) 2025 Tadata Inc.