Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/archie.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/cloclo.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-compiler-quality.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-file-diet.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-testify-uber-super-expert.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/developer-docs-consolidator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/glossary-maintainer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/go-fan.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/jsweep.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/mcp-inspector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/q.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/repository-quality-improver.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/sergo.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-copilot.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/terminal-stylist.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/typist.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/workflow/claude_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/workflow/codex_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down Expand Up @@ -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
})
}

Expand Down
1 change: 1 addition & 0 deletions pkg/workflow/copilot_mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down
13 changes: 10 additions & 3 deletions pkg/workflow/mcp-config-serena.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -145,16 +146,22 @@ 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")
} else {
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
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflow/mcp_config_comprehensive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
14 changes: 11 additions & 3 deletions pkg/workflow/mcp_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -177,15 +179,15 @@ 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)
return
}

// 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
Expand Down Expand Up @@ -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 }}\"")

Expand Down