GitHub Copilot CLI
Why this agent
GitHub Copilot CLI 把 GitHub Copilot 的编程 agent 直接带到终端里。引用它的上游 README:
MCP-powered extensibility: Take advantage of the fact that the coding agent ships with GitHub’s MCP server by default and supports custom MCP servers to extend capabilities.
(中文意译:MCP 驱动的可扩展性。 Copilot CLI 的编程 agent 自带 GitHub 自家的 MCP 服务,还支持自定义 MCP 服务以扩展能力。)
所以 espctl 可以作为自定义 MCP 服务接进 Copilot CLI —— 但具体的 config-file schema 在 docs.github.com/copilot/concepts/agents/about-copilot-cli 里,开源仓库里没有。
Prerequisites
- 已安装 GitHub Copilot CLI(
brew install copilot-cli、npm install -g @github/copilot,或curl -fsSL https://gh.io/copilot-install | bash)。 - 有效的 GitHub Copilot 订阅。
copilot --version能跑。espctl已安装在磁盘上某个稳定位置。
Install snippet (or alternative)
这个 agent 在 本套 MCP 覆盖中目前是 documented-stub ——
不是因为 Copilot CLI 不支持 MCP(它支持的),而是因为标准的
config-file schema 不在任何能机械抓取的公开仓库 .md 文件里。
用户文档站 docs.github.com 有讲,但需要我们目前不脚本化的运行时
访问。
推荐路径 —— 看 Copilot CLI 自己的运行时 MCP 命令。按 README:
“其他子命令在 copilot --help 里。” 试试:
copilot mcp list # 看已注册的 MCP 服务
copilot mcp add --help # 看添加服务的语法
预计的形态和 Claude Code 的 mcpServers 类似
(大多数新一代 MCP 支持的 agent 都汇聚到这个形态),但具体的
config-file 路径和 key 名需要从 copilot mcp 输出或
GitHub 文档
里确认。
Alternative —— 调用浏览器侧 HTTP MCP 端点:
https://esphome.cloud/mcp/esp-idf
GitHub Copilot CLI 可以通过 HTTP-MCP 传输指向这个 URL (如果它的 config 支持 HTTP MCP 的话 —— 多数 Microsoft 系 agent 都为了和 GitHub 自家 MCP server 一流兼容而支持 HTTP)。
First-run verification
验证 alternative 端点可达:
curl -fsSL https://esphome.cloud/mcp/esp-idf | head -1
预期:200 OK JSON 响应。
如果你已经通过 copilot mcp list 找到了 config-file 路径,在
Copilot CLI 里验证:
copilot
> 你能调用哪些 espctl 工具?
预期:列出约 40 个 espctl 工具。
Troubleshooting
mcp/esp-idf返回 404 / 5xx —— 看 esphome.cloud 状态。copilot mcp add报 unknown subcommand —— 你的 Copilot CLI 版本可能在 MCP 支持之前。按你的安装方式更新。- 想要验证过的静态 install 片段? 当你通过
copilot mcp list或 docs.github.com 找到了标准的 config-file 路径后,到本项目 仓库提一个 issue,就能加 install:// 分支。
Tested as-of 2026-05-19
GitHub Copilot CLI 特有注意事项
- CLI 用
~/.copilot/lsp-config.json做 LSP 配置;按惯例 MCP-server 配置可能在~/.copilot/mcp.json或类似位置(未验证)。 - GitHub Copilot CLI 的 “MCP server” 一部分是服务端的(自带的 GitHub MCP server);自定义 MCP server 是在那之外的扩展。
- 这个 CLI 需要 GitHub Copilot 订阅 —— 和已经在
gh里好几年 的gh copilot suggest扩展不同。