diff --git a/.changeset/mcp-config-locations.md b/.changeset/mcp-config-locations.md new file mode 100644 index 000000000..099aa55d8 --- /dev/null +++ b/.changeset/mcp-config-locations.md @@ -0,0 +1,6 @@ +--- +"@bradygaster/squad-cli": patch +"@bradygaster/squad-sdk": patch +--- + +Point users at MCP config files their host actually reads. The coordinator's MCP guide (`.squad/templates/mcp-config.md`) listed a project-level `.copilot/mcp-config.json` as the team-shared location and the coordinator told users to "Add it to `.copilot/mcp-config.json`", but Copilot CLI doesn't read that file. The guide now names the repo-root `.mcp.json` (next to `squad_state`), `.github/mcp.json`, `.vscode/mcp.json` (with its `servers` key), `~/.copilot/mcp-config.json`, and the files used by `--client` hosts. The `squad state-mcp --help` text and the MCP docs pages are corrected the same way. diff --git a/.github/agents/squad.agent.md b/.github/agents/squad.agent.md index 9284b0270..685881668 100644 --- a/.github/agents/squad.agent.md +++ b/.github/agents/squad.agent.md @@ -484,7 +484,7 @@ When spawning agents, include an `MCP TOOLS AVAILABLE` block in the prompt (see Never crash or halt because an MCP tool is missing. MCP tools are enhancements, not dependencies. 1. **CLI fallback** — GitHub MCP missing → use `gh` CLI. Azure MCP missing → use `az` CLI. -2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.copilot/mcp-config.json`." +2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.mcp.json` next to `squad_state`." (Other hosts: see `.squad/templates/mcp-config.md`.) 3. **Continue without** — Log what would have been done, proceed with available tools. ### Accountable Ownership diff --git a/.squad-templates/mcp-config.md b/.squad-templates/mcp-config.md index f38425e4c..2d465a121 100644 --- a/.squad-templates/mcp-config.md +++ b/.squad-templates/mcp-config.md @@ -4,11 +4,12 @@ MCP (Model Context Protocol) servers extend Squad with tools for external servic ## Config File Locations -Users configure MCP servers at these locations (checked in priority order): -1. **Repository-level:** `.copilot/mcp-config.json` (team-shared, committed to repo) -2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces) -3. **User-level:** `~/.copilot/mcp-config.json` (personal) -4. **CLI override:** `--additional-mcp-config` flag (session-specific) +Squad registers its own `squad_state` server in the repo-root `.mcp.json`. Users add other servers next to it, in the file their host reads: +1. **Repository-level:** `.mcp.json` at the repo root (team-shared, committed). Copilot CLI and Claude Code read it; Copilot CLI also reads `.github/mcp.json`. Copilot CLI loads project-level servers once the folder is trusted, and does not read a project-level `.copilot/mcp-config.json`. +2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces; the top-level key is `servers`, not `mcpServers`) +3. **User-level:** `~/.copilot/mcp-config.json` (personal; Copilot CLI loads it in every project, and VS Code reads it as its Copilot global config) +4. **CLI override:** `--additional-mcp-config @` flag (session-specific; `squad loop` and `squad watch` execute mode pass `@.mcp.json` this way) +5. **Other hosts** (`squad init --client ...`): Kiro `.kiro/settings/mcp.json`, Cursor `.cursor/mcp.json`, OpenCode `opencode.json` (`mcp`), Codex `.codex/config.toml` (`[mcp_servers.]`). For Antigravity use `agy mcp add`, because Squad regenerates `.agents/agents/squad.md`. ## Sample Config — Trello diff --git a/.squad-templates/squad.agent.md b/.squad-templates/squad.agent.md index 9284b0270..685881668 100644 --- a/.squad-templates/squad.agent.md +++ b/.squad-templates/squad.agent.md @@ -484,7 +484,7 @@ When spawning agents, include an `MCP TOOLS AVAILABLE` block in the prompt (see Never crash or halt because an MCP tool is missing. MCP tools are enhancements, not dependencies. 1. **CLI fallback** — GitHub MCP missing → use `gh` CLI. Azure MCP missing → use `az` CLI. -2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.copilot/mcp-config.json`." +2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.mcp.json` next to `squad_state`." (Other hosts: see `.squad/templates/mcp-config.md`.) 3. **Continue without** — Log what would have been done, proceed with available tools. ### Accountable Ownership diff --git a/docs/src/content/docs/concepts/portability.md b/docs/src/content/docs/concepts/portability.md index f775fcb79..c527e268d 100644 --- a/docs/src/content/docs/concepts/portability.md +++ b/docs/src/content/docs/concepts/portability.md @@ -170,8 +170,8 @@ MCP (Model Context Protocol) servers extend Squad with external services. Agents | Platform | Config File | |----------|------------| -| **Copilot CLI** | `.copilot/mcp-config.json` | -| **VS Code** | `.vscode/settings.json` (under `copilot.mcp.servers`) | +| **Copilot CLI** | `.mcp.json` at the repo root (shared) or `~/.copilot/mcp-config.json` (personal). Not a project-level `.copilot/mcp-config.json`. | +| **VS Code** | `.vscode/mcp.json` (top-level key `servers`) or `~/.copilot/mcp-config.json` | ### Example: GitHub MCP ```json diff --git a/docs/src/content/docs/features/enterprise-platforms.md b/docs/src/content/docs/features/enterprise-platforms.md index 6f872fa94..448fdc21e 100644 --- a/docs/src/content/docs/features/enterprise-platforms.md +++ b/docs/src/content/docs/features/enterprise-platforms.md @@ -106,7 +106,7 @@ Squad uses the Azure CLI for ADO authentication — **no Personal Access Tokens For GitHub repositories, Squad uses the `gh` CLI for authentication. When working across multiple GitHub accounts (e.g., personal GitHub and Enterprise Managed Users), use `gh auth switch` to toggle between accounts. See [Cross-organization authentication](../scenarios/cross-org-auth) for detailed multi-account setup. -Alternatively, if the Azure DevOps MCP server is configured in your environment, Squad will use it automatically for richer API access. Add it to `.copilot/mcp-config.json`: +Alternatively, if the Azure DevOps MCP server is configured in your environment, Squad will use it automatically for richer API access. Add it to `.mcp.json` at the repo root, next to `squad_state` (or to `~/.copilot/mcp-config.json` to keep it personal): ```json { diff --git a/docs/src/content/docs/features/mcp.md b/docs/src/content/docs/features/mcp.md index 70c23ef8e..624850367 100644 --- a/docs/src/content/docs/features/mcp.md +++ b/docs/src/content/docs/features/mcp.md @@ -22,19 +22,23 @@ MCP bridges Squad agents and external services. Agents use MCP tools to send not ## MCP Configuration Files -There are two places to configure MCP, depending on your platform: +Where you add a server depends on your host: | Platform | Config File | How to Edit | Startup | |----------|------------|-----------|---------| -| **Copilot CLI** | `.copilot/mcp-config.json` | Text editor | Add to shell initialization (`~/.bashrc`, `~/.zshrc`, etc.) | -| **VS Code** | `.vscode/settings.json` | VS Code Settings GUI or JSON editor | Built-in; restarts Copilot extension | +| **Copilot CLI** | `.mcp.json` at the repo root (shared with your team; Squad's `squad_state` server already lives there) or `~/.copilot/mcp-config.json` (personal, every project) | Text editor | Add to shell initialization (`~/.bashrc`, `~/.zshrc`, etc.) | +| **VS Code** | `.vscode/mcp.json` (top-level key `servers`) or `~/.copilot/mcp-config.json` | Text editor, or **MCP: Add Server** from the Command Palette | Built-in; start or restart from **MCP: List Servers** | -This guide covers both. Pick the one that matches your workflow. +Copilot CLI doesn't read a `.copilot/mcp-config.json` inside the project (`squad init` writes a sample one there), so a server added to it never loads. Hosts added with `squad init --client` have their own MCP config (Claude Code shares `.mcp.json`), and Squad adds `squad_state` to it for you. + +This guide covers Copilot CLI and VS Code. Pick the one that matches your workflow. --- ## Step-by-Step: CLI Setup +These steps use your personal config, `~/.copilot/mcp-config.json`. To share a server with your team, add the same `mcpServers` entry to `.mcp.json` at the repo root instead, next to `squad_state`, and commit it. Copilot CLI loads project servers once you trust the folder. + ### Step 1: Create the `.copilot` directory and config file Open your terminal: @@ -53,7 +57,7 @@ Open `~/.copilot/mcp-config.json` in your editor: nano ~/.copilot/mcp-config.json # Windows (PowerShell) -notepad $PROFILE\..\mcp-config.json +notepad $HOME\.copilot\mcp-config.json ``` Paste this base structure: @@ -115,30 +119,24 @@ If configured correctly, you'll see your GitHub server and its available tools ( ## Step-by-Step: VS Code Setup -### Step 1: Open VS Code Settings - -- **macOS:** Code → Preferences → Settings -- **Windows:** File → Preferences → Settings - -Or use the keyboard shortcut: `Cmd+,` (macOS) or `Ctrl+,` (Windows). +### Step 1: Open the workspace MCP config -### Step 2: Search for "MCP" +Create `.vscode/mcp.json` in your project, or run **MCP: Add Server** from the Command Palette (`Cmd+Shift+P` on macOS, `Ctrl+Shift+P` on Windows) and follow the prompts. -In the settings search box, type `MCP` to find Copilot extension settings. +### Step 2: Add an MCP server -### Step 3: Add an MCP server - -Look for the **"Copilot MCP Servers"** section (or similar — naming varies by Copilot version). - -Click **"Edit in settings.json"** to see the raw configuration: +VS Code uses a top-level `servers` key, not `mcpServers`: ```json -"copilot.mcp.servers": { - "github": { - "command": "node", - "args": ["/absolute/path/to/github-mcp.js"], - "env": { - "GITHUB_TOKEN": "${env:GITHUB_TOKEN}" +{ + "servers": { + "github": { + "type": "stdio", + "command": "node", + "args": ["/absolute/path/to/github-mcp.js"], + "env": { + "GITHUB_TOKEN": "${env:GITHUB_TOKEN}" + } } } } @@ -146,7 +144,9 @@ Click **"Edit in settings.json"** to see the raw configuration: The `${env:GITHUB_TOKEN}` syntax reads from your shell environment. Replace `/absolute/path/to/github-mcp.js` with the actual path to your MCP server script. -### Step 4: Add environment variables +To keep a server personal instead, VS Code also reads `~/.copilot/mcp-config.json`, the same file Copilot CLI uses (with `mcpServers`). + +### Step 3: Add environment variables Open your VS Code integrated terminal (`` Ctrl+` `` or `` Cmd+` ``): @@ -156,17 +156,17 @@ export GITHUB_TOKEN=$(gh auth token) This sets the token for the current terminal session. To make it permanent, add it to your shell profile (see CLI Step 3 above). -### Step 5: Reload VS Code +### Step 4: Start the server -Press `Cmd+Shift+P` (macOS) or `Ctrl+Shift+P` (Windows) and select **"Copilot: Reload Copilot Servers"**. +Run **MCP: List Servers** from the Command Palette, select the server, and choose **Start Server** (or **Restart Server** after you change its config). VS Code can also start servers on its own when you send a chat message. --- -## Example: GitHub MCP (Already Included) +## Example: GitHub MCP -Most Squad installs come with GitHub MCP pre-configured. Here's what it looks like: +Here's what a GitHub MCP entry looks like: -### CLI: `.copilot/mcp-config.json` +### Copilot CLI: `.mcp.json` or `~/.copilot/mcp-config.json` ```json { @@ -184,12 +184,13 @@ Most Squad installs come with GitHub MCP pre-configured. Here's what it looks li Replace `/absolute/path/to/github-mcp.js` with the actual path to your GitHub MCP server script. -### VS Code: `.vscode/settings.json` +### VS Code: `.vscode/mcp.json` ```json { - "copilot.mcp.servers": { + "servers": { "github": { + "type": "stdio", "command": "node", "args": ["/absolute/path/to/github-mcp.js"], "env": { @@ -352,20 +353,23 @@ Agents don't need special setup to discover tools. Here's the flow: **Fix:** -1. **Verify config syntax:** +1. **Verify the server is in a file your host reads:** for Copilot CLI that's `.mcp.json` at the repo root, `.github/mcp.json`, or `~/.copilot/mcp-config.json`. A server in the project's `.copilot/mcp-config.json` is never loaded; move it to `.mcp.json`. + +2. **Verify config syntax:** ```bash # CLI + cat .mcp.json | jq . cat ~/.copilot/mcp-config.json | jq . # Should be valid JSON; if not, `jq` will error ``` -2. **Restart Copilot to reload config:** +3. **Restart Copilot to reload config:** ```bash copilot quit copilot ``` -3. **Test the MCP server directly:** +4. **Test the MCP server directly:** ```bash node /absolute/path/to/mcp-server.js ``` diff --git a/docs/src/content/docs/features/notifications.md b/docs/src/content/docs/features/notifications.md index 51a87fc87..732397125 100644 --- a/docs/src/content/docs/features/notifications.md +++ b/docs/src/content/docs/features/notifications.md @@ -372,7 +372,7 @@ For advanced use cases, you can also: ## Sample MCP Configs -Below are complete, copy-pasteable `.copilot/mcp-config.json` examples for each notification platform. Pick the one that matches your setup and copy the entire `mcpServers` block into your config file. +Below are complete, copy-pasteable MCP config examples for each notification platform. Pick the one that matches your setup and copy the entire `mcpServers` block into `.mcp.json` at the repo root (next to `squad_state`) or into `~/.copilot/mcp-config.json`. For VS Code's `.vscode/mcp.json`, put the entries under `servers` instead. ### Teams Webhook (Simplest) diff --git a/packages/squad-cli/src/cli/commands/state-mcp.ts b/packages/squad-cli/src/cli/commands/state-mcp.ts index 51d146b43..6b930a2cb 100644 --- a/packages/squad-cli/src/cli/commands/state-mcp.ts +++ b/packages/squad-cli/src/cli/commands/state-mcp.ts @@ -312,8 +312,10 @@ export function printStateMcpHelp(): void { '', 'Usage: squad state-mcp [--experimental-backend]', '', - 'This command is intended to be launched by GitHub Copilot CLI through', - '.copilot/mcp-config.json. It exposes squad_decide, squad_state_* and', + 'This command is intended to be launched by your MCP host from the', + 'squad_state entry Squad writes to the repo-root .mcp.json (--client', + 'hosts get it in their own MCP config file). It exposes squad_decide,', + 'squad_state_* and', 'squad_state_upstreams (declared upstream inheritance, read from local', 'snapshots only) backed by the configured Squad state backend. Pass', '--experimental-backend', diff --git a/packages/squad-cli/templates/mcp-config.md b/packages/squad-cli/templates/mcp-config.md index f38425e4c..2d465a121 100644 --- a/packages/squad-cli/templates/mcp-config.md +++ b/packages/squad-cli/templates/mcp-config.md @@ -4,11 +4,12 @@ MCP (Model Context Protocol) servers extend Squad with tools for external servic ## Config File Locations -Users configure MCP servers at these locations (checked in priority order): -1. **Repository-level:** `.copilot/mcp-config.json` (team-shared, committed to repo) -2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces) -3. **User-level:** `~/.copilot/mcp-config.json` (personal) -4. **CLI override:** `--additional-mcp-config` flag (session-specific) +Squad registers its own `squad_state` server in the repo-root `.mcp.json`. Users add other servers next to it, in the file their host reads: +1. **Repository-level:** `.mcp.json` at the repo root (team-shared, committed). Copilot CLI and Claude Code read it; Copilot CLI also reads `.github/mcp.json`. Copilot CLI loads project-level servers once the folder is trusted, and does not read a project-level `.copilot/mcp-config.json`. +2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces; the top-level key is `servers`, not `mcpServers`) +3. **User-level:** `~/.copilot/mcp-config.json` (personal; Copilot CLI loads it in every project, and VS Code reads it as its Copilot global config) +4. **CLI override:** `--additional-mcp-config @` flag (session-specific; `squad loop` and `squad watch` execute mode pass `@.mcp.json` this way) +5. **Other hosts** (`squad init --client ...`): Kiro `.kiro/settings/mcp.json`, Cursor `.cursor/mcp.json`, OpenCode `opencode.json` (`mcp`), Codex `.codex/config.toml` (`[mcp_servers.]`). For Antigravity use `agy mcp add`, because Squad regenerates `.agents/agents/squad.md`. ## Sample Config — Trello diff --git a/packages/squad-cli/templates/squad.agent.md.template b/packages/squad-cli/templates/squad.agent.md.template index 9284b0270..685881668 100644 --- a/packages/squad-cli/templates/squad.agent.md.template +++ b/packages/squad-cli/templates/squad.agent.md.template @@ -484,7 +484,7 @@ When spawning agents, include an `MCP TOOLS AVAILABLE` block in the prompt (see Never crash or halt because an MCP tool is missing. MCP tools are enhancements, not dependencies. 1. **CLI fallback** — GitHub MCP missing → use `gh` CLI. Azure MCP missing → use `az` CLI. -2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.copilot/mcp-config.json`." +2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.mcp.json` next to `squad_state`." (Other hosts: see `.squad/templates/mcp-config.md`.) 3. **Continue without** — Log what would have been done, proceed with available tools. ### Accountable Ownership diff --git a/packages/squad-sdk/templates/mcp-config.md b/packages/squad-sdk/templates/mcp-config.md index f38425e4c..2d465a121 100644 --- a/packages/squad-sdk/templates/mcp-config.md +++ b/packages/squad-sdk/templates/mcp-config.md @@ -4,11 +4,12 @@ MCP (Model Context Protocol) servers extend Squad with tools for external servic ## Config File Locations -Users configure MCP servers at these locations (checked in priority order): -1. **Repository-level:** `.copilot/mcp-config.json` (team-shared, committed to repo) -2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces) -3. **User-level:** `~/.copilot/mcp-config.json` (personal) -4. **CLI override:** `--additional-mcp-config` flag (session-specific) +Squad registers its own `squad_state` server in the repo-root `.mcp.json`. Users add other servers next to it, in the file their host reads: +1. **Repository-level:** `.mcp.json` at the repo root (team-shared, committed). Copilot CLI and Claude Code read it; Copilot CLI also reads `.github/mcp.json`. Copilot CLI loads project-level servers once the folder is trusted, and does not read a project-level `.copilot/mcp-config.json`. +2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces; the top-level key is `servers`, not `mcpServers`) +3. **User-level:** `~/.copilot/mcp-config.json` (personal; Copilot CLI loads it in every project, and VS Code reads it as its Copilot global config) +4. **CLI override:** `--additional-mcp-config @` flag (session-specific; `squad loop` and `squad watch` execute mode pass `@.mcp.json` this way) +5. **Other hosts** (`squad init --client ...`): Kiro `.kiro/settings/mcp.json`, Cursor `.cursor/mcp.json`, OpenCode `opencode.json` (`mcp`), Codex `.codex/config.toml` (`[mcp_servers.]`). For Antigravity use `agy mcp add`, because Squad regenerates `.agents/agents/squad.md`. ## Sample Config — Trello diff --git a/packages/squad-sdk/templates/squad.agent.md.template b/packages/squad-sdk/templates/squad.agent.md.template index 9284b0270..685881668 100644 --- a/packages/squad-sdk/templates/squad.agent.md.template +++ b/packages/squad-sdk/templates/squad.agent.md.template @@ -484,7 +484,7 @@ When spawning agents, include an `MCP TOOLS AVAILABLE` block in the prompt (see Never crash or halt because an MCP tool is missing. MCP tools are enhancements, not dependencies. 1. **CLI fallback** — GitHub MCP missing → use `gh` CLI. Azure MCP missing → use `az` CLI. -2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.copilot/mcp-config.json`." +2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.mcp.json` next to `squad_state`." (Other hosts: see `.squad/templates/mcp-config.md`.) 3. **Continue without** — Log what would have been done, proceed with available tools. ### Accountable Ownership diff --git a/templates/mcp-config.md b/templates/mcp-config.md index f38425e4c..2d465a121 100644 --- a/templates/mcp-config.md +++ b/templates/mcp-config.md @@ -4,11 +4,12 @@ MCP (Model Context Protocol) servers extend Squad with tools for external servic ## Config File Locations -Users configure MCP servers at these locations (checked in priority order): -1. **Repository-level:** `.copilot/mcp-config.json` (team-shared, committed to repo) -2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces) -3. **User-level:** `~/.copilot/mcp-config.json` (personal) -4. **CLI override:** `--additional-mcp-config` flag (session-specific) +Squad registers its own `squad_state` server in the repo-root `.mcp.json`. Users add other servers next to it, in the file their host reads: +1. **Repository-level:** `.mcp.json` at the repo root (team-shared, committed). Copilot CLI and Claude Code read it; Copilot CLI also reads `.github/mcp.json`. Copilot CLI loads project-level servers once the folder is trusted, and does not read a project-level `.copilot/mcp-config.json`. +2. **Workspace-level:** `.vscode/mcp.json` (VS Code workspaces; the top-level key is `servers`, not `mcpServers`) +3. **User-level:** `~/.copilot/mcp-config.json` (personal; Copilot CLI loads it in every project, and VS Code reads it as its Copilot global config) +4. **CLI override:** `--additional-mcp-config @` flag (session-specific; `squad loop` and `squad watch` execute mode pass `@.mcp.json` this way) +5. **Other hosts** (`squad init --client ...`): Kiro `.kiro/settings/mcp.json`, Cursor `.cursor/mcp.json`, OpenCode `opencode.json` (`mcp`), Codex `.codex/config.toml` (`[mcp_servers.]`). For Antigravity use `agy mcp add`, because Squad regenerates `.agents/agents/squad.md`. ## Sample Config — Trello diff --git a/templates/squad.agent.md.template b/templates/squad.agent.md.template index 9284b0270..685881668 100644 --- a/templates/squad.agent.md.template +++ b/templates/squad.agent.md.template @@ -484,7 +484,7 @@ When spawning agents, include an `MCP TOOLS AVAILABLE` block in the prompt (see Never crash or halt because an MCP tool is missing. MCP tools are enhancements, not dependencies. 1. **CLI fallback** — GitHub MCP missing → use `gh` CLI. Azure MCP missing → use `az` CLI. -2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.copilot/mcp-config.json`." +2. **Inform the user** — "Trello integration requires the Trello MCP server. Add it to `.mcp.json` next to `squad_state`." (Other hosts: see `.squad/templates/mcp-config.md`.) 3. **Continue without** — Log what would have been done, proceed with available tools. ### Accountable Ownership diff --git a/test/mcp-config-locations.test.ts b/test/mcp-config-locations.test.ts new file mode 100644 index 000000000..697a8d01d --- /dev/null +++ b/test/mcp-config-locations.test.ts @@ -0,0 +1,47 @@ +/** + * MCP config location guidance. + * + * Copilot CLI reads `.mcp.json` (cwd up to the repo root), `.github/mcp.json` + * and `~/.copilot/mcp-config.json`. It does not read a project-level + * `.copilot/mcp-config.json`, which is why Squad moved `squad_state` to + * `.mcp.json` (see `mcp-root.ts`). The coordinator's MCP guide and its + * "add the server" fallback must point users at a file the host loads. + */ + +import { describe, it, expect } from 'vitest'; +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +const root = join(__dirname, '..'); +const read = (rel: string) => readFileSync(join(root, rel), 'utf8').replace(/\r\n/g, '\n'); + +const MCP_GUIDES = [ + 'templates/mcp-config.md', + '.squad-templates/mcp-config.md', + 'packages/squad-cli/templates/mcp-config.md', + 'packages/squad-sdk/templates/mcp-config.md', +]; + +const COORDINATORS = [ + 'templates/squad.agent.md.template', + '.squad-templates/squad.agent.md', + 'packages/squad-cli/templates/squad.agent.md.template', + 'packages/squad-sdk/templates/squad.agent.md.template', + '.github/agents/squad.agent.md', +]; + +describe('MCP config locations in coordinator templates', () => { + it.each(MCP_GUIDES)('%s names the repo-root .mcp.json as the shared location', (rel) => { + const guide = read(rel); + expect(guide).toMatch(/\*\*Repository-level:\*\* `\.mcp\.json` at the repo root/); + expect(guide).not.toMatch(/\*\*Repository-level:\*\* `\.copilot\/mcp-config\.json`/); + expect(guide).toContain('`.vscode/mcp.json`'); + expect(guide).toContain('`~/.copilot/mcp-config.json`'); + }); + + it.each(COORDINATORS)('%s does not tell users to add servers to .copilot/mcp-config.json', (rel) => { + const coordinator = read(rel); + expect(coordinator).not.toContain('Add it to `.copilot/mcp-config.json`'); + expect(coordinator).toContain('Add it to `.mcp.json` next to `squad_state`'); + }); +});