Skip to content

Commit ee04e6a

Browse files
ci(mcp-diff): add insiders + per-feature configs
The mcp-diff matrix now includes: - --insiders (and --insiders --read-only) - one config per github.AllowedFeatureFlags entry, generated by script/print-mcp-diff-configs so new user-controllable flags get diffed automatically without editing the workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 11912cc commit ee04e6a

2 files changed

Lines changed: 80 additions & 16 deletions

File tree

.github/workflows/mcp-diff.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,35 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
2227
- name: Build UI
2328
uses: ./.github/actions/build-ui
2429

30+
- name: Generate diff configurations
31+
id: configs
32+
# The generator imports pkg/github so any new entry in
33+
# AllowedFeatureFlags is automatically diffed without touching this
34+
# workflow. See script/print-mcp-diff-configs/main.go.
35+
run: |
36+
{
37+
echo 'configurations<<MCP_DIFF_EOF'
38+
go run ./script/print-mcp-diff-configs
39+
echo 'MCP_DIFF_EOF'
40+
} >> "$GITHUB_OUTPUT"
41+
2542
- name: Run MCP Server Diff
2643
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
2744
with:
28-
setup_go: "true"
45+
setup_go: "false"
2946
install_command: go mod download
3047
start_command: go run ./cmd/github-mcp-server stdio
3148
env_vars: |
3249
GITHUB_PERSONAL_ACCESS_TOKEN=test-token
33-
configurations: |
34-
[
35-
{"name": "default", "args": ""},
36-
{"name": "read-only", "args": "--read-only"},
37-
{"name": "toolsets-repos", "args": "--toolsets=repos"},
38-
{"name": "toolsets-issues", "args": "--toolsets=issues"},
39-
{"name": "toolsets-context", "args": "--toolsets=context"},
40-
{"name": "toolsets-pull_requests", "args": "--toolsets=pull_requests"},
41-
{"name": "toolsets-repos,issues", "args": "--toolsets=repos,issues"},
42-
{"name": "toolsets-issues,context", "args": "--toolsets=issues,context"},
43-
{"name": "toolsets-all", "args": "--toolsets=all"},
44-
{"name": "tools-get_me", "args": "--tools=get_me"},
45-
{"name": "tools-get_me,list_issues", "args": "--tools=get_me,list_issues"},
46-
{"name": "toolsets-repos+read-only", "args": "--toolsets=repos --read-only"}
47-
]
50+
configurations: ${{ steps.configs.outputs.configurations }}
4851

4952
- name: Add interpretation note
5053
if: always()
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Command print-mcp-diff-configs emits the full configuration matrix consumed
2+
// by the mcp-server-diff GitHub Action. The matrix is composed of three parts:
3+
//
4+
// 1. Hand-curated baseline configs (default, read-only, common toolset combos)
5+
// 2. Insiders configs (--insiders, --insiders --read-only) — meta flag that
6+
// expands to the curated insiders feature set
7+
// 3. One config per entry in github.AllowedFeatureFlags — automatically kept
8+
// in sync with the Go source so any new user-controllable feature flag
9+
// gets diffed without touching the workflow
10+
//
11+
// Usage: go run ./script/print-mcp-diff-configs
12+
package main
13+
14+
import (
15+
"encoding/json"
16+
"fmt"
17+
"os"
18+
"sort"
19+
20+
"github.com/github/github-mcp-server/pkg/github"
21+
)
22+
23+
type config struct {
24+
Name string `json:"name"`
25+
Args string `json:"args"`
26+
}
27+
28+
func main() {
29+
configs := []config{
30+
{Name: "default", Args: ""},
31+
{Name: "read-only", Args: "--read-only"},
32+
{Name: "toolsets-repos", Args: "--toolsets=repos"},
33+
{Name: "toolsets-issues", Args: "--toolsets=issues"},
34+
{Name: "toolsets-context", Args: "--toolsets=context"},
35+
{Name: "toolsets-pull_requests", Args: "--toolsets=pull_requests"},
36+
{Name: "toolsets-repos,issues", Args: "--toolsets=repos,issues"},
37+
{Name: "toolsets-issues,context", Args: "--toolsets=issues,context"},
38+
{Name: "toolsets-all", Args: "--toolsets=all"},
39+
{Name: "tools-get_me", Args: "--tools=get_me"},
40+
{Name: "tools-get_me,list_issues", Args: "--tools=get_me,list_issues"},
41+
{Name: "toolsets-repos+read-only", Args: "--toolsets=repos --read-only"},
42+
{Name: "insiders", Args: "--insiders"},
43+
{Name: "insiders+read-only", Args: "--insiders --read-only"},
44+
}
45+
46+
flags := append([]string(nil), github.AllowedFeatureFlags...)
47+
sort.Strings(flags)
48+
for _, f := range flags {
49+
configs = append(configs, config{
50+
Name: "feature-" + f,
51+
Args: "--features=" + f,
52+
})
53+
}
54+
55+
enc := json.NewEncoder(os.Stdout)
56+
enc.SetIndent("", " ")
57+
if err := enc.Encode(configs); err != nil {
58+
fmt.Fprintln(os.Stderr, err)
59+
os.Exit(1)
60+
}
61+
}

0 commit comments

Comments
 (0)