PrefectHQ/fastmcp

GitHub: PrefectHQ/fastmcp

FastMCP 是一个用 Python 快速构建 MCP 服务器和客户端的框架,解决工具与 LLM 对接的协议复杂性问题。

Stars: 24727 | Forks: 1943

# FastMCP 🚀 Move fast and make things. [![Docs](https://img.shields.io/badge/docs-gofastmcp.com-blue)](https://gofastmcp.com) [![Discord](https://img.shields.io/badge/community-discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/uu8dJCgttd) [![PyPI - Version](https://img.shields.io/pypi/v/fastmcp.svg)](https://pypi.org/project/fastmcp) [![Tests](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/6a6cea0574193616.svg)](https://github.com/PrefectHQ/fastmcp/actions/workflows/run-tests.yml) [![License](https://img.shields.io/github/license/PrefectHQ/fastmcp.svg)](https://github.com/PrefectHQ/fastmcp/blob/main/LICENSE) [模型上下文协议](https://modelcontextprotocol.io/)(MCP)将大型语言模型连接到工具和数据。FastMCP 为您提供从原型到生产所需的一切:使用 Python 函数声明一个工具,模式、验证和文档会自动生成;通过 URL 连接到服务器,传输协商、身份验证和协议生命周期都会为您管理。您只需专注于业务逻辑,MCP 部分即可自动运行:**使用 FastMCP,最佳实践内置于其中。** 这就是为什么 FastMCP 是使用 MCP 的标准框架。FastMCP 1.0 在 2024 年被纳入官方 MCP Python SDK。如今,这个积极维护的独立项目每天被下载一百万次,并且 FastMCP 的某个版本为所有语言中 70% 的 MCP 服务器提供支持。 FastMCP 有三大支柱:
Servers
Servers

Expose tools, resources, and prompts to LLMs.
Apps
Apps

Give your tools interactive UIs rendered directly in the conversation.
Clients
Clients

Connect to any MCP server — local or remote, programmatic or CLI.
**[服务器](https://gofastmcp.com/servers/server)** 将您的 Python 函数封装为符合 MCP 规范的工具、资源和提示。**[客户端](https://gofastmcp.com/clients/client)** 支持完整协议,可连接任意服务器。**[应用](https://gofastmcp.com/apps/overview)** 为您的工具提供直接在对话中渲染的交互式 UI。 准备开始了吗?从[安装指南](https://gofastmcp.com/getting-started/installation)起步,或直接跳转到[快速入门](https://gofastmcp.com/getting-started/quickstart)。准备部署时,[Prefect Horizon](https://www.prefect.io/horizon) 为 FastMCP 用户提供免费托管。 ## 安装 我们推荐使用 [uv](https://docs.astral.sh/uv/) 安装 FastMCP: ``` uv pip install fastmcp ``` 完整的安装说明(包括验证和升级)请参阅[**安装指南**](https://gofastmcp.com/getting-started/installation)。 **升级?** 我们提供了以下指南: - [从 FastMCP v2 升级](https://gofastmcp.com/getting-started/upgrading/from-fastmcp-2) - [从 MCP Python SDK 升级](https://gofastmcp.com/getting-started/upgrading/from-mcp-sdk) - [从底层 SDK 升级](https://gofastmcp.com/getting-started/upgrading/from-low-level-sdk) ## 📚 文档 FastMCP 的完整文档可在 **[gofastmcp.com](https://gofastmcp.com)** 获取,包括详细指南、API 参考和高级模式。 文档也以 [llms.txt 格式](https://llmstxt.org/) 提供,这是一种简单的 Markdown 标准,便于大型语言模型轻松读取: - [`llms.txt`](https://gofastmcp.com/llms.txt) 本质上是一个站点地图,列出文档中的所有页面。 - [`llms-full.txt`](https://gofastmcp.com/llms-full.txt) 包含全部文档。请注意,这可能会超出您所用语言模型的上下文窗口。 **社区:** 加入我们的 [Discord 服务器](https://discord.gg/uu8dJCgttd),与其他 FastMCP 开发者连接并分享您的项目。 ## 贡献 欢迎贡献!请参阅[贡献指南](https://gofastmcp.com/development/contributing)了解安装说明、测试要求和拉取请求指南。
标签:DLL 劫持, FastMCP, GoFastMCP, LLM工具, MCP, Prefect, PyPI, Python开发, Python框架, 大语言模型, 客户端开发, 开源, 快速开发, 文档, 服务器端开发, 模型上下文协议, 测试, 生产级, 社区, 许可证, 逆向工具