-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Copilot/fix-415 #969
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
base: main
Are you sure you want to change the base?
Copilot/fix-415 #969
Conversation
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
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 content filtering feature to the GitHub MCP Server that removes invisible characters and hidden content from GitHub API responses. The feature is enabled by default but can be disabled via command line flag or environment variable.
- Adds content filtering functionality to sanitize GitHub issues, pull requests, and comments by removing invisible Unicode characters, HTML comments, and hidden content
- Introduces server configuration structure with the ability to disable content filtering
- Updates the server initialization to pass configuration through the entire stack from CLI to GitHub API response handlers
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
pkg/github/server.go | Adds ServerConfig struct and NewServerWithConfig function to support content filtering configuration |
pkg/github/pullrequests.go | Integrates content filtering into pull request API responses |
pkg/github/issues.go | Integrates content filtering into issue API responses |
pkg/github/filtering.go | Implements content filtering functions for GitHub data structures |
pkg/filtering/content_filter.go | Core content filtering logic with regex-based sanitization |
pkg/github/filtering_test.go | Unit tests for GitHub-specific filtering functions |
pkg/filtering/content_filter_test.go | Unit tests for core content filtering functionality |
internal/ghmcp/server.go | Updates server configuration to include content filtering option |
cmd/github-mcp-server/main.go | Adds CLI flag for disabling content filtering |
README.md | Documents the content filtering feature and configuration options |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
filterCfg := &ContentFilteringConfig{ | ||
DisableContentFiltering: false, // Default to enabled | ||
} |
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.
The content filtering configuration is hardcoded in multiple places. Consider extracting this into a helper function or passing the configuration through the context to avoid code duplication and make it easier to modify the filtering behavior consistently across all endpoints.
filterCfg := &ContentFilteringConfig{ | |
DisableContentFiltering: false, // Default to enabled | |
} | |
filterCfg := getContentFilteringConfig(ctx) |
Copilot uses AI. Check for mistakes.
filterCfg := &ContentFilteringConfig{ | ||
DisableContentFiltering: false, // Default to enabled | ||
} |
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.
The content filtering configuration is hardcoded in multiple places. Consider extracting this into a helper function or passing the configuration through the context to avoid code duplication and make it easier to modify the filtering behavior consistently across all endpoints.
filterCfg := &ContentFilteringConfig{ | |
DisableContentFiltering: false, // Default to enabled | |
} | |
filterCfg := getContentFilteringConfig(ctx) |
Copilot uses AI. Check for mistakes.
Co-authored-by: SamMorrowDrums 4811358+SamMorrowDrums@users.noreply.github.com
Closes: