Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

auth: Authorize fails against a 2025-03-26 server whose URL has a query string

オープン
#1,347 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@akshita317 がすでに取り組んでいます。

2026年10月6日 から。

  • #1348 @akshita317 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Start at getProtectedResourceMetadata, where the fallback base URL is built by clearing u.Path on the parsed server URL; scheme and authority only are needed (also clear Query and Fragment) so the issuer passed to GetAuthServerMeta matches the RFC 8414 metadata issuer, and so default /authorize and /token endpoints concatenate cleanly. Leave the well-known protected-resource-metadata URL construction alone (RFC 9728 keeps the query there). Note that PR #1348 already implements this fix, so the work is under way — use it as reference rather than a starting point.

索引モデルが issue の本文から書いたものです。

説明

What did you do?

Used AuthorizationCodeHandler with an MCP server that publishes no protected resource metadata (so the handler falls back to the 2025-03-26 rule: the authorization base URL is the MCP server URL with its path discarded) and serves authorization server metadata at its root. The client reaches the server through a URL with a query string:

https://api.example.com/mcp?tenant=acme

What did you see?

failed to get authorization server metadata: metadata issuer "https://api.example.com" does not match issuer URL "https://api.example.com?tenant=acme"

getProtectedResourceMetadata builds the fallback base URL by setting u.Path = "" on the parsed server URL, which keeps the query (and any fragment). That URL is used as the issuer, so the issuer check in GetAuthServerMeta fails and Authorize returns an error. When the server serves no metadata at all, the default endpoints are built by concatenation and come out as https://api.example.com?tenant=acme/authorize and …?tenant=acme/token.

What did you expect to see?

The base URL should be https://api.example.com: scheme and authority only. The spec's example (https://api.example.com/v1/mcp → https://api.example.com) and RFC 8414's issuer rules (no query or fragment) both point that way.

Protected resource metadata discovery is unaffected: RFC 9728 §3.1 keeps the query when inserting the well-known suffix, so that part is correct as it is.

What version of the Go MCP SDK are you using?

v1.8.0, and main at 172aebf.

What version of Go are you using (go version)?

go1.25.3 windows/amd64

I have a fix with tests and will send a PR.

主要言語
Go
スター
5.2k
フォーク
568
平均マージ
1日 15時間
マージ済み PR(30日)
39

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/go-sdk のほかの issue

modelcontextprotocol/go-sdk の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。