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

Đang mở
#1,986 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:configuration area:mcp
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.