github / github/copilot-cli

Support wildcard/glob patterns in .copilot/mcp-config.json tools arrays for filtering tool visibility using prefixes for subsets of tools

未關閉
#1,986 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:configuration area:mcp
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the feature or problem you'd like to solve

The MCP config `tools` array require exact tool names — add glob/wildcard pattern support (e.g., `ado-wit_*`) so users can filter tool visibility by prefix or pattern without enumerating every tool individually.

### Proposed solution

MCP servers often expose dozens of tools across functional domains. Pattern-based filtering — at both the CLI flag and MCP config level — lets users load only the tools relevant to their task, keeping the context window small and focused. Something like this may encourage more MCP Server Owners to adopt a filtering approach like ADO MCP did and make managing context windows much easier over time.

### Example prompts or workflows

An MCP server like Azure DevOps exposes very many tools prefixed by domain https://github.com/microsoft/azure-devops-mcp/blob/main/docs/TOOLSET.md — `wit_*` (work item tracking), `repo_*` (repositories/PRs), `pipelines_*` (builds/pipelines), etc.

### .copilot/mcp-config.json

Today, the `tools` array in MCP server configuration requires exact tool names:

```json
{
"mcpServers": {
"ado": {
"tools": [
"wit_get_work_item",
"wit_update_work_item",
"wit_create_work_item",
"repo_list_pull_requests_by_repo_or_project",
"repo_get_pull_request_by_id"
]
}
}
}
```

With pattern support in the `tools` array:

```json
{
"mcpServers": {
"ado": {
"tools": [
"pipelines_*",
"repo_*",
"search_*",
"wit_*"
]
}
}
}
```
could also let you do something like the following in order to enable all get related tools for an autopilot/yolo session

```json
{
"mcpServers": {
"ado": {
"tools": [
"*_get_*",
]
}
}
}
```

This lets users scope an MCP server to specific tool domains at the config level — before tools ever reach the agent — without needing to know or maintain the full list of tool names.

**Suggested pattern syntax:** glob-style matching, consistent with the existing `shell(git:*)` prefix-matching pattern already supported in `--allow-tool`.

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。