Merge 921928219d
into 7eecc9ca3f
This commit is contained in:
commit
317845429b
2 changed files with 16 additions and 2 deletions
10
README.md
10
README.md
|
@ -79,7 +79,7 @@ To bypass authentication, or to emit custom headers on all requests to your remo
|
||||||
```json
|
```json
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": [
|
"args": [
|
||||||
"-y"
|
"-y",
|
||||||
"mcp-remote",
|
"mcp-remote",
|
||||||
"https://remote.mcp.server/sse"
|
"https://remote.mcp.server/sse"
|
||||||
]
|
]
|
||||||
|
@ -131,6 +131,14 @@ npx mcp-remote https://example.remote/server --transport sse-only
|
||||||
- `http-only`: Only uses HTTP transport, fails if the server doesn't support it
|
- `http-only`: Only uses HTTP transport, fails if the server doesn't support it
|
||||||
- `sse-only`: Only uses SSE transport, fails if the server doesn't support it
|
- `sse-only`: Only uses SSE transport, fails if the server doesn't support it
|
||||||
|
|
||||||
|
### Post-Auth Redirect URI
|
||||||
|
|
||||||
|
To customize the redirect behavior after an OAuth flow, include a `postAuthRedirectUri` query parameter in the request to the OAuth callback endpoint. This parameter specifies where users should be redirected after successful authentication.
|
||||||
|
|
||||||
|
Ensure that your server appends `postAuthRedirectUri` as a query parameter when invoking the `redirectUri`.
|
||||||
|
|
||||||
|
Once authentication is complete, users will be redirected to the specified URI instead of seeing the default "Authorization successful" message. This allows you to deliver a smoother user experience by guiding users to a custom post-authentication page.
|
||||||
|
|
||||||
### Claude Desktop
|
### Claude Desktop
|
||||||
|
|
||||||
[Official Docs](https://modelcontextprotocol.io/quickstart/user)
|
[Official Docs](https://modelcontextprotocol.io/quickstart/user)
|
||||||
|
|
|
@ -310,6 +310,11 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe
|
||||||
log('Auth code received, resolving promise')
|
log('Auth code received, resolving promise')
|
||||||
authCompletedResolve(code)
|
authCompletedResolve(code)
|
||||||
|
|
||||||
|
const postAuthRedirectUri = req.query.postAuthRedirectUri as string | undefined
|
||||||
|
if (postAuthRedirectUri) {
|
||||||
|
log(`Redirecting to post-auth redirect URI: ${postAuthRedirectUri}`)
|
||||||
|
res.redirect(postAuthRedirectUri)
|
||||||
|
} else {
|
||||||
res.send(`
|
res.send(`
|
||||||
Authorization successful!
|
Authorization successful!
|
||||||
You may close this window and return to the CLI.
|
You may close this window and return to the CLI.
|
||||||
|
@ -320,6 +325,7 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe
|
||||||
window.close();
|
window.close();
|
||||||
</script>
|
</script>
|
||||||
`)
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
// Notify main flow that auth code is available
|
// Notify main flow that auth code is available
|
||||||
options.events.emit('auth-code-received', code)
|
options.events.emit('auth-code-received', code)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue