feat: Add CSV output format for default list tools under insiders mode#2450
feat: Add CSV output format for default list tools under insiders mode#2450RossTarrant wants to merge 5 commits into
Conversation
8e2be4a to
3ada757
Compare
There was a problem hiding this comment.
Pull request overview
Adds an Insiders-gated CSV output mode for default list_* tools, aiming to reduce response size/context for MCP clients. This is implemented by feature-flagged tool variants that convert the existing JSON text output into a flattened CSV representation.
Changes:
- Added
csv_outputfeature flag (allowlisted and enabled by Insiders mode). - Introduced feature-gated JSON/CSV tool variants for default-toolset
list_*tools, with centralized JSON→CSV conversion (flattening + whitespace normalization). - Wired HTTP mode CLI
--features/--insidersinto feature-flag resolution; added unit tests + Insiders feature documentation.
Show a summary per file
| File | Description |
|---|---|
| cmd/github-mcp-server/main.go | Passes CLI --features into HTTP server config. |
| pkg/http/server.go | Extends HTTP server config with static enabled features; updates feature checker to combine static + header features and insiders mode. |
| pkg/http/server_test.go | Adds coverage for static feature/static insiders behavior in HTTP feature checker. |
| pkg/http/handler_test.go | Updates tests to new feature-checker signature. |
| pkg/github/feature_flags.go | Adds csv_output flag to allowlist + insiders expansion list. |
| pkg/github/tools.go | Wraps tool list construction to inject CSV-output variants for eligible tools. |
| pkg/github/csv_output.go | Implements JSON-text tool-result → flattened CSV conversion and tool handler wrapping. |
| pkg/github/csv_output_test.go | Adds unit tests for CSV conversion + feature-gated tool variants. |
| docs/insiders-features.md | Documents CSV output behavior, format, and how to enable it. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 1
3ada757 to
b070b00
Compare
SamMorrowDrums
left a comment
There was a problem hiding this comment.
@RossTarrant I thought in a previous version similar bit of work I had asked that insiders would be expanded to the feature flags it enables, and nothing would be gated on insiders, but the feature that it is actually related to, and insiders is just a shortcut to enabled flags. Just like all and default are meta toolsets (contain more than one toolset), insiders should just be a meta feature flag, that enables a set of feature flags, so at the point they are checked, they should be considered to be regular feature flags.
Nothing else in the codebase should need to know what insiders is. That just leaks the concept too far.
Can this PR resolve that while it's making changes to the feature checker?
| featureSet := github.ResolveFeatureFlags( | ||
| enabledFeatures, | ||
| github.MetaFeatureFlagsForInsiders(insidersMode)..., | ||
| ) |
There was a problem hiding this comment.
I think you need to resolved the user provided enabled feature flags by the allowed features:
Because insiders mode flags list should be already in there. Also can't this directly reference the list of insiders features?
Summary
Adds feature-gated CSV output for default
list_*tools and refactors Insiders mode into a feature flag bundle.Why
CSV provides a flatter, more compact representation for list-style responses, helping evaluate token reduction from output format changes.
Refs github/copilot-mcp-core#1323
What changed
ifc_labelsas an Insiders-enabled feature flag.MCP impact
CSV mode changes list_* tool (within default toolset) response behavior under the csv_output Insiders feature flag. Tool schemas are unchanged; CSV output is server-controlled by feature flag gating.
Prompts tested (tool changes only)
Security / limits
CSV mode is intended to reduce response size for list tools. Body fields are whitespace-normalized in CSV output; full formatted content remains available through corresponding get/read tools.
Tool renaming
Lint & tests
Docs
docs/insiders-features.mddetailing the new experimental feature