feat: auto-discover MCP servers from project and user config files

Scan .vscode/mcp.json, .mcp.json, .copilot/mcp.json (project-level) and
~/.copilot/mcp.json (user-level) for MCP server definitions. Discovered
servers require explicit user acceptance before activation.

Backend:
- Add ConfigScannerRegistry with per-format scanners and  substitution
- Add discovered tooling domain model with fingerprint-based change detection
- Integrate scanning into workspace load, project add, and project selection
- Merge accepted discovered MCPs into effective runtime tooling
- Extend sidecar contracts with env/headers for real-world MCP configs
- Add IPC channels for accept/dismiss/rescan operations

Frontend:
- Add DiscoveredToolingModal for reviewing pending MCP servers
- Auto-show modal when pending discoveries exist on load or project switch
- Add amber badge on sidebar project headers for pending discoveries
- Add discovered MCP section in Settings panel with accept/dismiss/rescan
- Group InlinePills tool dropdown by Workspace MCP / User MCP / Project MCP
- Pass effective project tooling (including accepted discoveries) to ChatPane

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-25 21:54:06 +01:00
co-authored by Copilot
parent 08a1132d86
commit e5878ba9e8
27 changed files with 2466 additions and 45 deletions
+21 -1
View File
@@ -17,10 +17,21 @@ const TOOLING: WorkspaceToolingSettings = {
command: 'node',
args: ['server.js'],
cwd: 'C:\\workspace\\repo',
env: { DEBUG: 'true' },
tools: ['git.status'],
createdAt: TIMESTAMP,
updatedAt: TIMESTAMP,
},
{
id: 'mcp-remote',
name: 'Remote MCP',
transport: 'http',
url: 'https://example.com/mcp',
headers: { Authorization: 'Bearer token' },
tools: ['remote.tool'],
createdAt: TIMESTAMP,
updatedAt: TIMESTAMP,
},
],
lspProfiles: [
{
@@ -61,7 +72,7 @@ describe('session tooling config helpers', () => {
test('builds a run-turn tooling config from selected MCP and LSP ids', () => {
expect(
buildRunTurnToolingConfig(TOOLING, {
enabledMcpServerIds: ['mcp-git'],
enabledMcpServerIds: ['mcp-git', 'mcp-remote'],
enabledLspProfileIds: ['lsp-ts'],
}),
).toEqual({
@@ -74,6 +85,15 @@ describe('session tooling config helpers', () => {
command: 'node',
args: ['server.js'],
cwd: 'C:\\workspace\\repo',
env: { DEBUG: 'true' },
},
{
id: 'mcp-remote',
name: 'Remote MCP',
transport: 'http',
tools: ['remote.tool'],
url: 'https://example.com/mcp',
headers: { Authorization: 'Bearer token' },
},
],
lspProfiles: [