-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(cli): mcp oauth using mcp-remote #8143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="extensions/cli/src/services/MCPService.ts">
<violation number="1" location="extensions/cli/src/services/MCPService.ts:388">
Non-401 connection failures are now swallowed by this catch block, so the client proceeds without a live connection. Please rethrow errors that are not authorization-related so the caller can report the failure.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| const transport = this.constructHttpTransport(serverConfig); | ||
| await client.connect(transport, {}); | ||
| } | ||
| } catch (error: unknown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-401 connection failures are now swallowed by this catch block, so the client proceeds without a live connection. Please rethrow errors that are not authorization-related so the caller can report the failure.
Prompt for AI agents
Address the following comment on extensions/cli/src/services/MCPService.ts at line 388:
<comment>Non-401 connection failures are now swallowed by this catch block, so the client proceeds without a live connection. Please rethrow errors that are not authorization-related so the caller can report the failure.</comment>
<file context>
@@ -366,15 +377,27 @@ export class MCPService
+ const transport = this.constructHttpTransport(serverConfig);
+ await client.connect(transport, {});
+ }
+ } catch (error: unknown) {
+ // on authorization error, use "mcp-remote" with stdio transport to connect
+ if (is401Error(error)) {
</file context>
✅ Addressed in 68292ed
|
🎉 This PR is included in version 1.27.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
authenticate using mcp-remote for mcp servers requiring authorization
resolves CON-4179
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
feat.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Add OAuth handling for MCP servers in the CLI by falling back to mcp-remote (stdio) when SSE/HTTP connections return 401. Enables authentication to protected MCP endpoints and aligns with Linear CON-4179.
New Features
npx -y mcp-remote <url>via stdio to complete auth and connect.Bug Fixes