Title: Preload MCP server tools into the initial agent function list (instead of lazy discovery) · Issue #3787 · github/copilot-cli · GitHub
Open Graph Title: Preload MCP server tools into the initial agent function list (instead of lazy discovery) · Issue #3787 · github/copilot-cli
X Title: Preload MCP server tools into the initial agent function list (instead of lazy discovery) · Issue #3787 · github/copilot-cli
Description: Summary When a session starts, MCP tools registered via .mcp.json or --additional-mcp-config are lazy-loaded — they are not advertised in the agent's initial
Open Graph Description: Summary When a session starts, MCP tools registered via .mcp.json or --additional-mcp-config are lazy-loaded — they are not advertised in the agent's initial
X Description: Summary When a session starts, MCP tools registered via .mcp.json or --additional-mcp-config are lazy-loaded — they are not advertised in the agent's initial <available_tools> list. Agent...
Opengraph URL: https://github.com/github/copilot-cli/issues/3787
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Preload MCP server tools into the initial agent function list (instead of lazy discovery)","articleBody":"## Summary\n\nWhen a session starts, MCP tools registered via `.mcp.json` or `--additional-mcp-config` are **lazy-loaded** — they are not advertised in the agent's initial `\u003cavailable_tools>` list. Agents that don't know to probe for them (via `tool_search_tool_regex` or similar discovery) will not see they exist and may resort to less-appropriate built-in tools instead.\n\n## Concrete failure mode we hit\n\nWe ship a custom MCP server (`squad_state`) with [Squad](https://github.com/bradygaster/squad) that exposes 13 tools (7 `squad_state_*` + 6 `memory.*`). Squad agents are supposed to use these to write durable team state (decisions, agent history, governed memory) instead of raw `create` / `edit` / `write_file` against on-disk files.\n\nWhat we observed across multiple agent sessions:\n\n> *\"My session loaded with `powershell`, `view`, `create`, `edit`, `grep`, `glob`, `task`, `store_memory`, `vote_memory`, etc. — the squad MCP tools (`squad_state-*`) were **registered but not advertised** in the tool definitions block at the top of my prompt. I only found them just now by running `tool_search_tool_regex`.\"*\n\nBehaviour: agent silently writes `.squad/decisions.md` with `create` even though the contract requires going through `squad_state_write`. On a `two-layer` state backend (orphan branch + git notes) that write either fails at the pre-commit hook or creates phantom state the runtime overwrites at next read — silent data loss.\n\nWe worked around it with a documented \"state-backend handshake\" in the coordinator prompt that forces the agent to probe for the tools at session start (see [bradygaster/squad#1306](https://github.com/bradygaster/squad/pull/1306)). But this is defence in depth — the prompt cost shouldn't be necessary if the tools were in the initial function list.\n\n## Request\n\n**Advertise tools from `.mcp.json` / `--additional-mcp-config`-loaded MCP servers in the agent's initial `\u003cavailable_tools>` list at session start**, instead of (or in addition to) lazy discovery.\n\nOptional refinements:\n\n1. **Opt-in per server** — add a `\"preload\": true` flag to the MCP server entry so server authors can mark a server as eager-load.\n2. **Logging on connect** — print a one-line `⚙️ MCP server X connected; advertised N tools` on stdout/stderr at session start so users see which servers loaded without having to inspect `~/.copilot/logs/`.\n3. **Optional initial system-reminder banner** when external MCP tools are detected: `External MCP tools available: X, Y, Z. Use these for the operations they cover.` This nudges agents that don't proactively probe.\n\n## Why this matters for the broader ecosystem\n\nThis isn't a Squad-specific request. Any third party who ships a custom MCP server (memory, vector store, code-intelligence, telemetry, custom CI) hits the same wall: their tools exist but the agent doesn't know to ask. The pattern of \"register an MCP server then hope the agent probes for it\" is fragile and produces inconsistent agent behaviour across sessions.\n\nClosing this would let MCP-server authors trust that `.mcp.json` registration is enough — no per-prompt nudges needed.\n\n## Repro\n\n1. `npm i -g @bradygaster/squad-cli@insider`\n2. `mkdir test && cd test && git init && squad init`\n3. `copilot --agent squad --allow-all-tools -p \"list every tool you can call right now\"`\n4. Observe: `squad_state_*` / `memory.*` tools are NOT in the initial response. They are only discoverable via `tool_search_tool_regex` or by reading the .mcp.json.\n\nTested on Copilot CLI v1.0.62-2 (Windows 11, Node v24.14.0).\n\n## Filed by\n\nSquad maintainer team, surfaced during v0.10 stabilisation effort.","author":{"url":"https://github.com/tamirdresher","@type":"Person","name":"tamirdresher"},"datePublished":"2026-06-13T18:27:57Z","url":"https://github.com/github/copilot-cli/issues/3787"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e8866689-c589-3182-3641-0919ecf760e0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 860A:19AA62:1871480:1F107B4:6B014106 |
| html-safe-nonce | d931d46d645a87e616012a0d943c16da01c50537cd5532632d0ad92516bbb316 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjBBOjE5QUE2MjoxODcxNDgwOjFGMTA3QjQ6NkIwMTQxMDYiLCJ2aXNpdG9yX2lkIjoiNTAwMjU0NTQzMDE4NjI0NjQwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3c87ff9039355d91a33371b0fdd20f38ef38c9ec62056b91c4b09bdfc02ca6aa |
| hovercard-subject-tag | issue:4656504326 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/copilot-cli/3787/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71eda7001d6d6787c88a89117e235ea53de8ced022ade93a80b91bfc1332a689/github/copilot-cli/issues/3787 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71eda7001d6d6787c88a89117e235ea53de8ced022ade93a80b91bfc1332a689/github/copilot-cli/issues/3787 |
| og:image:alt | Summary When a session starts, MCP tools registered via .mcp.json or --additional-mcp-config are lazy-loaded — they are not advertised in the agent's initial |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tamirdresher |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/github/copilot-cli git https://github.com/github/copilot-cli.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 585860664 |
| octolytics-dimension-repository_nwo | github/copilot-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 585860664 |
| octolytics-dimension-repository_network_root_nwo | github/copilot-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width