* Convert MCP server configs from public API format (workingDirectory) to * wire format (cwd) expected by the runtime.
(
mcpServers: Record<string, MCPServerConfig> | undefined
)
| 220 | * wire format (cwd) expected by the runtime. |
| 221 | */ |
| 222 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…