Skip to content

About

Reproducible benchmark of six open-source OpenAPI-to-MCP tools on the same specs, mock API and MCP client: schema fidelity, request correctness, auth, protocol support and startup.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

OpenAPI-to-MCP benchmark

A reproducible comparison of open-source tools that turn an OpenAPI description into a Model Context Protocol (MCP) server. Every tool gets the same two specs, the same local mock upstream and the same MCP client, and every result is backed by a raw request log you can read.

Disclosure: this benchmark is written and maintained by Harsha Vardhan, who also maintains openapi-mcp-generator, one of the tools tested. The fairness rules below exist because of that conflict of interest. Corrections and pull requests from other maintainers are welcome.

Results: results/summary.md. Raw data: results/run-1/, results/run-2/.

What it measures

For each tool and each spec:

  • Schema fidelity: does the advertised MCP inputSchema keep what the OpenAPI description says (types, enum, minimum/maximum, oneOf/anyOf/allOf, nullable, readOnly/writeOnly, $ref, required, default, format, header and cookie parameters)?
  • Request correctness: when a tool is called, does the HTTP request that reaches the upstream match the spec (path, query arrays with explode true and false, headers, cookies, JSON body, multipart/form-data, per-operation servers, base path)? The mock's request log is the ground truth.
  • Auth: API key and bearer credentials from configuration, OAuth2 client credentials, credentials scoped to each operation's security, and what happens when no credentials are configured.
  • Protocol support: negotiated protocol version, error shape for an unknown tool, invalid arguments, upstream errors, SDK output validation, a server/discover probe and a streamable HTTP smoke test.
  • Startup: time from process spawn to the first successful tools/list (median of three launches), plus install, generate and build times and sizes in results/setup.json.

Tools and pinned versions

Tool Version Kind How it is launched
openapi-mcp-generator 5.0.1 code generator (TypeScript project) generate stdio project, npm install, npm run build, node build/index.js
FastMCP FastMCP.from_openapi 4.1.3 runtime, general Python MCP framework tools/fastmcp/server.py, the documented quickstart with an httpx2.AsyncClient(base_url=...)
AWS Labs openapi-mcp-server 1.1.6 runtime proxy (Python, built on FastMCP 3.4.11) awslabs.openapi-mcp-server console script (same package uvx runs)
@ivotoby/openapi-mcp-server 1.16.1 runtime proxy (Node) openapi-mcp-server bin
@tyk-technologies/api-to-mcp 0.1.1 (released 2025-06-27) runtime proxy (Node) api-to-mcp --spec ... --targetUrl ...
mcp-openapi (Docat0209) 0.3.0 runtime proxy (Node), optional extra mcp-openapi --spec ... --base-url ...

The harness client is the official MCP Python SDK, mcp 2.3.0 (requirements-harness.txt), which offers protocol 2025-11-25. Versions are pinned in bench/config.py (VERSIONS) and installed exactly.

Earlier version: openapi-mcp-generator 5.0.0 was tested earlier on 24 October 2026. It failed query_array_explode_true (arrays sent comma-joined, tag=red%2Cblue) and cookie_sent (the cookie was never sent). 5.0.1, published later that day, fixes both; multipart_upload still fails. Rerunning on 5.0.1 changed no other check result for any tool.

Not benchmarked: janwilmake/openapi-mcp-server (now a spec-exploration server, a different job), Higress openapi-to-mcpserver (emits gateway configuration, a different category), and commercial products (Speakeasy, Stainless, Zuplo and similar).

Specs

  • Spec A, specs/petstore.json: the real Swagger Petstore 3 description, version 1.0.27, OpenAPI 3.0.4, 19 operations, unmodified.
  • Spec B, specs/fidelity.json: a small purpose-built OpenAPI 3.0.3 description (12 operations) that packs in the features converters most often get wrong: integer with minimum and the 3.0 boolean exclusiveMinimum, enum, oneOf, anyOf, allOf, nullable, readOnly/writeOnly, nested $ref objects, arrays of objects, required, default, format (uuid, date-time), path, query (array with explode true and false), header and cookie parameters, a JSON body, a multipart/form-data upload, a per-operation servers override, apiKey, bearer and OAuth2 client-credentials security, an operation with security: [], a deprecated operation, an operation without operationId, an 85-character operationId, and a JSON response schema.

Spec B is deliberately adversarial. It answers "which edge cases does each tool handle", not "which tool works on a typical API". Spec A is the typical case.

Prerequisites

  • Linux or macOS with GNU make and a POSIX shell.
  • uv. It creates the isolated environments and fetches Python 3.11 (harness) and 3.12 (FastMCP, AWS Labs) if they are not installed. Any Python 3.11 or later on the machine is fine.
  • Node 22.19 or later with npm.
  • Network access during make env and make setup (npm and PyPI installs). Measurement itself only talks to 127.0.0.1; make maintenance needs the GitHub, npm and PyPI APIs.
  • Free local ports: 18765 (mock), 18800 to 18802 (streamable HTTP smoke test), 18860 (ivotoby HTTP probe).

Nothing is installed globally. Every tool lives under tools/ in its own node_modules or .venv.

Run it

make bench          # env, setup, run, probe, report: everything below in order

make bench is safe to rerun from the same checkout; each step replaces its own outputs. Expected duration: about 4 minutes per make bench with warm npm and uv caches (measured on a Linux x86_64 machine), split roughly evenly between setup (installs, three codegen projects) and the two runs. The first run on a fresh machine takes longer while npm and uv fill their caches.

Individual targets:

Target What it does Writes
make env harness venv (.venv, Python 3.11, mcp 2.3.0); reuses an existing .venv .venv/
make setup installs every tool at its pinned version, generates and builds the three openapi-mcp-generator projects, records times and sizes tools/*, results/setup.json
make run two full benchmark passes, every tool and spec against the mock results/run-1/, results/run-2/
make probe evidence probes: raw streamable HTTP exchange with ivotoby, AWS Labs refusing an http spec URL results/evidence/
make report builds the summary from the files above results/summary.md
make maintenance optional, network: GitHub stars, release dates, weekly downloads (GITHUB_TOKEN optional, for rate limits) results/maintenance.json
make clean removes environments, installs, generated projects and scratch

Subsets: .venv/bin/python bench/run.py --out results/dev --tools fastmcp,mcp-openapi --specs fidelity (results/dev/ is gitignored scratch).

Outputs and evidence

results/
  summary.md                  tables, stability across runs, evidence for every non-pass cell
  setup.json                  install/generate/build times, dependency counts, sizes, generated LOC
  maintenance.json            stars, licenses, release dates, weekly downloads
  run-1/, run-2/
    <tool>__<spec>.json       launch config, tools advertised, every call (arguments, result, error),
                              the upstream requests it caused, startup times, and every check with evidence
    mock-requests.jsonl       every request the mock received (method, path, raw query, headers,
                              cookies, content type, body, multipart parts, response status)
    streamable-http.json      streamable HTTP smoke test
    stderr/<tool>__<spec>.log server stderr
    meta.json                 start/finish time, versions
  evidence/                   probe outputs referenced from summary.md

To audit a cell in summary.md, open results/run-1/<tool>__fidelity.json (or __petstore.json), find the check under fidelity or execution, read its evidence, then find the call under calls and the matching upstream request under its mock list.

No machine-specific details are recorded. Every file the harness writes goes through bench/redact.py: paths inside the repository become repo-relative, temporary directories become <tmp>, home directories become <home>, the hostname becomes <host> and the login name <user>. Raw server output is captured in .scratch/ (gitignored) during a run and copied into results/ redacted when the run ends. New writers must use write_json, write_text or redact_file from that module.

How it works

  1. mock/server.py is a deterministic HTTP upstream on 127.0.0.1:18765. It implements Spec B under /v1 (and /alt for the per-operation server), the Petstore paths the harness calls under /api/v3, and an OAuth2 token endpoint. It appends every request to its log before responding. No public API is contacted during measurement.
  2. bench/run.py starts each server over stdio with the MCP Python SDK client and runs:
    • three timed launches (process spawn to first successful tools/list), median reported;
    • one main session: initialize, tools/list, every test case, and a call to an unknown tool;
    • one session with no credentials configured;
    • a server/discover probe for the 2026-07-28 protocol;
    • for tools whose CLI offers OAuth2 client credentials only as a separate global auth mode (mcp-openapi), one extra session for that check. Tool calls are sent with send_request so the SDK's client-side output validation does not hide what the server returned; SDK validation is then run separately and reported as its own check.
  3. bench/checks.py scores schema fidelity from the advertised inputSchema and execution from the mock log. Each check records evidence.
  4. A streamable HTTP smoke test (initialize, list, one call) runs for tools that support that transport and can be started that way cheaply.
  5. bench/report.py writes results/summary.md, including a stability comparison of the two runs.

Test cases are logical (for example "call getItem with itemId 42, header X-Request-Id, cookie session_id"). bench/cases.py maps each to the tool a server exposes (by operationId, truncated operationId or summary) and to that tool's argument names (flattened or nested body, location suffixes). The arguments actually sent are saved with every call.

Scoring

Each check returns a status and the evidence behind it:

  • pass: the schema or the upstream request matches the spec.
  • partial: the behavior is close but loses something, for example oneOf converted to anyOf (exclusivity not enforced), nullable left as an OpenAPI keyword that JSON Schema validators ignore, an explicit null dropped from a body, multipart sent with the wrong parts, or 1 or 2 of the 3 invalid-argument cases rejected.
  • fail: the feature is missing or the request is wrong (or never reached the upstream).
  • n/a: the check does not apply, for example readOnly exclusion when the tool exposes the body as an untyped string.
  • info: descriptive only, not scored (behavior with no credentials configured, which is a design choice).

There is no weighted total. summary.md shows pass, partial and fail counts per tool and spec so readers can weigh the checks they care about.

Fairness rules

  • Every tool runs with its documented quickstart and default settings. Nothing is tuned for the benchmark, including openapi-mcp-generator (no --output-schema, no filters).
  • Same MCP client, same mock upstream, same two specs and same logical test cases for every tool.
  • The only configuration is what each tool needs to reach the mock and to receive credentials through its documented mechanism. All of it is recorded in each result file under launch.config:
    • base URL override pointing at the mock;
    • AWS Labs runs with defaults: its HTTPS/private-network guard applies to specs fetched by URL (make probe records it refusing API_SPEC_URL=http://127.0.0.1/...), and the benchmark passes a local file with API_SPEC_PATH;
    • credentials: per-scheme environment variables (openapi-mcp-generator), static client headers (FastMCP, ivotoby), SECURITY_CREDENTIALS per scheme (Tyk), AUTH_TYPE plus token (AWS Labs, one auth type per server, so it gets the spec's global bearer scheme), --auth-type bearer plus -H X-API-Key (mcp-openapi).
    • For Petstore every tool gets the API key and the same pre-acquired token for petstore_auth (an implicit flow) where its configuration allows.
  • All credentials are fake (bench-api-key, bench-bearer-token, bench-client/bench-secret, bench-petstore-token) and only valid against the local mock.
  • Local pinned installs are used instead of npx/uvx at launch so startup times measure the server, not the package manager. The documented npx/uvx commands run the same package versions.
  • A dropped base path is reported once (base_url_path_kept); other request checks compare paths relative to the base so one bug does not fail unrelated checks. Checks that need a successful response still fail if the request never succeeded.
  • Two full runs; summary.md lists any check whose status differs between them.

Known limitations

  • One spec author, two specs. Spec B was written by the maintainer of one of the tools; it covers features from the OpenAPI 3.0 specification, but the choice of features is still a choice. Spec A is unmodified.
  • Single machine, warm package caches; install and startup times are indicative, not cold-start measurements.
  • The client is the MCP Python SDK. Other clients (desktop apps, IDEs) may differ in name-length limits, schema handling and validation.
  • Tool behavior is tested, not model behavior: no LLM is in the loop, so tool-selection quality and description usefulness are not measured.
  • OAuth2 is tested only for client credentials. Authorization code, device and implicit flows are out of scope.
  • Large-API strategies (dynamic or search tool modes, code execution modes) are not compared.
  • The streamable HTTP smoke test covers only openapi-mcp-generator, FastMCP and ivotoby; the other tools are stdio only or SSE only in the tested versions.
  • FastMCP is a general framework; from_openapi is one feature of it, and its maintainers recommend curated servers over auto-conversion for production.
  • Results apply to the exact versions listed. Rerun before quoting them for later releases.

Adding a tool

  1. Install: add the package to NPM or PY in bench/setup_tools.py (folder under tools/, package name) and its exact version to VERSIONS in bench/config.py.
  2. Launch: add a branch to launch() in bench/config.py that returns the command, arguments, environment and working directory for its documented quickstart, pointing at BASE[spec] and passing the benchmark credentials through the tool's documented mechanism. Support mode="nocreds". Record any configuration in config so it lands in launch.config.
  3. Metadata: add it to ORDER, LABEL, KIND, DOCUMENTED and HTTP_SUPPORT (and HTTP_TESTABLE if it serves streamable HTTP), and to TOOLS in bench/maintenance.py.
  4. Run make setup, then .venv/bin/python bench/run.py --out results/dev --tools <key> and read the result file. If a test case does not map to the tool's names, extend the matching in bench/cases.py rather than special-casing the tool in checks.
  5. Run make bench and open a pull request with the regenerated results/.

Layout

specs/          petstore.json (Spec A), fidelity.json (Spec B)
mock/           server.py (recording upstream)
bench/          config.py (versions, launch config), cases.py, checks.py, run.py, setup_tools.py,
                report.py, maintenance.py, mcpclient.py, redact.py, probe_*.py
tools/          pinned installs (gitignored) plus tools/fastmcp/server.py
results/        setup.json, maintenance.json, run-1/, run-2/, evidence/, summary.md

License

MIT, see LICENSE. The Swagger Petstore description in specs/petstore.json is the upstream Swagger example (Apache 2.0).

About

Reproducible benchmark of six open-source OpenAPI-to-MCP tools on the same specs, mock API and MCP client: schema fidelity, request correctness, auth, protocol support and startup.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages