@sezzlee/openapi-mcp 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/server.js +12 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MCP server that exposes an OpenAPI (Swagger 2.0 / OpenAPI 3.0–3.2) document as
|
|
|
4
4
|
search-first tool catalog — `search_tools`, `load_tool`, `invoke_tool` — over a **remote**
|
|
5
5
|
backend, calling it with `fetch`.
|
|
6
6
|
|
|
7
|
-
> Status: `0.
|
|
7
|
+
> Status: `0.2.0`, alpha. Install with `npm install -g @sezzlee/openapi-mcp` or run it with
|
|
8
8
|
> `npx -y @sezzlee/openapi-mcp`; the binary is `sezzlee-openapi`.
|
|
9
9
|
|
|
10
10
|
## How this differs from the embedded SDKs
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
3
|
-
import { assertCatalogValid,
|
|
3
|
+
import { assertCatalogValid, checkPinnedVersion, createLoadedTool, defaultSearchLimit, emitGuarded, evaluateVisibility, invokeArgumentsDescription, invokeDescription, invokeVersionDescription, loadDescription, missingArgument, operationNameDescription, searchCatalog, searchDescription, searchDetailDescription, searchLimitDescription, searchQueryDescription, searchTagsDescription, textResult, unknownTool, wrongArgumentType, } from "@sezzlee/core";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { invokeEntry } from "./invoke/invoke.js";
|
|
6
6
|
const { version } = createRequire(import.meta.url)("../package.json");
|
|
@@ -79,7 +79,7 @@ export function createOpenApiMcpServer(gateway, fetcher, limits, options = {}) {
|
|
|
79
79
|
if (entry === undefined || !visible(decision)) {
|
|
80
80
|
return unknownTool(name);
|
|
81
81
|
}
|
|
82
|
-
return textResult(
|
|
82
|
+
return textResult(createLoadedTool(entry.tool, decision), false);
|
|
83
83
|
}));
|
|
84
84
|
server.registerTool("invoke_tool", {
|
|
85
85
|
description: invokeDescription,
|
|
@@ -90,9 +90,14 @@ export function createOpenApiMcpServer(gateway, fetcher, limits, options = {}) {
|
|
|
90
90
|
.unknown()
|
|
91
91
|
.optional()
|
|
92
92
|
.meta({ description: invokeArgumentsDescription }),
|
|
93
|
+
version: z.unknown().optional().meta({
|
|
94
|
+
type: "string",
|
|
95
|
+
description: invokeVersionDescription,
|
|
96
|
+
default: null,
|
|
97
|
+
}),
|
|
93
98
|
})
|
|
94
99
|
.meta({ required: ["name", "arguments"] }),
|
|
95
|
-
}, async ({ name, arguments: args }, ctx) => emitGuarded(budget, async () => {
|
|
100
|
+
}, async ({ name, arguments: args, version: pinned }, ctx) => emitGuarded(budget, async () => {
|
|
96
101
|
if (name === undefined) {
|
|
97
102
|
return missingArgument("invoke_tool", "name");
|
|
98
103
|
}
|
|
@@ -104,6 +109,10 @@ export function createOpenApiMcpServer(gateway, fetcher, limits, options = {}) {
|
|
|
104
109
|
if (entry === undefined) {
|
|
105
110
|
return unknownTool(name);
|
|
106
111
|
}
|
|
112
|
+
const stale = checkPinnedVersion(entry.tool, pinned);
|
|
113
|
+
if (stale !== undefined) {
|
|
114
|
+
return stale;
|
|
115
|
+
}
|
|
107
116
|
const context = ctx;
|
|
108
117
|
const exchanged = context?.http?.authInfo?.extra?.[exchangedTokenKey];
|
|
109
118
|
return invokeEntry(entry, args, fetcher, limits, context?.mcpReq?.signal, typeof exchanged === "string" ? exchanged : undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sezzlee/openapi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server that exposes an OpenAPI document as a search-first sezzlee catalog over a remote backend.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
48
48
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
49
|
-
"@sezzlee/core": "^0.
|
|
50
|
-
"@sezzlee/openapi": "^0.
|
|
49
|
+
"@sezzlee/core": "^0.2.0",
|
|
50
|
+
"@sezzlee/openapi": "^0.2.0",
|
|
51
51
|
"zod": "^4.5.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|