
OpenAPI Services
io.github.alyiox由 GitHub 帳號 alyiox 發布v0.2.1更新於 Oct 24, 2026
MCP server that fronts any OpenAPI service: discover operations from its spec and call them
概覽
一個本機 MCP 伺服器,可對接任意 OpenAPI 服務:從規格中探索操作,並讓助理透過統一的代理呼叫它們。
- 可以做什麼
- 列出已設定的平台、區域、服務與環境,並顯示載入失敗項目的錯誤。依查詢字詞、標籤或方法篩選瀏覽某個服務的操作。檢視單一操作及其所引用結構描述的遞移閉包。執行操作,或呼叫規格中不存在的原始方法與路徑。以 MCP 資源讀取被截斷回應的完整內容與等效的 curl 指令。
- 適用情境
- 當助理需要對接一個或多個有 OpenAPI 文件說明的後端時適用,尤其是同一 API 的多個部署環境,不必為每個服務個別安裝 MCP 伺服器。也適合在呼叫前先瀏覽 API 的操作與結構描述。
- 執行需求
- 以 stdio 在本機執行,需要 Python 3.13+ 與 uv(例如透過 uvx)。需要在 ~/.config/mcp-openapix/config.json 提供設定檔,描述平台、區域、服務與環境,以及每個服務的規格路徑和基礎 URL。需要網路存取以取得規格並呼叫 API。選用的權杖輔助程式是設定中指定的外部指令。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 OpenAPI Services,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-openapix
[CI] [PyPI] [Python 3.13+] [License: MIT]
MCP server that fronts any OpenAPI service behind four generic tools.
An agent finds operations in each deployment's OpenAPI document and calls them; the
server resolves the URL, obtains a bearer token, and builds the request. Discovery is
list_platforms, list_endpoints and describe_endpoint; execution is the generic
proxy call_endpoint.
Requirements
- Python 3.13+ and
uv - A
config.jsondescribing the deployments you hold credentials for
Quick start
Set up your config (see Configuration), then run the server:
Configuration
config.json MUST live at ~/.config/mcp-openapix/config.json
(%USERPROFILE%\.config\… on Windows). config.example.json is a full template.
platforms
A hierarchy of platform → region → services → service → env. Each service declares:
The services object may also contain a token_helper default applying to all services
in that region. A service or environment can override it.
token_helpers
Named token helpers, in the same shape as an MCP server entry:
The config names a command and nothing else, so config.json holds no secrets.
The complete helper invocation and output contract is documented in
docs/token-protocol.md.
Which helper a call uses is resolved most-specific-first:
If no level declares a helper, the deployment is unauthenticated. Omit
token_helper for public deployments.
headers
Constant headers added to every API call — for APIs that require a tenant, product or locale header:
defaults
Makes every tool argument optional: a call falls back to defaults.platform, .region,
.service, .env, .username and .token_helper when they are omitted.
Top-level options
Splitting the config
A stray comma while editing one platform takes down every platform: a parse failure
precedes per-platform validation. The config MAY therefore be split into drop-in files
under config.d/, in the style of an nginx conf.d. The recommended layout keeps
server-wide settings in config.json and gives each platform its own file, named after
it:
A typo then costs one platform, and a platform can be handed over, or removed, as a
single file. Token helpers stay in config.json because they are usually shared across
platforms; a helper only one platform uses MAY live beside it in that platform's file.
The layout is a convention, not a rule:
config.jsonis read first, then every*.jsondirectly inconfig.d/in sorted order. Subdirectories,.bakand editor swap files are ignored; noconfig.d/means no change in behavior.- A drop-in MAY declare anything
config.jsonmay, andconfig.jsonMAY be nearly empty. - Files merge as if pasted into one config in that order: objects merge key by key, and
a later scalar or list replaces the earlier one. A later file can therefore override a
single
envs.prod.urlor onedefaultsfield.
A file that fails to parse costs only what it declares; the rest keep working. A
malformed platform, in any file, MUST NOT stop the others loading, and neither does a
missing token helper it names: its error lists any files that were skipped, since the
helper may be declared in one. list_platforms shows a platform that failed with no
regions and the loader's error, and a skipped file as {"file", "error"}; calling
into a failed platform returns the same message. Defaults that point into a failed
platform are ignored. An invalid setting outside platforms still stops the server, and
the message names the file that set it.
A fix needs a restart. Check the config first, without starting the server; it also lists every value a later file overrode:
Tools
Operation ids
Many OpenAPI documents omit operationId, so the server synthesizes one as "<METHOD> <path>":
Where a spec does declare an operationId, that value wins.
Specs
Specs are not bundled. Each deployment's document is fetched on demand — an
unauthenticated GET — and cached under
~/.cache/mcp-openapix/{platform}/{region}/{service}.json.
A document MUST declare at least one operation before it is installed, so a deployment
answering 200 with an error body cannot replace a working snapshot with one that
serves nothing.
Cached specs refresh in the background: once at startup, then every
spec_refresh.interval days. Set auto to false to stop it; the manual lever still
works:
MCP resources
Both expire response_cache_ttl seconds after the call. The curl command may embed
a short-lived token.
Tokens at rest
Tokens are cached in memory and, when expiry metadata is available, under
~/.cache/mcp-openapix/tokens/ (mode 0600) keyed by the token-helper declaration
and username. This lets client sessions share a login without spawning a helper each.
A 401 retires the cached token so the next call obtains a fresh one. To clear them all:
MCP host examples
Cursor / Claude Code
Codex
Development
All four MUST pass; see AGENTS.md. Tests use
respx to mock HTTP and real subprocesses for
token helpers, so no live API access is required.
License
MIT.
來源:README.md,提交 7f06aab
工具
0版本歷史
4- v0.2.1最新Sep 30, 2026
- v0.2.0Sep 29, 2026
- v0.1.1Sep 28, 2026
- v0.1.0Sep 21, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分