github / github/copilot-cli

.github/lsp.json and .github/mcp.json do not work

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

描述

### Describe the bug

I have the following `.github/lsp.json`:

```json
{
"lspServers": {
"fsautocomplete": {
"command": "dotnet",
"args": ["fsautocomplete", "--stdio"],
"fileExtensions": {
".fs": "fsharp",
".fsx": "fsharp"
}
}
}
}
```

and `.github/mcp.json`:

```json
{
"mcpServers": {
"mslearn-mcp": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp",
"headers": {},
"tools": ["*"]
}
}
}
```

When I run `copilot` from the project root, neither of these work.

Image

If I use these exact same configs in `.copilot/lsp-config.json` and `.copiloty/mcp-config.json` they do work, and if I explicitly say `--additional-mcp-config @.github/mcp.json` it also works. Moving the mcp config to `.mcp.json` at the project root also gets picked up.

You will also notice that the fsautocomplete lsp is being detected (so clearly its finding the file) yet its missing a word in the format, which you can see in this example where I have it working in copilot config but failing in github config (in this case attempting to use `fsautocomplete` directly as a globally installed dotnet tool instead of a local one via `dotnet fsautocomplete`:

Image

### Affected version

GitHub Copilot CLI 1.0.2

### Steps to reproduce the behavior

1. Copy above json snippets into their respective files in a `.github` directory
2. Launch copilot cli with `copilot` from the directory above
3. Use `/lsp test fsautocomplete` and inspect `/mcp show` to see the problem occurring

### Expected behavior

These files are documented as though they should work as is. Intended behaviour is the lsp starting up successfully and the mslearn mcp connecting as normal.

### Additional context

I have attempted this on Windows, Debian WSL, and an Ubuntu based image in a Github Codespace, and all behave the same.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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