mcp-from-openapi 2.6.1 → 2.8.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 +10 -3
- package/annotations.d.ts +16 -1
- package/arazzo-expressions.d.ts +19 -0
- package/arazzo-types.d.ts +262 -0
- package/arazzo.d.ts +45 -0
- package/elicitation.d.ts +44 -0
- package/errors.d.ts +8 -0
- package/esm/index.mjs +1807 -34
- package/esm/package.json +10 -8
- package/generator.d.ts +14 -0
- package/index.d.ts +12 -2
- package/index.js +1815 -34
- package/naming-presets.d.ts +49 -0
- package/package.json +10 -8
- package/ssrf.d.ts +5 -3
- package/type-signature.d.ts +43 -0
- package/types.d.ts +91 -4
- package/validator.d.ts +5 -0
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-from-openapi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Production-ready library for converting OpenAPI specifications into MCP tool definitions",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/agentfront/mcp-from-openapi#readme",
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=22.19.0"
|
|
32
32
|
},
|
|
33
33
|
"type": "module",
|
|
34
34
|
"main": "../index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@apidevtools/json-schema-ref-parser": "^
|
|
52
|
+
"@apidevtools/json-schema-ref-parser": "^16.0.2",
|
|
53
53
|
"openapi-types": "^12.1.3",
|
|
54
54
|
"yaml": "^2.9.0"
|
|
55
55
|
},
|
|
@@ -57,14 +57,16 @@
|
|
|
57
57
|
"zod": "^4.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@
|
|
60
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
61
|
+
"@swc/core": "~1.16.1",
|
|
61
62
|
"@swc/helpers": "^0.5.18",
|
|
62
63
|
"@swc/jest": "~0.2.38",
|
|
63
|
-
"@types/jest": "^
|
|
64
|
+
"@types/jest": "^30.0.0",
|
|
64
65
|
"@types/json-schema": "^7.0.15",
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"@types/node": "^26.4.1",
|
|
67
|
+
"ajv": "^8.17.0",
|
|
68
|
+
"esbuild": "^0.28.2",
|
|
69
|
+
"jest": "^30.5.1",
|
|
68
70
|
"tslib": "^2.8.1",
|
|
69
71
|
"typescript": "^5.0.0",
|
|
70
72
|
"zod": "^4.0.0"
|
package/generator.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { OpenAPIDocument, LoadOptions, GenerateOptions, McpOpenAPITool, ValidationResult } from './types';
|
|
2
2
|
import { type LintResult } from './lint';
|
|
3
|
+
/**
|
|
4
|
+
* 32-bit FNV-1a hash rendered as 8 hex chars. Used for stable, content-derived
|
|
5
|
+
* name suffixes (no Node `crypto` dependency, so V8-isolate runtimes work).
|
|
6
|
+
*/
|
|
7
|
+
export declare function fnv1aHex(input: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Sanitize and cap a tool name per MCP rules: only `[A-Za-z0-9_.-]`, 1-128
|
|
10
|
+
* chars. Invalid characters become underscores (collapsed); names longer than
|
|
11
|
+
* `maxLength` are truncated with a hash suffix derived from the FULL original
|
|
12
|
+
* name, keeping truncated names unique and stable across regenerations.
|
|
13
|
+
* `fallbackSeed` names the operation (method + path) when sanitization leaves
|
|
14
|
+
* nothing usable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeToolName(raw: string, maxLength: number, fallbackSeed: string): string;
|
|
3
17
|
/**
|
|
4
18
|
* Main class for generating MCP tools from OpenAPI specifications
|
|
5
19
|
*/
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ export { SecurityResolver, createSecurityContext } from './security-resolver';
|
|
|
7
7
|
export { BUILTIN_FORMAT_RESOLVERS, resolveSchemaFormats } from './format-resolver';
|
|
8
8
|
export { inferAnnotationsFromMethod, extractExtensionOverrides, resolveExtensionEnabled } from './annotations';
|
|
9
9
|
export type { ExtensionToolOverrides } from './annotations';
|
|
10
|
+
export { emitToolTypeScript, toPascalIdentifier } from './type-signature';
|
|
11
|
+
export type { ToolTypeScriptInfo, TypeSignatureOptions } from './type-signature';
|
|
12
|
+
export { dottedNaming, CODECALL_RESERVED_NAMESPACES } from './naming-presets';
|
|
13
|
+
export type { DottedNamingOptions } from './naming-presets';
|
|
14
|
+
export { deriveSecurityElicitations } from './elicitation';
|
|
15
|
+
export type { SecurityElicitation, ElicitationField } from './elicitation';
|
|
16
|
+
export { fromArazzo } from './arazzo';
|
|
17
|
+
export type { FromArazzoOptions, ArazzoGenerateOptions } from './arazzo';
|
|
18
|
+
export { parseRuntimeExpression } from './arazzo-expressions';
|
|
19
|
+
export type { ArazzoDocument, ArazzoInfo, ArazzoSourceDescription, ArazzoWorkflow, ArazzoStep, ArazzoParameter, ArazzoRequestBody, ArazzoPayloadReplacement, ArazzoCriterion, ArazzoCriterionType, ArazzoSuccessAction, ArazzoFailureAction, ArazzoReusableObject, ArazzoComponents, WorkflowIR, WorkflowStepIR, OperationStepIR, NestedWorkflowStepIR, StepOperationIR, StepParameterIR, StepRequestBodyIR, PayloadExpressionIR, PayloadReplacementIR, CriterionIR, ActionIR, RuntimeExpressionAST, RuntimeExpressionType, ExpressionValueIR, } from './arazzo-types';
|
|
10
20
|
export { applyClientTarget, inlineLocalRefs, ensureArrayItems, collapseRootCompositions, collapseNestedUnions, demoteFormats, enforceClosedObjects, requireAllProperties, } from './client-targets';
|
|
11
21
|
export type { ClientTarget } from './client-targets';
|
|
12
22
|
export { buildHttpRequest } from './request-builder';
|
|
@@ -19,9 +29,9 @@ export { applyOverlay } from './overlay';
|
|
|
19
29
|
export type { OverlayDocument, OverlayAction } from './overlay';
|
|
20
30
|
export { lintDocument } from './lint';
|
|
21
31
|
export type { LintResult, LintFinding, LintSeverity } from './lint';
|
|
22
|
-
export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError, RequestBuildError, OverlayError } from './errors';
|
|
32
|
+
export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError, RequestBuildError, OverlayError, ArazzoError } from './errors';
|
|
23
33
|
export { assertUrlSafe, safeFetch, isBlockedAddress, isBlockedHostname, decodeIpv4MappedIpv6, normalizeSsrfOptions, defaultLookup, BLOCKED_HOSTNAMES, } from './ssrf';
|
|
24
34
|
export type { ResolvedSsrfOptions, ResolvedAddress, SsrfHostLookup, SafeFetchOptions } from './ssrf';
|
|
25
|
-
export type { McpOpenAPITool, ToolAnnotations, ParameterMapper, ToolMetadata, ResponseHints, FrontMcpExtensionData, SerializationInfo, SecurityRequirement, SecurityParameterInfo, ServerInfo, RefResolutionOptions, LoadOptions, GenerateOptions, FormatResolver, JsonSchema, NamingStrategy, OperationWithContext, OpenAPIDocument, OpenAPIVersion, HTTPMethod, ParameterLocation, AuthType, OperationObject, ParameterObject, RequestBodyObject, ResponseObject, ResponsesObject, MediaTypeObject, HeaderObject, ExampleObject, PathItemObject, PathsObject, ServerObject, SecuritySchemeObject, ReferenceObject, TagObject, ExternalDocumentationObject, ServerVariableObject, EncodingObject, SecurityRequirementObject, SchemaObject, ValidationResult, ValidationErrorDetail, ValidationWarning, } from './types';
|
|
35
|
+
export type { McpOpenAPITool, ToolAnnotations, ToolIcon, ParameterMapper, ToolMetadata, ResponseHints, FrontMcpExtensionData, SerializationInfo, SecurityRequirement, SecurityParameterInfo, ServerInfo, RefResolutionOptions, LoadOptions, GenerateOptions, FormatResolver, JsonSchema, NamingStrategy, OperationWithContext, OpenAPIDocument, OpenAPIVersion, HTTPMethod, ParameterLocation, AuthType, OperationObject, ParameterObject, RequestBodyObject, ResponseObject, ResponsesObject, MediaTypeObject, HeaderObject, ExampleObject, PathItemObject, PathsObject, ServerObject, SecuritySchemeObject, ReferenceObject, TagObject, ExternalDocumentationObject, ServerVariableObject, EncodingObject, SecurityRequirementObject, SchemaObject, ValidationResult, ValidationErrorDetail, ValidationWarning, } from './types';
|
|
26
36
|
export type { SecurityContext, ResolvedSecurity, DigestAuthCredentials, ClientCertificate, AWSCredentials, SignatureData, } from './security-resolver';
|
|
27
37
|
export { isReferenceObject, toJsonSchema } from './types';
|