feat(mcp): CIMD client identification for OAuth MCP (salvage #84050) - #89566
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 90ee4de — fix: never evict pinned CIMD sockets from the callback reser
|
The _MAX_RESERVED_SOCKETS cap applied to pinned CIMD sockets too, so under heavy concurrency an ephemeral-reservation churn could close a parked pinned socket before _wait_for_callback adopted it, silently reopening the port-stealing window the pin exists to prevent (#22161). Eviction now skips the pinned range; it is already bounded by _CIMD_PORTS. Follow-up to the #84050 salvage.
teknium1
force-pushed
the
salvage/mcp-cimd
branch
from
August 19, 2026 02:54
a7a54cb to
90ee4de
Compare
This was referenced Aug 19, 2026
teknium1
added a commit
that referenced
this pull request
Aug 19, 2026
…75576) Some authorization servers and WAFs reject httpx's default User-Agent on the OAuth token endpoint. mcp_servers.<name>.oauth.user_agent now stamps a custom User-Agent onto the two token-endpoint requests (authorization-code exchange and refresh) on both provider construction paths. Opt-in, per-server, token requests only — never MCP traffic or discovery, and no other headers are configurable. Empty/null/non-string values are ignored. Completes the second half of #75576 (the CIMD half landed via #89566).
lisajlau
pushed a commit
to lisajlau/hermes-agent
that referenced
this pull request
Aug 20, 2026
…ousResearch#75576) Some authorization servers and WAFs reject httpx's default User-Agent on the OAuth token endpoint. mcp_servers.<name>.oauth.user_agent now stamps a custom User-Agent onto the two token-endpoint requests (authorization-code exchange and refresh) on both provider construction paths. Opt-in, per-server, token requests only — never MCP traffic or discovery, and no other headers are configurable. Empty/null/non-string values are ignored. Completes the second half of NousResearch#75576 (the CIMD half landed via NousResearch#89566).
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
…ousResearch#75576) Some authorization servers and WAFs reject httpx's default User-Agent on the OAuth token endpoint. mcp_servers.<name>.oauth.user_agent now stamps a custom User-Agent onto the two token-endpoint requests (authorization-code exchange and refresh) on both provider construction paths. Opt-in, per-server, token requests only — never MCP traffic or discovery, and no other headers are configurable. Empty/null/non-string values are ignored. Completes the second half of NousResearch#75576 (the CIMD half landed via NousResearch#89566).
bobaba76
pushed a commit
to bobaba76/hermes-agent
that referenced
this pull request
Aug 27, 2026
…ousResearch#75576) Some authorization servers and WAFs reject httpx's default User-Agent on the OAuth token endpoint. mcp_servers.<name>.oauth.user_agent now stamps a custom User-Agent onto the two token-endpoint requests (authorization-code exchange and refresh) on both provider construction paths. Opt-in, per-server, token requests only — never MCP traffic or discovery, and no other headers are configurable. Empty/null/non-string values are ignored. Completes the second half of NousResearch#75576 (the CIMD half landed via NousResearch#89566).
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.
Summary
Hermes now identifies itself to OAuth MCP servers with a published Client ID Metadata Document (CIMD) — the client-identification mechanism the MCP 2026-07-28 spec adopted in place of per-install Dynamic Client Registration — falling back to DCR automatically on servers that don't advertise or that reject it.
Salvage of #84050 by @rob-maron, rebased onto current main (post mcp 2.x SDK migration), with one hardening fix on top.
Changes
website/static/oauth/client-metadata.json: the published CIMD document (client_id = its own github.io URL, 10 loopback redirect URIs)tools/mcp_oauth.py: CIMD eligibility (_maybe_use_cimd), pinned callback ports 27890-27894 (spec requires exact redirect-URI match), pinned-socket parking, durable.cimd-offrejection marker, CIMD-aware timeout messagetools/mcp_oauth_manager.py: forwardsclient_metadata_urlto the provider; oninvalid_clientrejection of the document, drops to DCR and records the markerscripts/ci/classify_changes.py: the static JSON is python-relevant (cross-artifact test asserts on it)website/docs/: CIMD/DCR reference section + feature-page noteValidation
Contributor authorship preserved via cherry-pick. Closes #84050; implements the CIMD half of #75576.
Infographic