openapi-sync-mcp

v6.4.2
io.github.akintomiwa-fisayo/openapi-sync-mcp Checked 1 day ago Published 2 months ago

Type-safe MCP server for OpenAPI Sync to inspect, validate, and synchronize OpenAPI specs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

openapi_sync_validate

Validate the openapi-sync config file and all configured API specs without writing any files to disk. Use this as a pre-flight check before syncing. Supports frozen lockfile verification, snapshot validation, and breaking-change gating.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
failOnBreakingbooleanFail if breaking changes are detected compared to stored snapshot.
folderstringOutput directory for generated files (default: '' project root).
frozenbooleanFail if any spec does not match .openapi-sync/lock.json.
languagestringTarget programming language.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
useSnapshotbooleanValidate against committed .openapi-sync/snapshots/<api>.json.

openapi_sync_list_endpoints

Fetch and parse all configured OpenAPI specs, then return a structured list of every endpoint (name, HTTP method, path, tags, summary). No files are written. Use this to understand the API surface before deciding on a client type or tag filters.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
folderstringOutput directory for generated files (default: '' project root).
languagestringTarget programming language.
limitintegerReturn at most this many endpoints.
offsetintegerSkip this many endpoints before returning results.
outputFolderstringAlias for folder.
pathContainsstringOnly include endpoints whose path contains this substring.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
tagsarrayFilter endpoints to only those with one of these OpenAPI tags.
useCachebooleanReuse previously stored endpoints instead of reloading the spec.

openapi_sync_sync

Run a full openapi-sync — fetches all configured OpenAPI specs and writes TypeScript types, endpoint builder functions, and optional validation schemas (Zod/Yup/Joi) to disk. Returns a SyncResult with the list of files written and any errors. Run this after validating your config.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configFormatstringConfig file format to create when preserving config.
configJsonstringRaw JSON string defining an openapi-sync configuration.
folderstringOutput directory for generated files (default: '' project root).
frozenbooleanFail without writing files if any spec does not match .openapi-sync/lock.json.
languagestringTarget programming language.
outputFolderstringAlias for folder.
preservebooleanAuto-create a config file preserving CLI options after sync succeeds if no config file exists.
presetstringNamed preset to apply automatically.
refetchIntervalnumberAuto-refetch interval in ms. Omit unless you want a long-lived process timer; not for one-shot agent calls.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
useSnapshotbooleanGenerate deterministically from committed .openapi-sync/snapshots/<api>.json.

openapi_sync_get_endpoint_details

Return the full stored endpoint details for one specific endpoint by operationId or name.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
folderstringOutput directory for generated files (default: '' project root).
languagestringTarget programming language.
namestringThe endpoint name to look up.
operationIdstringThe operationId of the endpoint to look up.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.

openapi_sync_read_generated_type

Read the exact generated TypeScript interface or type declaration from the generated types file. Supports optional pagination for large types.

ParameterTypeDescription
typeName *stringThe exported interface or type name to read.
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
folderstringOutput directory for generated files (default: '' project root).
languagestringTarget programming language.
maxLinesnumberMaximum number of lines to return.
offsetnumberStarting line offset (0-indexed) for paginating large type definitions.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.

openapi_sync_doctor

Run diagnostic health checks on openapi.sync configuration, API specs, peer dependencies, cache, and folder permissions. Returns structured health report and actionable recommendations.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
folderstringOutput directory for generated files (default: '' project root).
languagestringTarget programming language.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.

openapi_sync_generate_client

Generate a fully-typed API client for one or all configured APIs. Supports: fetch, axios, react-query, swr, rtk-query, next-fetch. Syncs the latest spec first, then writes client files to disk (unless dryRun: true). Returns a SyncResult with the list of files written.

