Skip to content

Conversation

sungigant
Copy link

Co-authored-by: SamMorrowDrums 4811358+SamMorrowDrums@users.noreply.github.com

Closes:

Copilot AI and others added 5 commits May 23, 2025 10:45
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>
@sungigant sungigant requested a review from a team as a code owner August 26, 2025 00:37
@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 00:37
Copy link
Contributor

@Copilot Copilot AI 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 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.

Comment on lines +72 to +74
filterCfg := &ContentFilteringConfig{
DisableContentFiltering: false, // Default to enabled
}
Copy link
Preview

Copilot AI Aug 26, 2025

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.

Suggested change
filterCfg := &ContentFilteringConfig{
DisableContentFiltering: false, // Default to enabled
}
filterCfg := getContentFilteringConfig(ctx)

Copilot uses AI. Check for mistakes.

Comment on lines +74 to +76
filterCfg := &ContentFilteringConfig{
DisableContentFiltering: false, // Default to enabled
}
Copy link
Preview

Copilot AI Aug 26, 2025

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.

Suggested change
filterCfg := &ContentFilteringConfig{
DisableContentFiltering: false, // Default to enabled
}
filterCfg := getContentFilteringConfig(ctx)

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants