Skip to content

Add support for the HTTP QUERY method#65

Merged
mattt merged 3 commits into
mainfrom
mattt/query
Jun 29, 2026
Merged

Add support for the HTTP QUERY method#65
mattt merged 3 commits into
mainfrom
mattt/query

Conversation

@mattt

@mattt mattt commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Related to #64

Adds support for the HTTP QUERY method (RFC 10008). OpenAPI 3.2 specifications can use the native query Path Item operation, while older OpenAPI 3.x specifications can use the x-query extension. The operation is parsed as a standard OpenAPI Operation Object, registered as an MCP tool, and annotated as read-only and idempotent.

@mattt mattt changed the title Add support for the HTTP QUERY method Add support for the HTTP QUERY method Jun 29, 2026
@mattt mattt requested a review from Copilot June 29, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for the HTTP QUERY method when registering MCP tools from OpenAPI specs, including OpenAPI 3.2’s native query Path Item operation and a backwards-compatible x-query extension for older OpenAPI 3.x documents.

Changes:

  • Parse and register QUERY operations from Path Items (native query or x-query extension) and mark them read-only + idempotent in tool annotations.
  • Add tests validating tool registration + invocation uses the QUERY method for both native and extension forms.
  • Document QUERY support and add an RFC reference in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
README.md Documents QUERY support and adds RFC 10008 link/reference.
internal/openapi.go Extracts a QUERY operation from the Path Item YAML node / extension and registers it as a tool with safe-method annotations.
internal/openapi_test.go Adds regression tests for native query and x-query extension behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/openapi.go
Comment thread internal/openapi_test.go Outdated
Guard against non-mapping Path Item nodes and avoid a data race in the
QUERY test by passing the observed request over a channel.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@mattt mattt merged commit f4e1be7 into main Jun 29, 2026
2 checks passed
@mattt mattt deleted the mattt/query branch June 29, 2026 13:15
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