Files
github--github-mcp-server/pkg/github/feature_flags.go
copilot-swe-agent[bot] 6bce2d5234 Add MCP_DISABLE_EMBEDDED_RESOURCES feature flag for file contents
- Added FeatureFlagDisableEmbeddedResources constant to feature_flags.go
- Implemented NewToolResultResourceWithFlag in utils/result.go
  - When flag is enabled, returns TextContent for text files
  - Returns ImageContent with base64 data for binary files
  - Maintains backward compatibility when flag is disabled
- Updated get_file_contents tool to check feature flag and use new function
- Added comprehensive tests for both utils function and integration with get_file_contents

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-02-04 12:32:17 +00:00

14 lines
509 B
Go

package github
// FeatureFlags defines runtime feature toggles that adjust tool behavior.
type FeatureFlags struct {
LockdownMode bool
InsidersMode bool
}
// FeatureFlagDisableEmbeddedResources is a feature flag that when enabled,
// returns file contents as regular MCP content (TextContent/ImageContent)
// instead of EmbeddedResource. This provides better compatibility with
// clients that don't support embedded resources.
const FeatureFlagDisableEmbeddedResources = "MCP_DISABLE_EMBEDDED_RESOURCES"