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: read-only flag#29

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

Merged
SamMorrowDrums merged 1 commit intomainfromread-only
Mar 20, 2025
Merged

feat: read-only flag#29

SamMorrowDrums merged 1 commit intomainfromread-only
Mar 20, 2025

Conversation

SamMorrowDrums
Copy link
Collaborator

Add a read-only flag and gate endpoints that would otherwise write behind it, so that people can avoid the risk that an LLM can write to their GitHub account entirely.

@CopilotCopilotAI review requested due to automatic review settingsMarch 20, 2025 16:10
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 introduces a read-only flag that restricts write operations within the GitHub MCP server to help prevent unauthorized modifications.

  • Added a new persistent flag "read-only" and bound it via viper in cmd/github-mcp-server/main.go.
  • Updated the runStdioServer function signature and its invocation to include the readOnly parameter.
  • Modified the NewServer function in pkg/github/server.go to conditionally add write tools based on the readOnly flag.

Reviewed Changes

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

FileDescription
cmd/github-mcp-server/main.goAdded a "read-only" flag and updated function calls to pass the flag value.
pkg/github/server.goUpdated the NewServer function to gate write operations using the readOnly flag.
Comments suppressed due to low confidence (1)

pkg/github/server.go:37

  • The new condition controlling the addition of write-related tools for GitHub operations is introduced here without associated tests.
if !readOnly {

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon.Learn more

Copy link
Collaborator

@juruenjuruen left a comment

Choose a reason for hiding this comment

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

🚀

@SamMorrowDrumsSamMorrowDrums merged commit3f7d5b0 intomainMar 20, 2025
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@juruenjuruenjuruen approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@SamMorrowDrums@juruen

[8]ページ先頭

©2009-2025 Movatter.jp