You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: remove dynamic toolsets and deprecated closure constructor
Dynamic toolset discovery (the meta-tools enable_toolset, list_available_toolsets,
get_toolset_tools and the --dynamic-toolsets / GITHUB_DYNAMIC_TOOLSETS switch)
was a local-only feature never offered by the remote server. Removing it
deletes a meaningful chunk of branching, configuration surface and tests
for a path no longer in active use.
The deprecated closure-based NewServerToolWithDeps generic constructor was
only kept around for the dynamic tool registration path and is removed
together with it. Going forward there are exactly two constructors:
- NewServerTool — raw mcp.ToolHandler, no closure, no unmarshalling
- NewServerToolWithContextHandler[In, Out] — typed handler, deps via context
Inventory methods that only existed for the dynamic path
(ToolsForToolset, IsToolsetEnabled, EnableToolset, EnabledToolsetIDs)
are removed. ResolvedEnabledToolsets loses its dynamic flag.
Also strips dynamic references from the README, server configuration
docs, copilot-instructions, mcp-diff workflow, and conformance-test
script.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+2-33Lines changed: 2 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -424,7 +424,7 @@ The environment variable `GITHUB_TOOLSETS` takes precedence over the command lin
424
424
425
425
#### Specifying Individual Tools
426
426
427
-
You can also configure specific tools using the `--tools` flag. Tools can be used independently or combined with toolsets and dynamic toolsets discovery for fine-grained control.
427
+
You can also configure specific tools using the `--tools` flag. Tools can be used independently or combined with toolsets for fine-grained control.
428
428
429
429
1.**Using Command Line Argument**:
430
430
@@ -446,17 +446,9 @@ You can also configure specific tools using the `--tools` flag. Tools can be use
446
446
447
447
This registers all tools from `repos` and `issues` toolsets, plus `get_gist`.
This registers `get_file_contents` plus the dynamic toolset tools (`enable_toolset`, `list_available_toolsets`, `get_toolset_tools`).
456
-
457
449
**Important Notes:**
458
450
459
-
- Tools, toolsets, and dynamic toolsets can all be used together
451
+
- Toolsand toolsets can be used together
460
452
- Read-only mode takes priority: write tools are skipped if `--read-only` is set, even if explicitly requested via `--tools`
461
453
- Tool names must match exactly (e.g., `get_file_contents`, not `getFileContents`). Invalid tool names will cause the server to fail at startup with an error message
462
454
- When tools are renamed, old names are preserved as aliases for backward compatibility. See [Tool Renaming](docs/tool-renaming.md) for details.
@@ -1462,29 +1454,6 @@ The following sets of tools are available:
1462
1454
1463
1455
</details>
1464
1456
1465
-
## Dynamic Tool Discovery
1466
-
1467
-
**Note**: This feature is currently in beta and is not available in the Remote GitHub MCP Server. Please test it out and let us know if you encounter any issues.
1468
-
1469
-
Instead of starting with all tools enabled, you can turn on dynamic toolset discovery. Dynamic toolsets allow the MCP host to list and enable toolsets in response to a user prompt. This should help to avoid situations where the model gets confused by the sheer number of tools available.
1470
-
1471
-
### Using Dynamic Tool Discovery
1472
-
1473
-
When using the binary, you can pass the `--dynamic-toolsets` flag.
1474
-
1475
-
```bash
1476
-
./github-mcp-server --dynamic-toolsets
1477
-
```
1478
-
1479
-
When using Docker, you can pass the toolsets as environment variables:
1480
-
1481
-
```bash
1482
-
docker run -i --rm \
1483
-
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
1484
-
-e GITHUB_DYNAMIC_TOOLSETS=1 \
1485
-
ghcr.io/github/github-mcp-server
1486
-
```
1487
-
1488
1457
## Read-Only Mode
1489
1458
1490
1459
To run the server in read-only mode, you can use the `--read-only` flag. This will only offer read-only tools, preventing any modifications to repositories, issues, pull requests, etc.
fmt.Fprintf(&buf, "| %s | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |\n", contextIcon)
146
146
147
147
// AvailableToolsets() returns toolsets that have tools, sorted by ID
148
-
// Exclude context (custom description above) and dynamic (internal only)
rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations")
170
167
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")
171
168
rootCmd.PersistentFlags().Bool("enable-command-logging", false, "When enabled, the server will log all command requests and responses to the log file")
Copy file name to clipboardExpand all lines: docs/server-configuration.md
+1-56Lines changed: 1 addition & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@ We currently support the following ways in which the GitHub MCP Server can be co
11
11
| Individual Tools |`X-MCP-Tools` header |`--tools` flag or `GITHUB_TOOLS` env var |
12
12
| Exclude Tools |`X-MCP-Exclude-Tools` header |`--exclude-tools` flag or `GITHUB_EXCLUDE_TOOLS` env var |
13
13
| Read-Only Mode |`X-MCP-Readonly` header or `/readonly` URL |`--read-only` flag or `GITHUB_READ_ONLY` env var |
14
-
| Dynamic Mode | Not available |`--dynamic-toolsets` flag or `GITHUB_DYNAMIC_TOOLSETS` env var |
15
14
| Lockdown Mode |`X-MCP-Lockdown` header |`--lockdown-mode` flag or `GITHUB_LOCKDOWN_MODE` env var |
16
15
| Insiders Mode |`X-MCP-Insiders` header or `/insiders` URL |`--insiders` flag or `GITHUB_INSIDERS` env var |
17
16
| Feature Flags |`X-MCP-Features` header |`--features` flag |
@@ -24,7 +23,7 @@ We currently support the following ways in which the GitHub MCP Server can be co
24
23
25
24
## How Configuration Works
26
25
27
-
All configuration options are **composable**: you can combine toolsets, individual tools, excluded tools, dynamic discovery, read-only mode and lockdown mode in any way that suits your workflow.
26
+
All configuration options are **composable**: you can combine toolsets, individual tools, excluded tools, read-only mode and lockdown mode in any way that suits your workflow.
28
27
29
28
Note: **read-only** mode acts as a strict security filter that takes precedence over any other configuration, by disabling write tools even when explicitly requested.
30
29
@@ -287,59 +286,6 @@ When active, this mode will disable all tools that are not read-only even if the
287
286
288
287
---
289
288
290
-
### Dynamic Discovery (Local Only)
291
-
292
-
**Best for:** Letting the LLM discover and enable toolsets as needed.
293
-
294
-
Starts with only discovery tools (`enable_toolset`, `list_available_toolsets`, `get_toolset_tools`), then expands on demand.
When both dynamic mode and specific tools are enabled in the server configuration, the server will start with the 3 dynamic tools + the specified tools.
340
-
341
-
---
342
-
343
289
### Lockdown Mode
344
290
345
291
**Best for:** Public repositories where you want to limit content from users without push access.
@@ -521,7 +467,6 @@ See [Scope Filtering](./scope-filtering.md) for details on how filtering works w
521
467
| Server fails to start | Invalid tool name in `--tools` or `X-MCP-Tools`| Check tool name spelling; use exact names from [Tools list](../README.md#tools)|
522
468
| Write tools not working | Read-only mode enabled | Remove `--read-only` flag or `X-MCP-Readonly` header |
523
469
| Tools missing | Toolset not enabled | Add the required toolset or specific tool |
524
-
| Dynamic tools not available | Using remote server | Dynamic mode is available in the local MCP server only |
0 commit comments