From d0a0e4c08a885622811102d24f44180a79cf1afe Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Fri, 2 Jan 2026 10:54:21 +0000 Subject: [PATCH 1/4] exclude tools requiring ff from docs --- README.md | 43 -------------------------- cmd/github-mcp-server/generate_docs.go | 5 +-- pkg/inventory/registry.go | 27 ++++++++++++++++ 3 files changed, 30 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 29795dc8f..7edb33113 100644 --- a/README.md +++ b/README.md @@ -491,40 +491,6 @@ The following sets of tools are available: workflow Actions -- **actions_get** - Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts) - - `method`: The method to execute (string, required) - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `resource_id`: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID: - - Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method. - - Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods. - - Provide an artifact ID for 'download_workflow_run_artifact' method. - - Provide a job ID for 'get_workflow_job' method. - (string, required) - -- **actions_list** - List GitHub Actions workflows in a repository - - `method`: The action to perform (string, required) - - `owner`: Repository owner (string, required) - - `page`: Page number for pagination (default: 1) (number, optional) - - `per_page`: Results per page for pagination (default: 30, max: 100) (number, optional) - - `repo`: Repository name (string, required) - - `resource_id`: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID: - - Do not provide any resource ID for 'list_workflows' method. - - Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'list_workflow_runs' method, or omit to list all workflow runs in the repository. - - Provide a workflow run ID for 'list_workflow_jobs' and 'list_workflow_run_artifacts' methods. - (string, optional) - - `workflow_jobs_filter`: Filters for workflow jobs. **ONLY** used when method is 'list_workflow_jobs' (object, optional) - - `workflow_runs_filter`: Filters for workflow runs. **ONLY** used when method is 'list_workflow_runs' (object, optional) - -- **actions_run_trigger** - Trigger GitHub Actions workflow actions - - `inputs`: Inputs the workflow accepts. Only used for 'run_workflow' method. (object, optional) - - `method`: The method to execute (string, required) - - `owner`: Repository owner (string, required) - - `ref`: The git reference for the workflow. The reference can be a branch or tag name. Required for 'run_workflow' method. (string, optional) - - `repo`: Repository name (string, required) - - `run_id`: The ID of the workflow run. Required for all methods except 'run_workflow'. (number, optional) - - `workflow_id`: The workflow ID (numeric) or workflow file name (e.g., main.yml, ci.yaml). Required for 'run_workflow' method. (string, optional) - - **cancel_workflow_run** - Cancel workflow run - `owner`: Repository owner (string, required) - `repo`: Repository name (string, required) @@ -549,15 +515,6 @@ The following sets of tools are available: - `run_id`: Workflow run ID (required when using failed_only) (number, optional) - `tail_lines`: Number of lines to return from the end of the log (number, optional) -- **get_job_logs** - Get GitHub Actions workflow job logs - - `failed_only`: When true, gets logs for all failed jobs in the workflow run specified by run_id. Requires run_id to be provided. (boolean, optional) - - `job_id`: The unique identifier of the workflow job. Required when getting logs for a single job. (number, optional) - - `owner`: Repository owner (string, required) - - `repo`: Repository name (string, required) - - `return_content`: Returns actual log content instead of URLs (boolean, optional) - - `run_id`: The unique identifier of the workflow run. Required when failed_only is true to get logs for all failed jobs in the run. (number, optional) - - `tail_lines`: Number of lines to return from the end of the log (number, optional) - - **get_workflow_run** - Get workflow run - `owner`: Repository owner (string, required) - `repo`: Repository name (string, required) diff --git a/cmd/github-mcp-server/generate_docs.go b/cmd/github-mcp-server/generate_docs.go index b40e3e2f4..4be0076bc 100644 --- a/cmd/github-mcp-server/generate_docs.go +++ b/cmd/github-mcp-server/generate_docs.go @@ -153,9 +153,10 @@ func generateToolsetsDoc(i *inventory.Inventory) string { } func generateToolsDoc(r *inventory.Inventory) string { - // AllTools() returns tools sorted by toolset ID then tool name. + // AllToolsForDocs() returns tools sorted by toolset ID then tool name, + // excluding tools that require feature flags (not available to regular users). // We iterate once, grouping by toolset as we encounter them. - tools := r.AllTools() + tools := r.AllToolsForDocs() if len(tools) == 0 { return "" } diff --git a/pkg/inventory/registry.go b/pkg/inventory/registry.go index f3691e38a..d9e73370b 100644 --- a/pkg/inventory/registry.go +++ b/pkg/inventory/registry.go @@ -266,6 +266,33 @@ func (r *Inventory) AllTools() []ServerTool { return result } +// AllToolsForDocs returns tools suitable for documentation, sorted deterministically. +// This excludes tools that require a feature flag to be enabled (FeatureFlagEnable), +// since those are not available to regular users and shouldn't appear in public docs. +// Tools that are disabled by a feature flag (FeatureFlagDisable) are still included +// since they are available by default. +func (r *Inventory) AllToolsForDocs() []ServerTool { + var result []ServerTool + for i := range r.tools { + tool := &r.tools[i] + // Skip tools that require a feature flag to enable + if tool.FeatureFlagEnable != "" { + continue + } + result = append(result, *tool) + } + + // Sort deterministically: by toolset ID, then by tool name + sort.Slice(result, func(i, j int) bool { + if result[i].Toolset.ID != result[j].Toolset.ID { + return result[i].Toolset.ID < result[j].Toolset.ID + } + return result[i].Tool.Name < result[j].Tool.Name + }) + + return result +} + // AvailableToolsets returns the unique toolsets that have tools, in sorted order. // This is the ordered intersection of toolsets with reality - only toolsets that // actually contain tools are returned, sorted by toolset ID. From c7569a80c8b73a912b3ede65d1e8e10b975b0025 Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Fri, 2 Jan 2026 13:24:01 +0000 Subject: [PATCH 2/4] refactor docs toolset gen --- cmd/github-mcp-server/generate_docs.go | 15 ++++++++------ pkg/inventory/registry.go | 27 -------------------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/cmd/github-mcp-server/generate_docs.go b/cmd/github-mcp-server/generate_docs.go index 4be0076bc..7590666b5 100644 --- a/cmd/github-mcp-server/generate_docs.go +++ b/cmd/github-mcp-server/generate_docs.go @@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "net/url" "os" @@ -50,8 +51,10 @@ func generateReadmeDocs(readmePath string) error { // Create translation helper t, _ := translations.TranslationHelper() - // Build inventory - stateless, no dependencies needed for doc generation - r := github.NewInventory(t).Build() + // Build inventory with all toolsets enabled and no feature checker (all flags return false). + // This includes tools from all toolsets, but excludes tools with FeatureFlagEnable + // (not available to regular users) while including tools with FeatureFlagDisable. + r := github.NewInventory(t).WithToolsets([]string{"all"}).Build() // Generate toolsets documentation toolsetsDoc := generateToolsetsDoc(r) @@ -153,10 +156,10 @@ func generateToolsetsDoc(i *inventory.Inventory) string { } func generateToolsDoc(r *inventory.Inventory) string { - // AllToolsForDocs() returns tools sorted by toolset ID then tool name, - // excluding tools that require feature flags (not available to regular users). - // We iterate once, grouping by toolset as we encounter them. - tools := r.AllToolsForDocs() + // Use AvailableTools with the inventory's feature checker (returns false for all flags), + // which excludes tools requiring a feature flag (FeatureFlagEnable) while keeping + // tools that are disabled by feature flags (available by default). + tools := r.AvailableTools(context.Background()) if len(tools) == 0 { return "" } diff --git a/pkg/inventory/registry.go b/pkg/inventory/registry.go index d9e73370b..f3691e38a 100644 --- a/pkg/inventory/registry.go +++ b/pkg/inventory/registry.go @@ -266,33 +266,6 @@ func (r *Inventory) AllTools() []ServerTool { return result } -// AllToolsForDocs returns tools suitable for documentation, sorted deterministically. -// This excludes tools that require a feature flag to be enabled (FeatureFlagEnable), -// since those are not available to regular users and shouldn't appear in public docs. -// Tools that are disabled by a feature flag (FeatureFlagDisable) are still included -// since they are available by default. -func (r *Inventory) AllToolsForDocs() []ServerTool { - var result []ServerTool - for i := range r.tools { - tool := &r.tools[i] - // Skip tools that require a feature flag to enable - if tool.FeatureFlagEnable != "" { - continue - } - result = append(result, *tool) - } - - // Sort deterministically: by toolset ID, then by tool name - sort.Slice(result, func(i, j int) bool { - if result[i].Toolset.ID != result[j].Toolset.ID { - return result[i].Toolset.ID < result[j].Toolset.ID - } - return result[i].Tool.Name < result[j].Tool.Name - }) - - return result -} - // AvailableToolsets returns the unique toolsets that have tools, in sorted order. // This is the ordered intersection of toolsets with reality - only toolsets that // actually contain tools are returned, sorted by toolset ID. From 9e0d8bb16999ccb98275881dea12689b1555d834 Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Fri, 2 Jan 2026 13:47:17 +0000 Subject: [PATCH 3/4] Update cmd/github-mcp-server/generate_docs.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cmd/github-mcp-server/generate_docs.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/github-mcp-server/generate_docs.go b/cmd/github-mcp-server/generate_docs.go index 7590666b5..f7adc822a 100644 --- a/cmd/github-mcp-server/generate_docs.go +++ b/cmd/github-mcp-server/generate_docs.go @@ -51,8 +51,6 @@ func generateReadmeDocs(readmePath string) error { // Create translation helper t, _ := translations.TranslationHelper() - // Build inventory with all toolsets enabled and no feature checker (all flags return false). - // This includes tools from all toolsets, but excludes tools with FeatureFlagEnable // (not available to regular users) while including tools with FeatureFlagDisable. r := github.NewInventory(t).WithToolsets([]string{"all"}).Build() From dfb6eb178800e74f6900aa9a1cdda14e824f4e90 Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Fri, 2 Jan 2026 13:47:26 +0000 Subject: [PATCH 4/4] Update cmd/github-mcp-server/generate_docs.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cmd/github-mcp-server/generate_docs.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/github-mcp-server/generate_docs.go b/cmd/github-mcp-server/generate_docs.go index f7adc822a..65c01c8fa 100644 --- a/cmd/github-mcp-server/generate_docs.go +++ b/cmd/github-mcp-server/generate_docs.go @@ -154,9 +154,6 @@ func generateToolsetsDoc(i *inventory.Inventory) string { } func generateToolsDoc(r *inventory.Inventory) string { - // Use AvailableTools with the inventory's feature checker (returns false for all flags), - // which excludes tools requiring a feature flag (FeatureFlagEnable) while keeping - // tools that are disabled by feature flags (available by default). tools := r.AvailableTools(context.Background()) if len(tools) == 0 { return ""