Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(cli): make MCP server work without user authentication#17688

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

ThomasK33
Copy link
Member

@ThomasK33ThomasK33 commentedMay 6, 2025
edited
Loading

Part of#17649


Allow MCP server to run without authentication

This PR enhances the MCP server to operate without requiring authentication, making it more flexible for environments where authentication isn't available or necessary. Key changes:

  • ReplacedInitClient withTryInitClient to allow the MCP server to start without credentials
  • Added graceful handling when URL or authentication is missing
  • Made authentication status visible in server logs
  • Added logic to skip user-dependent tools when no authenticated user is present
  • Made thecoder_report_task tool available with just an agent token (no user token required)
  • Added comprehensive tests to verify operation without authentication

These changes allow the MCP server to function in more environments while still using authentication when available, improving flexibility for CI/CD and other automated environments.

@ThomasK33Graphite App
Copy link
MemberAuthor

ThomasK33 commentedMay 6, 2025
edited
Loading

@ThomasK33ThomasK33force-pushed thethomask33/05-06-feat_mcp_add_support_for_running_mcp_server_without_user_authentication branch 2 times, most recently froma0e7857 to5ffda26CompareMay 6, 2025 16:01
@ThomasK33ThomasK33 changed the titlefeat(cli): make MCP server work without authenticationfeat(cli): make MCP server work without user authenticationMay 6, 2025
@ThomasK33ThomasK33 requested a review fromCopilotMay 6, 2025 16:15
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR enables the MCP server to run without user authentication.

  • Replaces the mandatory coder client check in the dependencies with support for a nil client for unauthenticated operation.
  • Introduces a new TryInitClient middleware and updates logging and tool filtering for tools that don’t require an authenticated user.
  • Updates tests to verify that the server runs correctly without user authentication while still supporting tools that rely solely on an agent token.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

FileDescription
codersdk/toolsdk/toolsdk.goUpdated dependency initialization and added a flag (UserClientOptional) to mark tools that can run without a user client.
cli/root.goIntroduced TryInitClient to allow initialization without errors when credentials are missing.
cli/exp_mcp_test.goUpdated error expectations in tests and added a new test to confirm operation with just an agent token.
cli/exp_mcp.goModified middleware usage and adjusted authentication logging and tool filtering logic.
Files not reviewed (1)
  • flake.nix: Language not supported

@ThomasK33ThomasK33force-pushed thethomask33/05-06-feat_mcp_add_support_for_running_mcp_server_without_user_authentication branch 5 times, most recently from937e55a to4deeaf3CompareMay 7, 2025 09:56
@ThomasK33ThomasK33 marked this pull request as ready for reviewMay 7, 2025 10:16
@ThomasK33ThomasK33force-pushed thethomask33/05-06-feat_mcp_add_support_for_running_mcp_server_without_user_authentication branch 2 times, most recently from5582625 to6cc32e3CompareMay 7, 2025 13:37
…tionChange-Id: Iab480d38764eddee294a4e8cd35a9dc52add6010Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33ThomasK33force-pushed thethomask33/05-06-feat_mcp_add_support_for_running_mcp_server_without_user_authentication branch from6cc32e3 tobc33d16CompareMay 7, 2025 19:36
@ThomasK33ThomasK33 merged commit29bce8d intomainMay 7, 2025
32 checks passed
@ThomasK33ThomasK33 deleted the thomask33/05-06-feat_mcp_add_support_for_running_mcp_server_without_user_authentication branchMay 7, 2025 19:53
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 7, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@ThomasK33ThomasK33

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ThomasK33@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp