From 6297634d223273189dd1e803a5b5cb7a8e9b0958 Mon Sep 17 00:00:00 2001 From: Florian Burka Date: Wed, 17 Jun 2026 11:01:30 +0200 Subject: [PATCH] fix(mcp-oauth): allow configurable redirect_uri for MCP OAuth flows --- tools/mcp_oauth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mcp_oauth.py b/tools/mcp_oauth.py index 9003f980f..1235e9e40 100644 --- a/tools/mcp_oauth.py +++ b/tools/mcp_oauth.py @@ -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,