github / github/copilot-cli

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

Abierto
#2,113 0 comentarios 2 reacciones 0 asignados Ver en GitHub
area:mcp area:plugins
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.