mcp-from-openapi 2.5.1 → 2.6.1

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.5.1",
3
+ "version": "2.6.1",
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,9 +49,9 @@
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"
package/generator.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { OpenAPIDocument, LoadOptions, GenerateOptions, McpOpenAPITool, ValidationResult } from './types';
2
+ import { type LintResult } from './lint';
2
3
  /**
3
4
  * Main class for generating MCP tools from OpenAPI specifications
4
5
  */
@@ -13,7 +14,7 @@ export declare class OpenAPIToolGenerator {
13
14
  /**
14
15
  * Create generator from a URL
15
16
  */
16
- static fromURL(url: string, options?: LoadOptions): Promise<OpenAPIToolGenerator>;
17
+ static fromURL(url: string, rawOptions?: LoadOptions): Promise<OpenAPIToolGenerator>;
17
18
  /**
18
19
  * Create generator from a file path
19
20
  */
@@ -34,6 +35,13 @@ export declare class OpenAPIToolGenerator {
34
35
  * Validate the OpenAPI document
35
36
  */
36
37
  validate(): Promise<ValidationResult>;
38
+ /**
39
+ * Lint the loaded document for agent-readiness (missing operationIds,
40
+ * vague descriptions, unpaginated lists, oversized schemas, ...). Runs
41
+ * after overlays and dereferencing so findings reflect what tools would
42
+ * actually be generated from.
43
+ */
44
+ lint(): Promise<LintResult>;
37
45
  /**
38
46
  * Build $RefParser options based on refResolution configuration.
39
47
  * Defaults: allow http/https, block file://, block internal IPs.
package/index.d.ts CHANGED
@@ -5,9 +5,23 @@ export { ResponseBuilder } from './response-builder';
5
5
  export { Validator } from './validator';
6
6
  export { SecurityResolver, createSecurityContext } from './security-resolver';
7
7
  export { BUILTIN_FORMAT_RESOLVERS, resolveSchemaFormats } from './format-resolver';
8
- export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError } from './errors';
8
+ export { inferAnnotationsFromMethod, extractExtensionOverrides, resolveExtensionEnabled } from './annotations';
9
+ export type { ExtensionToolOverrides } from './annotations';
10
+ export { applyClientTarget, inlineLocalRefs, ensureArrayItems, collapseRootCompositions, collapseNestedUnions, demoteFormats, enforceClosedObjects, requireAllProperties, } from './client-targets';
11
+ export type { ClientTarget } from './client-targets';
12
+ export { buildHttpRequest } from './request-builder';
13
+ export type { BuildHttpRequestOptions, BuiltHttpRequest } from './request-builder';
14
+ export { toSdkTool } from './sdk';
15
+ export type { SdkToolConfig, SdkSchemaWrapper } from './sdk';
16
+ export { estimateToolTokens, analyzeToolSet } from './token-report';
17
+ export type { ToolTokenEstimate, ToolSetReport, AnalyzeToolSetOptions } from './token-report';
18
+ export { applyOverlay } from './overlay';
19
+ export type { OverlayDocument, OverlayAction } from './overlay';
20
+ export { lintDocument } from './lint';
21
+ export type { LintResult, LintFinding, LintSeverity } from './lint';
22
+ export { OpenAPIToolError, LoadError, SsrfError, ParseError, ValidationError, GenerationError, SchemaError, RequestBuildError, OverlayError } from './errors';
9
23
  export { assertUrlSafe, safeFetch, isBlockedAddress, isBlockedHostname, decodeIpv4MappedIpv6, normalizeSsrfOptions, defaultLookup, BLOCKED_HOSTNAMES, } from './ssrf';
10
24
  export type { ResolvedSsrfOptions, ResolvedAddress, SsrfHostLookup, SafeFetchOptions } from './ssrf';
11
- export type { McpOpenAPITool, 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';
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';
12
26
  export type { SecurityContext, ResolvedSecurity, DigestAuthCredentials, ClientCertificate, AWSCredentials, SignatureData, } from './security-resolver';
13
27
  export { isReferenceObject, toJsonSchema } from './types';