github / github/copilot-cli

Support per-agent LSP server configuration in agent frontmatter

オープン
#2,728 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:agents area:configuration
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Feature request

**Is your feature request related to a problem?**

I am building a multi-agent system where each agent has a different specialization. Agents already support per-agent MCP server configs via `mcp-servers` in the YAML frontmatter, which is excellent — each agent only sees the external tools it needs.

However, LSP servers are configured globally (user-level `~/.copilot/lsp-config.json` or repo-level `.github/lsp.json`). There is no way to scope LSP servers to a specific agent.

This matters because different agents work with different languages and file types:

- A **morning-command-center** agent works primarily with Markdown and YAML (agent definitions, skill files, documentation). It needs `yaml-language-server` but has no use for `typescript-language-server`.
- A **deep-work-planner** agent investigates codebases and would benefit from TypeScript, Python, and SQL LSP servers for code navigation.
- A **communication-triage** agent classifies messages and drafts responses — it has no need for any LSP server at all.

With global-only LSP config, every agent loads every configured LSP server regardless of whether it will use them. This wastes resources and increases startup time, especially when you have 7+ agents and 9+ LSP servers configured globally.

**Describe the solution you would like**

Allow agents to declare LSP servers in their `.agent.md` frontmatter, similar to `mcp-servers`:

```yaml
---
name: deep-work-planner
lsp-servers:
typescript:
command: npx
args: ["--yes", "typescript-language-server", "--stdio"]
fileExtensions:
.ts: typescript
.tsx: typescript
python-typecheck:
command: npx
args: ["--yes", "pyright-langserver", "--stdio"]
fileExtensions:
.py: python
---
```

When an agent declares `lsp-servers`, only those LSP servers would be started for that agent session. If no `lsp-servers` block is present, fall back to the existing global/repo config.

**Describe alternatives you have considered**

- Maintaining separate repo-level `.github/lsp.json` files per project — but this does not solve per-agent isolation within the same repo.
- Not configuring LSP servers globally and relying only on agents that need them — but this breaks the default CLI experience outside of agents.

**Additional context**

This would bring LSP config parity with MCP config, which already supports per-agent scoping. The pattern is already established in the agent frontmatter format — this would extend it to LSP.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by comparing the existing mcp-servers handling in .agent.md frontmatter with the global ~/.copilot/lsp-config.json and repo-level .github/lsp.json configuration paths. Define how an lsp-servers block is parsed and scoped to an agent session, while preserving the existing global/repo fallback when it is absent. Done means per-agent LSP servers are isolated without changing the default CLI behavior.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
yaml
領域
cli, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。