- Notifications
You must be signed in to change notification settings - Fork897
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
Uh oh!
There was an error while loading.Please reload this page.
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.
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.
File | Description |
---|---|
cmd/github-mcp-server/main.go | Added a "read-only" flag and updated function calls to pass the flag value. |
pkg/github/server.go | Updated 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
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.
🚀
3f7d5b0
intomainUh oh!
There was an error while loading.Please reload this page.
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.