Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 0 additions & 219 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"zod": "3.24.1"
},
"devDependencies": {
"@anthropic-ai/sdk": "^0.33.1",
"@types/express": "^5.0.0",
"@types/js-yaml": "^4.0.9",
"@types/json-schema": "^7.0.15",
Expand All @@ -44,7 +43,6 @@
"@vitest/coverage-v8": "^4.0.18",
"esbuild": "^0.25.2",
"multer": "1.4.5-lts.1",
"openai": "^4.91.1",
"tsx": "^4.19.3",
"typescript": "^5.8.2",
"vitest": "^4.0.18"
Expand Down
29 changes: 29 additions & 0 deletions src/openapi-mcp-server/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
The code in this directory is a vendored fork of v1 of
https://github.com/snaggle-ai/openapi-mcp-server, used under the MIT License.
Its original license and copyright notice are reproduced below, as required by
the MIT License. Modifications made by Notion Labs, Inc. are likewise released
under the MIT License (see the LICENSE file at the repository root).

----------------------------------------------------------------------

MIT License

Copyright (c) 2025 Jan Wilmake

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 34 additions & 2 deletions src/openapi-mcp-server/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
Note: This is a fork from v1 of https://github.com/snaggle-ai/openapi-mcp-server. The library took a different direction with v2 which is not compatible with our development approach.
# openapi-mcp-server (vendored)

Forked to upgrade vulnerable dependencies and easier setup.
This directory converts Notion's OpenAPI spec into MCP tools and executes the
underlying API calls. It is a **vendored fork** of v1 of
[`snaggle-ai/openapi-mcp-server`](https://github.com/snaggle-ai/openapi-mcp-server)
(MIT). See [`LICENSE`](./LICENSE) for the upstream copyright notice.

## Why it's vendored (and why we keep it)

Upstream took a different direction in v2 — it became an API *discovery*
meta-tool and is no longer a one-tool-per-endpoint converter — so there is no
upgrade path. We own this code deliberately. It is small, has no external
runtime dependencies of its own beyond what the server already ships, and
encodes **Notion-specific behavior** that off-the-shelf OpenAPI→MCP libraries do
not reproduce:

- `"Notion | "` prefix on tool descriptions (`parser.ts`, `getDescription`).
- Tolerance for clients that double-serialize nested JSON params: complex
schemas are widened to `anyOf: [schema, string]` (`parser.ts`,
`withStringFallback`) and decoded at call time (`proxy.ts`, `deserializeParams`).
See issues [#176](https://github.com/makenotion/notion-mcp-server/issues/176)
and [#208](https://github.com/makenotion/notion-mcp-server/issues/208).
- `readOnly` / `destructive` tool annotations derived from the HTTP method
(`proxy.ts`).
- Multipart/file-upload operations mapped to local-file-path string params
(`parser.ts` binary handling, `file-upload.ts`).
- 64-char tool-name truncation with a uniqueness suffix (`parser.ts`,
`ensureUniqueName`).

## Changing it safely

`openapi/__tests__/notion-spec.snapshot.test.ts` snapshots the tools generated
from the real `scripts/notion-openapi.json` spec (names, descriptions, parameter
surface). If a change alters the public tool surface, that snapshot will fail —
review the diff and update with `vitest -u` only if the change is intentional.
Loading