Skip to content

Harden the vendored OpenAPI→MCP fork (license, snapshot test, dead code)#317

Merged
ksinder merged 1 commit into
mainfrom
ksinder-harden-openapi-fork
Jun 17, 2026
Merged

Harden the vendored OpenAPI→MCP fork (license, snapshot test, dead code)#317
ksinder merged 1 commit into
mainfrom
ksinder-harden-openapi-fork

Conversation

@ksinder

@ksinder ksinder commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

src/openapi-mcp-server/ is a vendored fork of snaggle-ai/openapi-mcp-server v1 (MIT). Upstream rewrote v2 into an incompatible API-discovery meta-tool, so there's no upgrade path — we own this code. This PR makes that ownership deliberate and safe instead of incidental (no runtime behavior change).

After researching maintained OpenAPI→MCP libraries (@ivotoby/openapi-mcp-server, openapi-mcp-generator, snaggle v2, the MCP SDK), the conclusion was that none is a clean drop-in: each would force us to re-implement our Notion-specific behavior (the "Notion | " description prefix, double-serialized-param tolerance for #176/#208, read-only/destructive annotations, multipart file uploads, 64-char name truncation) and take on a single-maintainer runtime dependency in the official server. So we keep the converter — and harden it.

What changed

  • License compliance — add the upstream MIT LICENSE (Copyright © 2025 Jan Wilmake) inside the vendored dir. MIT requires the original notice be retained; it had been dropped (only Notion's root LICENSE was present).
  • Regression guardnotion-spec.snapshot.test.ts snapshots the MCP tool surface generated from the real scripts/notion-openapi.json (tool names, HTTP method, descriptions, parameter surface; 22 tools). Any change to the converter — or a future engine swap — now produces a reviewable diff instead of silently shifting the public tool surface.
  • Dead code removal — delete the unused convertToOpenAITools / convertToAnthropicTools (and the now-orphaned convertOperationToJsonSchema helper + FunctionParameters type). These were the only consumers of the openai and @anthropic-ai/sdk devDependencies, which are removed.
  • Docssrc/openapi-mcp-server/README.md now explains why it's forked, what Notion-specific behavior it encodes, and how to change it safely.

How was this change tested?

  • Automated test — new snapshot test (3 cases) + existing suite all green (83 tests); npm run build passes; build artifacts remain gitignored so CI's "no uncommitted changes" check is unaffected.
  • Manual test

🤖 Generated with Claude Code

@ksinder ksinder mentioned this pull request Jun 17, 2026
2 tasks
@ksinder ksinder requested review from hallie and vshen-notion June 17, 2026 21:30
@ksinder ksinder marked this pull request as ready for review June 17, 2026 21:31
The src/openapi-mcp-server/ tree is a vendored fork of snaggle-ai/
openapi-mcp-server v1 (MIT; upstream went an incompatible direction in v2,
so there's no upgrade path). This makes ownership of it deliberate and safe
rather than incidental:

- License compliance: add the upstream MIT LICENSE/copyright (Jan Wilmake)
  in the vendored dir, as the MIT terms require. It was previously dropped.
- Regression guard: snapshot the MCP tool surface generated from the real
  scripts/notion-openapi.json (names, HTTP method, descriptions, params), so
  any future change to the converter — or a swap to a different engine — is
  caught with a reviewable diff.
- Dead code: remove the unused convertToOpenAITools / convertToAnthropicTools
  converters (and the now-orphaned convertOperationToJsonSchema helper and
  FunctionParameters type). This drops the only uses of the `openai` and
  `@anthropic-ai/sdk` devDependencies, which are removed.
- Document why it's forked and how to change it safely.

No runtime behavior change. Build + full test suite pass (83 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ksinder ksinder force-pushed the ksinder-harden-openapi-fork branch from 689c2ac to 5f7fca4 Compare June 17, 2026 21:55
@ksinder ksinder merged commit 10e4530 into main Jun 17, 2026
3 checks passed
@ksinder ksinder deleted the ksinder-harden-openapi-fork branch June 17, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants