github-copilot-cli: preserve args for local-type MCP servers

forCopilotFormat only checked for type == "stdio" to add back args,
missing the case where a server already has type = "local" (e.g. set
directly by a third-party module). This caused args to be absent in the
generated mcp-config.json, failing validation.

Also, running forCopilotFormat as an extraTransform meant it ran inside
transformMcpServer, which then filtered out args = [] in its cleanup
pass. Move forCopilotFormat to run after transformMcpServer so the
empty args list is preserved in the output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Josef Hofer
2026-06-25 19:05:07 +02:00
committed by Austin Horstman
parent 3b3ff17621
commit 085e92b04a
2 changed files with 24 additions and 20 deletions

View File

@@ -15,6 +15,7 @@
"type": "local"
},
"fetch": {
"args": [],
"command": "mcp-server-fetch",
"tools": [
"*"