
fieldflow
by guillaumegay13·★ 111·综合分 47
FieldFlow 将 OpenAPI 端点转换为可选择过滤的工具,支持 MCP 协议,可与 Claude Desktop 等 AI 客户端集成。
概述
FieldFlow 是一个基于 Python 的工具,它将 OpenAPI 描述的 REST 端点转换为可选择过滤的工具。它动态生成 Pydantic 模型和 FastAPI 路由,将请求代理到上游 API,同时只返回调用者指定的字段。该项目提供 HTTP 服务器和 MCP 服务器两种模式,后者通过模型上下文协议 (MCP) 暴露 OpenAPI 工具。它支持身份验证方案、JSONPath 类语法的嵌套字段选择,并包含用于减少嘈杂 JSON 输出的 CLI 工具。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当处理 OpenAPI 兼容的 API 并需要精确字段选择以最小化 LLM 交互中的令牌使用时,选择 FieldFlow。
什么时候不要选它
如果您需要写操作或直接数据库访问,不要选择 FieldFlow,因为它仅提供只读的 API 代理功能。
此 server 暴露的工具
从 README 抽取出 5 个工具get_user_infoFetch user information from JSONPlaceholder API with field selection
list_postsList posts for a user from JSONPlaceholder API with field selection
pokemon_readRetrieve Pokemon information from PokeAPI with nested field selection
ability_listList Pokemon abilities from PokeAPI with field selection
ability_readRead a specific Pokemon ability by ID from PokeAPI
说明:Tools are derived from OpenAPI specs and exposed through MCP server. Example tool calls shown in README demonstrate the field selection functionality.
可对比工具
安装
# 安装 MCP 支持
pip install -e '.[mcp]'
# 运行 HTTP 服务器
fieldflow serve-http
# 运行 MCP 服务器(用于 Claude Desktop)
fieldflow-mcp对于 Claude Desktop 集成,添加到配置文件:
{
"mcpServers": {
"fieldflow": {
"command": "python",
"args": ["-m", "fieldflow_mcp.cli"]
}
}
}FAQ
- FieldFlow 支持哪些认证方法?
- FieldFlow 支持 Bearer 令牌(OAuth 2.0、JWT)、API 密钥、基本身份验证,以及自动处理 OpenAPI 定义的安全方案。
- FieldFlow 如何减少响应负载?
- FieldFlow 接受请求中的 'fields' 参数,允许选择特定数据字段。它使用 JSONPath 类语法来选择嵌套字段和数组,仅返回请求的数据。
Hacker News 讨论
开发者社区最近的相关讨论。
- 帖子 by ggay · 2025-09-23
fieldflow 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。