Skip to content

feat: Add CSV output format for default list tools under insiders mode#2450

Open
RossTarrant wants to merge 1 commit into
mainfrom
rosstarrant/add-csv-output-structure
Open

feat: Add CSV output format for default list tools under insiders mode#2450
RossTarrant wants to merge 1 commit into
mainfrom
rosstarrant/add-csv-output-structure

Conversation

@RossTarrant
Copy link
Copy Markdown
Contributor

Summary

Adds an Insiders-gated CSV output mode for default list_ tools to reduce response context for MCP clients.

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

  • Added csv_output as an allowed Insiders feature flag.
  • Added feature-gated JSON/CSV variants for list_* tools.
  • Added central JSON text response to CSV conversion with dot-notation flattening for nested objects.
  • Normalised whitespace in body fields for CSV output.
  • Wired HTTP static --features / --insiders flags into feature resolution.
  • Added unit coverage for CSV conversion and feature-gated variants.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    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.
  • New tool added

Prompts tested (tool changes only)

  • "List discussions in RossTarrant/octopus-mcp"
  • "List issues in github/github-mcp-server"
  • "List pull requests in github/github-mcp-server"

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered
    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

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
  • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • [] Not needed
  • Updated (README / docs / examples) - Updated docs/insiders-features.md detailing the new experimental feature

@RossTarrant RossTarrant force-pushed the rosstarrant/add-csv-output-structure branch 2 times, most recently from 8e2be4a to 3ada757 Compare May 12, 2026 07:44
@RossTarrant RossTarrant marked this pull request as ready for review May 12, 2026 07:49
@RossTarrant RossTarrant requested a review from a team as a code owner May 12, 2026 07:49
Copilot AI review requested due to automatic review settings May 12, 2026 07:49
Copy link
Copy Markdown
Contributor

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

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_output feature 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 / --insiders into 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

Comment thread pkg/github/csv_output.go
@RossTarrant RossTarrant force-pushed the rosstarrant/add-csv-output-structure branch from 3ada757 to b070b00 Compare May 12, 2026 08:00
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.

3 participants