ParameterTypeDescription
type *stringThe type of API client to generate.
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
baseURLstringBase URL to bake into the generated client (e.g. https://api.example.com). Can be overridden at runtime in the generated code.
baseUrlstringAlias for baseURL.
configJsonstringRaw JSON string defining an openapi-sync configuration.
dryRunbooleanShow what files would be written without writing them.
endpointsarrayOnly generate client methods for these specific endpoint names / operationIds.
folderstringOutput directory for generated files (default: '' project root).
frozenbooleanFail without writing files if any spec does not match .openapi-sync/lock.json.
languagestringTarget programming language.
outputstringOutput directory for generated client.
outputDirstringCustom output directory for the generated client files (alias for output).
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
tagsarrayOnly generate client methods for endpoints with these tags.
useCachebooleanReuse cached endpoints when available instead of reloading specs.
useSnapshotbooleanGenerate client from committed .openapi-sync/snapshots/<api>.json.
verbosebooleanIn dry-run mode, also include full endpoint listing in output.

openapi_sync_purge

Detect and remove generated files that no longer match your current OpenAPI spec. Supports 'yes' to delete files without confirmation or 'dryRun' to preview.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
deleteFilesbooleanAlias for yes.
dryRunbooleanShow which files would be deleted without deleting them.
folderstringOutput directory for generated files (default: '' project root).
languagestringTarget programming language.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
yesbooleanDelete stale files without confirmation prompt.

openapi_sync_init

Create an openapi.sync config file in the current working directory without any interactive prompts. First-class authentication and runSync are supported.

ParameterTypeDescription
apiName *stringA short identifier for this API used as a folder name and config key (e.g. 'petstore', 'my-api'). Letters, numbers, hyphens and underscores only.
apiFilestringDirect path to a local OpenAPI specification file.
apiSourcestringURL to the OpenAPI spec (https://...) or relative path to a local file (e.g. ./api/openapi.yaml).
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
clientTypestringClient type to pre-configure in the config. Omit to skip client generation.
configFormatstringConfig file format (default: typescript).
excludeTagsarrayTags to exclude from generation (e.g. ['deprecated', 'internal']).
folderSplitbooleanOrganize generated files into folders by OpenAPI tags.
outputFolderstringOutput folder for generated files (default: '' project root).
presetstringStarter preset configuring client type, validation library, and conventions in one option.
refetchIntervalnumberAuto-refetch interval in milliseconds (omit to disable).
runSyncbooleanIf true, immediately run a full sync after creating the config file.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
showCurlbooleanInclude cURL examples in generated docs (default: false).
typesPrefixstringPrefix for generated TypeScript interface names (default: 'I', e.g. IPet).
useOperationIdbooleanUse operationId from spec for naming (default: true).
validationLibrarystringValidation library to pre-configure. Omit to skip validation schema generation.

openapi_sync_read_config

Read the current openapi.sync config file from the working directory and return its contents as a string. Useful to inspect what APIs are configured before running sync or generate-client.

openapi_sync_diff

Compare configured OpenAPI specs against their locked .openapi-sync/snapshots/<api>.json baseline (or explicit from/to paths/URLs) and classify breaking vs non-breaking contract changes.

ParameterTypeDescription
apistringAPI specification source (<name>=<url>, direct URL, or name to filter).
apiFilestringDirect local file path to OpenAPI specification.
apiNamestringName for the API (default: 'api').
apiUrlstringDirect URL to OpenAPI specification (JSON or YAML).
authHeaderstringCustom header in 'Key: Value' format (used with authType: custom).
authInstringAPI key location: header or query (used with authType: apiKey).
authNamestringAPI key header or query param name (default: X-API-Key).
authPasswordstringPassword for basic auth.
authTokenstringBearer token or password value / env var reference for auth.
authTypestringSpec authentication type (bearer, basic, apiKey, custom).
authUsernamestringUsername for basic auth.
authValuestringAPI key secret value.
configJsonstringRaw JSON string defining an openapi-sync configuration.
failOnBreakingbooleanReturn success: false when breaking contract changes are detected.
folderstringOutput directory for generated files (default: '' project root).
fromstringOptional baseline OpenAPI spec path or URL (defaults to .openapi-sync/snapshots/<api>.json).
languagestringTarget programming language.
outputFolderstringAlias for folder.
presetstringNamed preset to apply automatically.
serverstringDefault server index or base URL override.
sharedPathsbooleanGroup endpoints by URL path and extract shared path functions and BASE_URL in endpoints.ts.
tostringOptional target OpenAPI spec path or URL (defaults to configured spec source).