github / github/copilot-cli

Respect VS Code User Settings for Copilot CLI Configuration (e.g., mcp.json)

未关闭
#146 6 条评论 12 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

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

_No response_

### Proposed solution

To improve user experience and consistency, the Copilot CLI should **respect existing VS Code user settings for configuration**, mirroring the setup used within the editor.

#### 💡 Proposal

The Copilot CLI should look for and utilize configuration files stored in the standard VS Code user settings locations, such as the example below for macOS:

**Example Configuration Location (macOS VS Code Insiders):**
`$HOME/Library/Application Support/Code - Insiders/User/mcp.json`

(Note: The path varies based on the OS and VS Code version, e.g., stable, Insiders.)

#### ⚙️ Sample Configuration Format

The CLI should be able to read and utilize a configuration file formatted like this (using `mcp.json` as an example):

```json
{
"servers": {
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking@latest"],
"type": "stdio"
},

"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "${input:CONTEXT7_API_KEY}"
}
},
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch",
"--user-agent=\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15\"",
"--ignore-robots-txt"
],
"type": "stdio"
},
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--no-sandbox",
"--isolated",
"--image-responses",
"omit",
"--block-service-workers",
"--ignore-https-errors",
"--save-session",
"--save-trace"
],
"type": "stdio"
},
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"],
"type": "stdio"
}
},
"inputs": [
{
"id": "CONTEXT7_API_KEY",
"type": "promptString",
"description": "Your Context7 API key"
}
]
}
```

#### ➕ Benefits

* **Consistency:** Users maintain a single source of truth for their Copilot configuration across VS Code and the CLI.
* **Ease of Setup:** Reduces redundant configuration steps.
* **Standardization:** Aligns the CLI's behavior with the common configuration practices of the VS Code ecosystem.

This integration would significantly enhance the workflow for developers heavily using both VS Code and the Copilot CLI.

### Example prompts or workflows

_No response_

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。