feat: Added a new oauth.redirectHost field to make it possible to further extend MCP support
CI / All (ubuntu-latest) (push) Failing after 24s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-07 15:35:04 -06:00
parent 7673799d83
commit b8990fdfc2
4 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -81,14 +81,16 @@ pub async fn run_mcp_oauth_flow(
server_url: &str,
configured_client_id: Option<&str>,
callback_port: Option<u16>,
redirect_host: Option<&str>,
) -> Result<()> {
let metadata = discover_oauth_metadata(server_url).await?;
let host = redirect_host.unwrap_or("127.0.0.1");
let bind_addr = format!("127.0.0.1:{}", callback_port.unwrap_or(0));
let listener = TcpListener::bind(&bind_addr)?;
let port = listener.local_addr()?.port();
drop(listener);
let redirect_uri = format!("http://localhost:{port}/callback");
let redirect_uri = format!("http://{host}:{port}/callback");
let client_id = if let Some(id) = configured_client_id {
id.to_string()