MM

matthewhand/mcp-openapi-proxy

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

157 stars 40 forks 质量 85 趋势 14MIT

matthewhand/mcp-openapi-proxy 是从 https://github.com/matthewhand/mcp-openapi-proxy. 导入的 MCP 服务器候选

概览

matthewhand/mcp-openapi-proxy 是从 https://github.com/matthewhand/mcp-openapi-proxy. 导入的 MCP 服务器候选

概述(AI 翻译)

mcp-openapi-proxy 是一个 Python 包,实现了一个模型上下文协议(MCP)服务器,旨在动态地将 REST API——由 OpenAPI 规范定义——作为 MCP 工具。这促进了 OpenAPI 描述的 API 无缝集成到基于 MCP 的工作流中。

v0.4.0 — 标签日期:2026年9月6日;GitHub 发布于2026年10月15日(AEDT): MCP SDK 2.x / 协议 2026-07-28,原生无状态可流式 HTTP 和遗留标准支持。

0.4.0 的新内容

MCP 2026-07-28(SDK 2.x)。 代理是双栈:现代客户端发送 自包含请求(无initialize,无Mcp-Session-Id)及列表结果 携带 ttlMs / cacheScope。仍保持握手的遗留标准客户端 正在运行。原生可流媒体HTTP支持MCP_TRANSPORT=streamable-http 并且是无状态的——轮询负载均衡不需要粘性会话。

关于新更新的破坏性变更,请参见docs/MIGRATION-0.4.md 环境变量和Gateway Cutover笔记。0.3.4仍是最后一个版本。 mcp 1.x('mcp>=1.2.0,📄完整说明:验证案例研究——代理是什么,API + 客户端矩阵,以及发现和修复的每一个缺陷。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mcp-openapi-proxy

mcp-openapi-proxy is a Python package that implements a Model Context Protocol (MCP) server, designed to dynamically expose REST APIs—defined by OpenAPI specifications—as MCP tools. This facilitates seamless integration of OpenAPI-described APIs into MCP-based workflows.

v0.4.0 — tagged September 6, 2026; GitHub Release published October 15, 2026 (AEDT): MCP SDK 2.x / protocol 2026-07-28, with native stateless Streamable HTTP and legacy stdio support.

What’s New in 0.4.0

MCP 2026-07-28 (SDK 2.x). The proxy is dual-stack: modern clients send self-contained requests (no initialize, no Mcp-Session-Id) and list results carry ttlMs / cacheScope. Legacy stdio clients that still handshake keep working. Native Streamable HTTP is available with MCP_TRANSPORT=streamable-http and is stateless — round-robin load balancing needs no sticky sessions.

See docs/MIGRATION-0.4.md for breaking changes, new env vars, and gateway cutover notes. 0.3.4 remains the last release on mcp 1.x (mcp>=1.2.0,<2).

What’s New in 0.2.0

Works with every modern MCP-enabled client we tested. Strict MCP clients can now discover and call tools — the low-level server advertises correct capabilities and no longer crashes during resource/prompt discovery, and a slow spec download no longer crash-loops short-timeout clients. Verified live against the full list of mainstream agent CLIs:

  • ✅ Codex, Gemini, Qwen, Kilocode, opencode — native tool calls over stdio
  • ✅ Vibe — native discovery and read calls (writes were CLI-flaky, not a proxy issue)
  • ✅ Letta — Cloud (via a remote streamable-HTTP MCP URL) and self-hosted (via stdio)

See the client matrix for attach mechanisms, models, and exact results.

📄 Full write-up: Verification case study — what the proxy is, the API + client matrices, and every defect found & fixed.

Prompts and resources are real now — including custom resources. Both MCP surfaces are functional and tested: the summarize_spec / whimsical_blog prompts and the spec_file resource, plus a new ADDITIONAL_RESOURCES env var that serves your own use-case documents (e.g. a NetBox naming policy or an Asana project-layout guide) as MCP resources — see examples/resources/.

Bug fixes (every one live-verified):

  • MCP client discovery: empty capability set + a crash in resource discovery left strict clients seeing zero tools (#23) — fixed, with a full stdio-handshake test harness.
  • IGNORE_SSL_TOOLS was ignored by the low-level dispatcher (#14) — fixed (original patch by @robbycochran, #15).
在 GitHub 查看完整 README

安装

uvx mcp-openapi-proxy
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-openapi-proxy": { "command": "uvx", "args": ["mcp-openapi-proxy"], "env": { "OPENAPI_SPEC_URL": "${OPENAPI_SPEC_URL}", "API_KEY": "${API_OPENAPI_KEY}" } } } }