MCPcopy Create free account
hub / github.com/github/copilot-sdk / toWireMcpServers

Function toWireMcpServers

nodejs/src/client.ts:222–235  ·  view source on GitHub ↗

* Convert MCP server configs from public API format (workingDirectory) to * wire format (cwd) expected by the runtime.

(
    mcpServers: Record<string, MCPServerConfig> | undefined
)

Source from the content-addressed store, hash-verified

220 * wire format (cwd) expected by the runtime.
221 */
222function toWireMcpServers(
223 mcpServers: Record<string, MCPServerConfig> | undefined
224): Record<string, unknown> | undefined {
225 if (!mcpServers) return undefined;
226 return Object.fromEntries(
227 Object.entries(mcpServers).map(([name, server]) => {
228 if ("workingDirectory" in server) {
229 const { workingDirectory, ...rest } = server;
230 return [name, { ...rest, cwd: workingDirectory }];
231 }
232 return [name, server];
233 })
234 );
235}
236
237/**
238 * Convert custom agent configs, transforming nested mcpServers from

Callers 3

toWireCustomAgentsFunction · 0.85
createSessionMethod · 0.85
resumeSessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…