Repository navigation
feat(cli): mcp oauth using mcp-remote - #8143
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this 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.
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
Contributor
|
🎉 This PR is included in version 1.27.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Contributor
|
🎉 This PR is included in version 1.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Contributor
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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