mcp-openapi-schema-explorer
Version:
MCP OpenAPI schema explorer
19 lines • 744 B
JavaScript
/**
* Configuration management for the OpenAPI Explorer MCP server
*/
/** Load server configuration from command line arguments */
export function loadConfig(specPath, options) {
if (!specPath) {
throw new Error('OpenAPI spec path is required. Usage: npx mcp-openapi-schema-explorer <path-to-spec> [--output-format json|yaml]');
}
const format = options?.outputFormat || 'json';
if (format !== 'json' && format !== 'yaml' && format !== 'json-minified') {
throw new Error('Invalid output format. Supported formats: json, yaml, json-minified');
}
return {
specPath,
// Cast is safe here due to the validation above
outputFormat: format,
};
}
//# sourceMappingURL=config.js.map