diff --git a/README.md b/README.md index c36424c..9897959 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo ```json "command": "npx", "args": [ - "-y" + "-y", "mcp-remote", "https://remote.mcp.server/sse" ] diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 9e3e243..b1a7d39 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -300,7 +300,13 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe log('Auth code received, resolving promise') authCompletedResolve(code) - res.send('Authorization successful! You may close this window and return to the CLI.') + const postAuthRedirectUri = req.query.postAuthRedirectUri as string | undefined + if (postAuthRedirectUri) { + log(`Redirecting to post-auth redirect URI: ${postAuthRedirectUri}`) + res.redirect(postAuthRedirectUri); + } else { + res.send('Authorization successful! You may close this window and return to the CLI.') + } // Notify main flow that auth code is available options.events.emit('auth-code-received', code)