@ivotoby/openapi-mcp-server 1.2.2 → 1.3.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 +3 -1
- package/dist/bundle.js +24 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ The server can be configured through environment variables or command line argum
|
|
|
126
126
|
- `HTTP_HOST` - Host for HTTP transport (default: "127.0.0.1")
|
|
127
127
|
- `ENDPOINT_PATH` - Endpoint path for HTTP transport (default: "/mcp")
|
|
128
128
|
- `TOOLS_MODE` - Tools loading mode: "all" (load all endpoint-based tools) or "dynamic" (load only meta-tools) (default: "all")
|
|
129
|
+
- `DISABLE_ABBREVIATION` - Disable name optimization (this could throw errors when name is > 64 chars)
|
|
129
130
|
|
|
130
131
|
### Command Line Arguments
|
|
131
132
|
|
|
@@ -139,7 +140,8 @@ npx @ivotoby/openapi-mcp-server \
|
|
|
139
140
|
--transport http \
|
|
140
141
|
--port 3000 \
|
|
141
142
|
--host 127.0.0.1 \
|
|
142
|
-
--path /mcp
|
|
143
|
+
--path /mcp \
|
|
144
|
+
--disable-abbreviation true
|
|
143
145
|
```
|
|
144
146
|
|
|
145
147
|
### OpenAPI Schema Processing
|
package/dist/bundle.js
CHANGED
|
@@ -14373,6 +14373,13 @@ var WORD_ABBREVIATIONS = {
|
|
|
14373
14373
|
|
|
14374
14374
|
// src/openapi-loader.ts
|
|
14375
14375
|
var OpenAPISpecLoader = class {
|
|
14376
|
+
/**
|
|
14377
|
+
* Disable name optimization
|
|
14378
|
+
*/
|
|
14379
|
+
disableAbbreviation;
|
|
14380
|
+
constructor(config) {
|
|
14381
|
+
this.disableAbbreviation = config?.disableAbbreviation ?? false;
|
|
14382
|
+
}
|
|
14376
14383
|
/**
|
|
14377
14384
|
* Load an OpenAPI specification from a file path or URL
|
|
14378
14385
|
*/
|
|
@@ -14649,14 +14656,20 @@ var OpenAPISpecLoader = class {
|
|
|
14649
14656
|
return finalName;
|
|
14650
14657
|
}
|
|
14651
14658
|
abbreviateOperationId(originalId, maxLength = 64) {
|
|
14659
|
+
maxLength = this.disableAbbreviation ? Number.MAX_SAFE_INTEGER : maxLength;
|
|
14652
14660
|
const {
|
|
14653
14661
|
currentName: sanitizedName,
|
|
14654
14662
|
originalWasLong,
|
|
14655
14663
|
errorName
|
|
14656
14664
|
} = this._initialSanitizeAndValidate(originalId, maxLength);
|
|
14657
14665
|
if (errorName) return errorName;
|
|
14658
|
-
let processedName
|
|
14659
|
-
|
|
14666
|
+
let processedName;
|
|
14667
|
+
if (this.disableAbbreviation) {
|
|
14668
|
+
processedName = this.splitCombined(sanitizedName).join("-");
|
|
14669
|
+
} else {
|
|
14670
|
+
processedName = this._performSemanticAbbreviation(sanitizedName);
|
|
14671
|
+
processedName = this._applyVowelRemovalIfOverLength(processedName, maxLength);
|
|
14672
|
+
}
|
|
14660
14673
|
processedName = this._truncateAndApplyHashIfNeeded(
|
|
14661
14674
|
processedName,
|
|
14662
14675
|
originalId,
|
|
@@ -14673,7 +14686,9 @@ var ToolsManager = class {
|
|
|
14673
14686
|
constructor(config) {
|
|
14674
14687
|
this.config = config;
|
|
14675
14688
|
this.config.toolsMode = this.config.toolsMode || "all";
|
|
14676
|
-
this.specLoader = new OpenAPISpecLoader(
|
|
14689
|
+
this.specLoader = new OpenAPISpecLoader({
|
|
14690
|
+
disableAbbreviation: this.config.disableAbbreviation
|
|
14691
|
+
});
|
|
14677
14692
|
}
|
|
14678
14693
|
tools = /* @__PURE__ */ new Map();
|
|
14679
14694
|
specLoader;
|
|
@@ -23191,6 +23206,9 @@ function loadConfig() {
|
|
|
23191
23206
|
type: "array",
|
|
23192
23207
|
string: true,
|
|
23193
23208
|
description: "Import only tools for specified HTTP methods (e.g., get, post)"
|
|
23209
|
+
}).option("disable-abbreviation", {
|
|
23210
|
+
type: "boolean",
|
|
23211
|
+
description: "Disable name optimization"
|
|
23194
23212
|
}).help().parseSync();
|
|
23195
23213
|
let transportType;
|
|
23196
23214
|
if (argv.transport === "http" || process.env.TRANSPORT_TYPE === "http") {
|
|
@@ -23203,6 +23221,7 @@ function loadConfig() {
|
|
|
23203
23221
|
const endpointPath = argv.path || process.env.ENDPOINT_PATH || "/mcp";
|
|
23204
23222
|
const apiBaseUrl = argv["api-base-url"] || process.env.API_BASE_URL;
|
|
23205
23223
|
const openApiSpec = argv["openapi-spec"] || process.env.OPENAPI_SPEC_PATH;
|
|
23224
|
+
const disableAbbreviation = argv["disable-abbreviation"] || (process.env.DISABLE_ABBREVIATION ? process.env.DISABLE_ABBREVIATION === "true" : false);
|
|
23206
23225
|
if (!apiBaseUrl) {
|
|
23207
23226
|
throw new Error("API base URL is required (--api-base-url or API_BASE_URL)");
|
|
23208
23227
|
}
|
|
@@ -23224,7 +23243,8 @@ function loadConfig() {
|
|
|
23224
23243
|
includeTags: argv.tag,
|
|
23225
23244
|
includeResources: argv.resource,
|
|
23226
23245
|
includeOperations: argv.operation,
|
|
23227
|
-
toolsMode: argv.tools || process.env.TOOLS_MODE || "all"
|
|
23246
|
+
toolsMode: argv.tools || process.env.TOOLS_MODE || "all",
|
|
23247
|
+
disableAbbreviation: disableAbbreviation ? true : void 0
|
|
23228
23248
|
};
|
|
23229
23249
|
}
|
|
23230
23250
|
|