fix(mcp-oauth): allow configurable redirect_uri for MCP OAuth flows

This commit is contained in:
Florian Burka 2026-06-17 11:01:30 +02:00 committed by Teknium
parent 7a78342ab3
commit 6297634d22

View file

@ -915,7 +915,7 @@ def _build_client_metadata(cfg: dict) -> "OAuthClientMetadata":
)
client_name = cfg.get("client_name", "Hermes Agent")
scope = cfg.get("scope")
redirect_uri = f"http://127.0.0.1:{port}/callback"
redirect_uri = cfg.get("redirect_uri") or f"http://127.0.0.1:{port}/callback"
metadata_kwargs: dict[str, Any] = {
"client_name": client_name,
@ -942,7 +942,7 @@ def _maybe_preregister_client(
if not client_id:
return
port = cfg["_resolved_port"]
redirect_uri = f"http://127.0.0.1:{port}/callback"
redirect_uri = cfg.get("redirect_uri") or f"http://127.0.0.1:{port}/callback"
info_dict: dict[str, Any] = {
"client_id": client_id,