Skip to content

feat: support URL for OpenAPI schema source#4

Open
ppspps824 wants to merge 1 commit into
hannesj:masterfrom
ppspps824:feature/yamada/schema-url-support
Open

feat: support URL for OpenAPI schema source#4
ppspps824 wants to merge 1 commit into
hannesj:masterfrom
ppspps824:feature/yamada/schema-url-support

Conversation

@ppspps824

@ppspps824 ppspps824 commented Jan 31, 2026

Copy link
Copy Markdown

Summary

Currently only local paths are supported. This change allows passing a URL as the OpenAPI schema source as well.

Changes

  • If the first argument starts with http:// or https://, it is treated as a URL and passed through to SwaggerParser.
  • Local paths are unchanged: still resolved with path.resolve() and then passed to SwaggerParser.
  • Schema name: prefer info.title; when using a URL, fall back to the filename (without extension) from the URL path.
  • README, help text, and example comments updated with URL usage.

Testing

  • Local: ran node index.mjs sample-petstore.yaml and node example-usage.mjs; behavior is unchanged.
  • URL: ran node index.mjs https://petstore3.swagger.io/api/v3/openapi.json, started the server, and called MCP tools (e.g. list-endpoints); everything worked as expected.

- Accept http(s):// URLs in addition to local file paths
- Pass URL directly to SwaggerParser.validate(); local paths still resolved
- Derive schema name from info.title or URL path when using URL
- Update README, help text, and example with URL usage
@ahoehma

ahoehma commented Feb 13, 2026

Copy link
Copy Markdown

Would it be possible to add support for a full dynamic openapi spec url via chat-context? I mean I would like to have a "neutral" openapi mcp which can just fetch a openapi spec from somewhere and then work with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants