github / github/copilot-cli

feat: Plugin dependency/companion MCP server declaration in plugin.json

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

描述

## Problem

When building a Copilot CLI plugin, there's no way to declare dependencies on external MCP servers that the plugin's skills need. A plugin can register its own MCP servers via `.mcp.json`, but it can't express "this plugin works best when WorkIQ / Fabric Power BI / Azure DevOps MCP servers are also available."

This creates a fragmented experience where users install a plugin but then need to manually configure companion MCP servers in `~/.copilot/mcp-config.json` to get the full value.

## Context

I maintain [MSX-MCP](https://github.com/mcaps-microsoft/MSX-MCP), a plugin with 29 MCP tools and 15 skills for Microsoft Sales data. Several of our skills would benefit from M365 data (emails, meetings, Teams messages) via the [WorkIQ MCP server](https://www.npmjs.com/package/@microsoft/workiq), and we already bundle the [Fabric Power BI MCP server](https://api.fabric.microsoft.com/v1/mcp/powerbi) in our `.mcp.json`.

A related project ([MCAPS-IQ](https://github.com/microsoft/mcaps-iq)) solves this by putting everything in `.vscode/mcp.json` -- but that's a VS Code workspace config, not a portable plugin. Users who want the same experience in Copilot CLI have to manually configure each companion server.

## Current state

**What plugins CAN do:**
- Register their own MCP servers in `.mcp.json` (stdio or http)
- Bundle skills and agents

**What plugins CANNOT do:**
- Declare optional/required companion MCP servers (e.g., "also install WorkIQ")
- Declare dependencies on other plugins
- Suggest user-level `mcp-config.json` additions at install time

## Additional complexity: config format divergence

The CLI and VS Code use different MCP config formats, making it harder to share configurations:

| Surface | File | Root Key | Type Values |
|---------|------|----------|-------------|
| Copilot CLI (user-level) | `~/.copilot/mcp-config.json` | `mcpServers` | `local`, `http` |
| Copilot CLI (plugin) | `.mcp.json` | `mcpServers` | `stdio`, `http` |
| VS Code | `.vscode/mcp.json` | `servers` | `stdio`, `http` |

A plugin author can't provide one config that works for both CLI and VS Code.

## Possible solutions

1. **`companionServers` in plugin.json** -- optional array of MCP server configs that get merged into the user's `mcp-config.json` at `copilot plugin install` time (with user confirmation)

2. **`dependencies` in plugin.json** -- declare other plugins or npm packages that should be installed alongside (similar to npm `peerDependencies`)

3. **Post-install hook** -- let plugins run a setup script that can suggest or configure companion servers

4. **Unified MCP config format** -- converge CLI and VS Code on a single schema so configurations are portable

## Impact

This affects any plugin that needs to compose multiple MCP servers into a coherent experience -- not just MSX tools. AI agent plugins that combine domain-specific servers (CRM, analytics) with general-purpose ones (calendar, email, file storage) all face this packaging gap.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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