Skip to content

fix(amazonq): check and pin the OAuth endpoints of remote MCP servers - #3071

Draft
laileni-aws wants to merge 2 commits into
Amazon-Q-Developer:feature/laileni-fixesfrom
laileni-aws:fix/mcp-oauth-endpoints
Draft

laileni-aws wants to merge 2 commits into
Amazon-Q-Developer:feature/laileni-fixesfrom
laileni-aws:fix/mcp-oauth-endpoints

Conversation

@laileni-aws

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.76190% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...age-server/agenticChat/tools/mcp/mcpOauthClient.ts 94.76% 17 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@laileni-aws
laileni-aws force-pushed the fix/mcp-oauth-endpoints branch 2 times, most recently from 93bc4da to 4254b77 Compare November 17, 2026 18:43
The OAuth client for remote MCP servers now checks each URL that it sends a request to during
discovery, registration and sign-in, and each discovery redirect: https, or http on a loopback
address, and an address in the scope of the MCP server. The authorization endpoint that the
browser opens must be https, or http on a loopback address. A sign-in pins its token endpoint.
A refresh uses only the pinned token endpoint, with the client registration and the token that
it issued, and keeps the current refresh token when the response has none. A token saved before
this change has no pinned endpoint, so the user signs in once in the browser. A client
registration is saved only after a sign-in with it succeeds.

Adds tests.
…h client

Adds back the test that a loopback http authorization endpoint opens in the external browser. Adds
a command URI and text that is not a URL to the authorization endpoints that must be refused, uses
a public host name in the http resource_metadata test, and checks the authorization code and the
sign-in error of two tests.
@laileni-aws
laileni-aws changed the base branch from feature/security-fixes-v2 to feature/laileni-fixes November 18, 2026 20:38
@laileni-aws
laileni-aws force-pushed the fix/mcp-oauth-endpoints branch from f8b1ea0 to d1d5acc Compare November 18, 2026 20:38
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