renderStandardJSONMCPConfig is a shared helper for JSON MCP config rendering used by Claude, Gemini, Copilot, and Codex engines. It consolidates the repeated sequence of: buildMCPRendererFactory → buildMCPGatewayConfig → buildStandardJSONMCPRenderers → RenderJSONMCPConfig.
( yaml *strings.Builder, opts renderStandardJSONMCPConfigOptions, )
| 114 | // Claude, Gemini, Copilot, and Codex engines. It consolidates the repeated sequence of: |
| 115 | // buildMCPRendererFactory → buildMCPGatewayConfig → buildStandardJSONMCPRenderers → RenderJSONMCPConfig. |
| 116 | func renderStandardJSONMCPConfig( |
| 117 | yaml *strings.Builder, |
| 118 | opts renderStandardJSONMCPConfigOptions, |
| 119 | ) error { |
| 120 | tools := opts.tools |
| 121 | mcpTools := opts.mcpTools |
| 122 | workflowData := opts.workflowData |
| 123 | configPath := opts.configPath |
| 124 | includeCopilotFields := opts.includeCopilotFields |
| 125 | inlineArgs := opts.inlineArgs |
| 126 | renderCustom := opts.renderCustom |
| 127 | filterTool := opts.filterTool |
| 128 | mcpRenderingLog.Printf("Rendering standard JSON MCP config: config_path=%s tools=%d mcp_tools=%d", configPath, len(tools), len(mcpTools)) |
| 129 | createRenderer := buildMCPRendererFactory(workflowData, "json", includeCopilotFields, inlineArgs) |
| 130 | |
| 131 | // CLI-mounted servers are NOT excluded from the gateway config. |
| 132 | // The gateway must start their Docker containers so that: |
| 133 | // 1. The CLI manifest (saved by start_mcp_gateway.cjs) includes them. |
| 134 | // 2. mount_mcp_as_cli.cjs can query their tool lists and create wrappers. |
| 135 | // Exclusion from the agent's final MCP config happens inside each |
| 136 | // convert_gateway_config_*.cjs script via GH_AW_MCP_CLI_SERVERS. |
| 137 | |
| 138 | return RenderJSONMCPConfig(yaml, tools, mcpTools, workflowData, JSONMCPConfigOptions{ |
| 139 | ConfigPath: configPath, |
| 140 | GatewayConfig: buildMCPGatewayConfig(workflowData), |
| 141 | Renderers: buildStandardJSONMCPRenderers(workflowData, createRenderer, renderCustom), |
| 142 | FilterTool: filterTool, |
| 143 | }) |
| 144 | } |
| 145 | |
| 146 | // buildMCPRendererFactory creates a factory function for MCPConfigRendererUnified instances. |
| 147 | // The returned function accepts isLast as a parameter and creates a renderer with engine-specific |
no test coverage detected