auth: Authorize fails against a 2025-03-26 server whose URL has a query string
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/go-sdk のほかの issue
-
Session-lifecycle bookkeeping logs at info, spamming multiple log lines per request on stateless streamable HTTP対応中かも @anneheartrecord が 42 日前に担当しました。 オープンP3
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/go-sdk#1204 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Expose generic `SendNotification` on `ServerSession` for custom protocol extensions対応中かも @ajuijas が 208 日前に担当しました。 オープンneeds investigation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/go-sdk#745 · コメント 13 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mcp: client returns an input_required result that has only requestState instead of retrying対応中かも @SergeevDmitry が今日担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 62/100
modelcontextprotocol/go-sdk#1364 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
modelcontextprotocol/go-sdk#1359 ·
メンテナーはふだん 1 日以内に返信
-
Streamable HTTP: a tool result that fails to marshal leaves the POST hanging (no JSON-RPC error)オープン
難易度 4/5 1〜2日 初心者へのやさしさ 45/100
modelcontextprotocol/go-sdk#1358 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/go-sdk の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
agent-research agent-review-finding chore
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
jordansmall/spindrift#4922 ·
メンテナーはふだん 1 日以内に返信
-
gcsartifact: deleting a missing version returns an error対応中かも @ktsoator が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
govulncheck
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
Change wording for init command success message対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信