Add multi-spec serving: repeatable --spec with deterministic name prefixes - #42
Merged
Conversation
…fixes --spec now accepts [name=]path and can be given multiple times. With one spec, behavior is unchanged (bare operationIds). With several, each tool is prefixed with the spec's explicit name or file basename, so names are deterministic and allow/deny patterns keep working; residual collisions get a numeric suffix. Compile caches are per spec (cachePath.name), --watch-spec watches every file, --server-url and generate require a single spec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqBsGC7xLvihtBxhCdWKz5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One server can now front several OpenAPI documents:
mcp-openapi --spec github=./github.yaml --spec linear=./linear.yaml # tools: github_listIssues, linear_createIssue, ...Rules, all covered by tests:
--spec: identical behavior to before — bare operationIds, same cache path.name=or file basename, normalized). Prefixing is unconditional rather than collision-triggered so tool names never depend on what other specs are loaded —--allow-tools/--deny-toolspatterns stay stable.sample-openapi_getHealth_2).<cache-path>.<name>);--watch-specwatches all files and recompiles the merged set.--server-urlwith multiple specs is a hard error (upstream URLs come from each spec'sservers[]);generaterequires exactly one spec.Tests: 5 new (47 total) — prefix determinism, basename fallback + suffixing, single-spec unchanged,
--server-urlrejection, and a stdio e2e that lists and callsbeta_getHealthacross two loaded specs.🤖 Generated with Claude Code
https://claude.ai/code/session_01LqBsGC7xLvihtBxhCdWKz5