diff --git a/.github/workflows/archie.lock.yml b/.github/workflows/archie.lock.yml index 2159cfc16f..1829c82a6d 100644 --- a/.github/workflows/archie.lock.yml +++ b/.github/workflows/archie.lock.yml @@ -421,7 +421,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml index f7ec0ae316..5e2ba19493 100644 --- a/.github/workflows/cloclo.lock.yml +++ b/.github/workflows/cloclo.lock.yml @@ -557,7 +557,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/.github/workflows/daily-compiler-quality.lock.yml b/.github/workflows/daily-compiler-quality.lock.yml index 6538725263..dbf3b09855 100644 --- a/.github/workflows/daily-compiler-quality.lock.yml +++ b/.github/workflows/daily-compiler-quality.lock.yml @@ -410,7 +410,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/daily-file-diet.lock.yml b/.github/workflows/daily-file-diet.lock.yml index f626c3118b..26ecff5b0c 100644 --- a/.github/workflows/daily-file-diet.lock.yml +++ b/.github/workflows/daily-file-diet.lock.yml @@ -423,7 +423,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/daily-testify-uber-super-expert.lock.yml b/.github/workflows/daily-testify-uber-super-expert.lock.yml index b3442d04fe..35c605fb97 100644 --- a/.github/workflows/daily-testify-uber-super-expert.lock.yml +++ b/.github/workflows/daily-testify-uber-super-expert.lock.yml @@ -433,7 +433,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/developer-docs-consolidator.lock.yml b/.github/workflows/developer-docs-consolidator.lock.yml index 4465a3ef24..ab14dc0082 100644 --- a/.github/workflows/developer-docs-consolidator.lock.yml +++ b/.github/workflows/developer-docs-consolidator.lock.yml @@ -470,7 +470,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/.github/workflows/glossary-maintainer.lock.yml b/.github/workflows/glossary-maintainer.lock.yml index 4c3473be68..80282eb238 100644 --- a/.github/workflows/glossary-maintainer.lock.yml +++ b/.github/workflows/glossary-maintainer.lock.yml @@ -421,7 +421,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/go-fan.lock.yml b/.github/workflows/go-fan.lock.yml index b6bc7a4f49..409b2b924d 100644 --- a/.github/workflows/go-fan.lock.yml +++ b/.github/workflows/go-fan.lock.yml @@ -406,7 +406,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/.github/workflows/jsweep.lock.yml b/.github/workflows/jsweep.lock.yml index 663f972858..7eaa4dd031 100644 --- a/.github/workflows/jsweep.lock.yml +++ b/.github/workflows/jsweep.lock.yml @@ -426,7 +426,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/mcp-inspector.lock.yml b/.github/workflows/mcp-inspector.lock.yml index 7d41308c7b..a9a85c4f82 100644 --- a/.github/workflows/mcp-inspector.lock.yml +++ b/.github/workflows/mcp-inspector.lock.yml @@ -662,7 +662,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] }, "tavily": { diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml index df470fcc72..a3989756cb 100644 --- a/.github/workflows/q.lock.yml +++ b/.github/workflows/q.lock.yml @@ -538,7 +538,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/repository-quality-improver.lock.yml b/.github/workflows/repository-quality-improver.lock.yml index 8d21486a32..a3f53e1641 100644 --- a/.github/workflows/repository-quality-improver.lock.yml +++ b/.github/workflows/repository-quality-improver.lock.yml @@ -412,7 +412,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/sergo.lock.yml b/.github/workflows/sergo.lock.yml index ae4259d3a0..4b61bdc1da 100644 --- a/.github/workflows/sergo.lock.yml +++ b/.github/workflows/sergo.lock.yml @@ -407,7 +407,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/.github/workflows/smoke-claude.lock.yml b/.github/workflows/smoke-claude.lock.yml index 221326b921..1e79185ae0 100644 --- a/.github/workflows/smoke-claude.lock.yml +++ b/.github/workflows/smoke-claude.lock.yml @@ -652,7 +652,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/.github/workflows/smoke-copilot.lock.yml b/.github/workflows/smoke-copilot.lock.yml index 28b5e5e048..743424eb0a 100644 --- a/.github/workflows/smoke-copilot.lock.yml +++ b/.github/workflows/smoke-copilot.lock.yml @@ -565,7 +565,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/terminal-stylist.lock.yml b/.github/workflows/terminal-stylist.lock.yml index 793e904a25..5802dd401a 100644 --- a/.github/workflows/terminal-stylist.lock.yml +++ b/.github/workflows/terminal-stylist.lock.yml @@ -393,7 +393,7 @@ jobs: "container": "ghcr.io/githubnext/serena-mcp-server:latest", "args": ["--network", "host"], "entrypoint": "serena", - "entrypointArgs": ["start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"], + "entrypointArgs": ["start-mcp-server", "--context", "copilot", "--project", "${{ github.workspace }}"], "mounts": ["${{ github.workspace }}:${{ github.workspace }}:rw"] } }, diff --git a/.github/workflows/typist.lock.yml b/.github/workflows/typist.lock.yml index b9bce03b87..916557d0c9 100644 --- a/.github/workflows/typist.lock.yml +++ b/.github/workflows/typist.lock.yml @@ -394,7 +394,7 @@ jobs: "entrypointArgs": [ "start-mcp-server", "--context", - "codex", + "claude", "--project", "${{ github.workspace }}" ], diff --git a/pkg/workflow/claude_mcp.go b/pkg/workflow/claude_mcp.go index 018aa8e2f8..fd478a48f3 100644 --- a/pkg/workflow/claude_mcp.go +++ b/pkg/workflow/claude_mcp.go @@ -20,6 +20,7 @@ func (e *ClaudeEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]a InlineArgs: false, // Claude uses multi-line args format Format: "json", IsLast: isLast, + EngineID: e.id, // Pass engine ID for engine-specific configuration }) } diff --git a/pkg/workflow/codex_mcp.go b/pkg/workflow/codex_mcp.go index b6b3e79f5b..c5e1707e5b 100644 --- a/pkg/workflow/codex_mcp.go +++ b/pkg/workflow/codex_mcp.go @@ -23,6 +23,7 @@ func (e *CodexEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]an InlineArgs: false, // Codex uses multi-line args format Format: "toml", IsLast: isLast, + EngineID: e.id, // Pass engine ID for engine-specific configuration }) } @@ -109,6 +110,7 @@ func (e *CodexEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]an InlineArgs: false, // Use standard multi-line format Format: "json", IsLast: isLast, + EngineID: e.id, // Pass engine ID for engine-specific configuration }) } diff --git a/pkg/workflow/copilot_mcp.go b/pkg/workflow/copilot_mcp.go index e95263e8e4..73e36a44ec 100644 --- a/pkg/workflow/copilot_mcp.go +++ b/pkg/workflow/copilot_mcp.go @@ -23,6 +23,7 @@ func (e *CopilotEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string] InlineArgs: true, // Copilot uses inline args format Format: "json", IsLast: isLast, + EngineID: e.id, // Pass engine ID for engine-specific configuration }) } diff --git a/pkg/workflow/mcp-config-serena.go b/pkg/workflow/mcp-config-serena.go index 8270d8029e..4e9f7604c5 100644 --- a/pkg/workflow/mcp-config-serena.go +++ b/pkg/workflow/mcp-config-serena.go @@ -99,7 +99,8 @@ func selectSerenaContainer(serenaTool any) string { // Supports two modes: // - "docker" (default): Uses Docker container with stdio transport (ghcr.io/githubnext/serena-mcp-server:latest) // - "local": Uses local uvx with HTTP transport on fixed port -func renderSerenaMCPConfigWithOptions(yaml *strings.Builder, serenaTool any, isLast bool, includeCopilotFields bool, inlineArgs bool) { +// The engineID parameter specifies which engine context to use (e.g., "copilot", "claude", "codex") +func renderSerenaMCPConfigWithOptions(yaml *strings.Builder, serenaTool any, isLast bool, includeCopilotFields bool, inlineArgs bool, engineID string) { customArgs := getSerenaCustomArgs(serenaTool) // Determine the mode - check if serenaTool is a map with mode field @@ -145,8 +146,14 @@ func renderSerenaMCPConfigWithOptions(yaml *strings.Builder, serenaTool any, isL yaml.WriteString(" \"entrypoint\": \"serena\",\n") // Entrypoint args for Serena MCP server + // Use engine-specific context (copilot, claude, codex, etc.) + context := engineID + if context == "" { + context = "codex" // fallback to codex for backwards compatibility + } + if inlineArgs { - yaml.WriteString(" \"entrypointArgs\": [\"start-mcp-server\", \"--context\", \"codex\", \"--project\", \"${{ github.workspace }}\"") + yaml.WriteString(" \"entrypointArgs\": [\"start-mcp-server\", \"--context\", \"" + context + "\", \"--project\", \"${{ github.workspace }}\"") // Append custom args if present writeArgsToYAMLInline(yaml, customArgs) yaml.WriteString("],\n") @@ -154,7 +161,7 @@ func renderSerenaMCPConfigWithOptions(yaml *strings.Builder, serenaTool any, isL yaml.WriteString(" \"entrypointArgs\": [\n") yaml.WriteString(" \"start-mcp-server\",\n") yaml.WriteString(" \"--context\",\n") - yaml.WriteString(" \"codex\",\n") + yaml.WriteString(" \"" + context + "\",\n") yaml.WriteString(" \"--project\",\n") yaml.WriteString(" \"${{ github.workspace }}\"") // Append custom args if present diff --git a/pkg/workflow/mcp_config_comprehensive_test.go b/pkg/workflow/mcp_config_comprehensive_test.go index 7d0439c244..df7fd46cda 100644 --- a/pkg/workflow/mcp_config_comprehensive_test.go +++ b/pkg/workflow/mcp_config_comprehensive_test.go @@ -651,7 +651,7 @@ func TestRenderSerenaMCPConfigWithOptions(t *testing.T) { t.Run(tt.name, func(t *testing.T) { var output strings.Builder - renderSerenaMCPConfigWithOptions(&output, tt.serenaTool, tt.isLast, tt.includeCopilotFields, tt.inlineArgs) + renderSerenaMCPConfigWithOptions(&output, tt.serenaTool, tt.isLast, tt.includeCopilotFields, tt.inlineArgs, "codex") result := output.String() @@ -1194,7 +1194,7 @@ func TestRenderSerenaMCPConfigLocalMode(t *testing.T) { t.Run(tt.name, func(t *testing.T) { var output strings.Builder - renderSerenaMCPConfigWithOptions(&output, tt.serenaTool, tt.isLast, tt.includeCopilotFields, tt.inlineArgs) + renderSerenaMCPConfigWithOptions(&output, tt.serenaTool, tt.isLast, tt.includeCopilotFields, tt.inlineArgs, "codex") result := output.String() diff --git a/pkg/workflow/mcp_renderer.go b/pkg/workflow/mcp_renderer.go index d05c125f65..6882d9b601 100644 --- a/pkg/workflow/mcp_renderer.go +++ b/pkg/workflow/mcp_renderer.go @@ -23,6 +23,8 @@ type MCPRendererOptions struct { Format string // IsLast indicates if this is the last server in the configuration (affects trailing comma) IsLast bool + // EngineID specifies the engine identifier (e.g., "copilot", "claude", "codex") for engine-specific configuration + EngineID string } // MCPConfigRendererUnified provides unified rendering methods for MCP configurations @@ -177,7 +179,7 @@ func (r *MCPConfigRendererUnified) renderPlaywrightTOML(yaml *strings.Builder, p // RenderSerenaMCP generates Serena MCP server configuration func (r *MCPConfigRendererUnified) RenderSerenaMCP(yaml *strings.Builder, serenaTool any) { - mcpRendererLog.Printf("Rendering Serena MCP: format=%s, inline_args=%t", r.options.Format, r.options.InlineArgs) + mcpRendererLog.Printf("Rendering Serena MCP: format=%s, inline_args=%t, engine=%s", r.options.Format, r.options.InlineArgs, r.options.EngineID) if r.options.Format == "toml" { r.renderSerenaTOML(yaml, serenaTool) @@ -185,7 +187,7 @@ func (r *MCPConfigRendererUnified) RenderSerenaMCP(yaml *strings.Builder, serena } // JSON format - renderSerenaMCPConfigWithOptions(yaml, serenaTool, r.options.IsLast, r.options.IncludeCopilotFields, r.options.InlineArgs) + renderSerenaMCPConfigWithOptions(yaml, serenaTool, r.options.IsLast, r.options.IncludeCopilotFields, r.options.InlineArgs, r.options.EngineID) } // renderSerenaTOML generates Serena MCP configuration in TOML format @@ -226,10 +228,16 @@ func (r *MCPConfigRendererUnified) renderSerenaTOML(yaml *strings.Builder, seren yaml.WriteString(" entrypoint = \"serena\"\n") // Entrypoint args for Serena MCP server + // Use engine-specific context (copilot, claude, codex, etc.) + context := r.options.EngineID + if context == "" { + context = "codex" // fallback to codex for backwards compatibility + } + yaml.WriteString(" entrypointArgs = [\n") yaml.WriteString(" \"start-mcp-server\",\n") yaml.WriteString(" \"--context\",\n") - yaml.WriteString(" \"codex\",\n") + yaml.WriteString(" \"" + context + "\",\n") yaml.WriteString(" \"--project\",\n") yaml.WriteString(" \"${{ github.workspace }}\"")