mcp-from-openapi 2.6.0 → 2.7.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/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-from-openapi",
3
- "version": "2.6.0",
3
+ "version": "2.7.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",
@@ -49,20 +49,22 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@apidevtools/json-schema-ref-parser": "^15.3.5",
52
+ "@apidevtools/json-schema-ref-parser": "^15.5.1",
53
53
  "openapi-types": "^12.1.3",
54
- "yaml": "^2.8.3"
54
+ "yaml": "^2.9.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "zod": "^4.0.0"
58
58
  },
59
59
  "devDependencies": {
60
+ "@modelcontextprotocol/sdk": "^1.30.0",
60
61
  "@swc/core": "~1.5.7",
61
62
  "@swc/helpers": "^0.5.18",
62
63
  "@swc/jest": "~0.2.38",
63
64
  "@types/jest": "^29.5.0",
64
65
  "@types/json-schema": "^7.0.15",
65
66
  "@types/node": "^24.0.0",
67
+ "ajv": "^8.17.0",
66
68
  "esbuild": "^0.27.2",
67
69
  "jest": "^29.7.0",
68
70
  "tslib": "^2.8.1",
package/generator.d.ts CHANGED
@@ -1,4 +1,19 @@
1
1
  import type { OpenAPIDocument, LoadOptions, GenerateOptions, McpOpenAPITool, ValidationResult } from './types';
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;
2
17
  /**
3
18
  * Main class for generating MCP tools from OpenAPI specifications
4
19
  */
@@ -34,6 +49,13 @@ export declare class OpenAPIToolGenerator {
34
49
  * Validate the OpenAPI document
35
50
  */
36
51
  validate(): Promise<ValidationResult>;
52
+ /**
53
+ * Lint the loaded document for agent-readiness (missing operationIds,
54
+ * vague descriptions, unpaginated lists, oversized schemas, ...). Runs
55
+ * after overlays and dereferencing so findings reflect what tools would
56
+ * actually be generated from.
57
+ */
58
+ lint(): Promise<LintResult>;
37
59
  /**
38
60
  * Build $RefParser options based on refResolution configuration.
39
61
  * Defaults: allow http/https, block file://, block internal IPs.
package/index.d.ts CHANGED
@@ -7,15 +7,31 @@ 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';
13
23
  export type { BuildHttpRequestOptions, BuiltHttpRequest } from './request-builder';
14
24
  export { toSdkTool } from './sdk';
15
25
  export type { SdkToolConfig, SdkSchemaWrapper } from './sdk';
16
- export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError, RequestBuildError } from './errors';
26
+ export { estimateToolTokens, analyzeToolSet } from './token-report';
27
+ export type { ToolTokenEstimate, ToolSetReport, AnalyzeToolSetOptions } from './token-report';
28
+ export { applyOverlay } from './overlay';
29
+ export type { OverlayDocument, OverlayAction } from './overlay';
30
+ export { lintDocument } from './lint';
31
+ export type { LintResult, LintFinding, LintSeverity } from './lint';
32
+ export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError, RequestBuildError, OverlayError, ArazzoError } from './errors';
17
33
  export { assertUrlSafe, safeFetch, isBlockedAddress, isBlockedHostname, decodeIpv4MappedIpv6, normalizeSsrfOptions, defaultLookup, BLOCKED_HOSTNAMES, } from './ssrf';
18
34
  export type { ResolvedSsrfOptions, ResolvedAddress, SsrfHostLookup, SafeFetchOptions } from './ssrf';
19
- export type { McpOpenAPITool, ToolAnnotations, ParameterMapper, ToolMetadata, 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';
20
36
  export type { SecurityContext, ResolvedSecurity, DigestAuthCredentials, ClientCertificate, AWSCredentials, SignatureData, } from './security-resolver';
21
37
  export { isReferenceObject, toJsonSchema } from './types';