-
Notifications
You must be signed in to change notification settings - Fork 28
Add built-in Serena MCP support with language service integration and Go configuration options #4610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ntime integration Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add serena with go all smoke agentic workflows |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot for go, allow configuring the go version, go.mod file location and the gopls version |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added Go configuration options to Serena: Fields:
Example: tools:
serena:
languages:
go:
version: "1.21"
go-mod-file: "backend/go.mod"
gopls-version: "v0.14.2"Generated steps:
All three test workflows created and verified:
Commit: 6872bb5 |
|
✅ Agentic Changeset Generator completed successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds native Serena MCP support following the Playwright integration pattern. It enables language-specific code analysis through automatic runtime detection and language server installation.
Key features:
- Dual syntax support: short form (array) and full configuration (object)
- 6 supported languages: Go, TypeScript, Python, Java, Rust, C#
- Go-specific configuration: custom go.mod path and gopls version
- Automatic runtime detection and language service installation
- Integration across all engines (Copilot, Claude, Codex, Custom)
Main concerns:
- Duplicate arguments in MCP config generation causing command duplication
- Unrelated whitespace changes mixed into the PR
- Potential missing import issue in tools_types.go
Reviewed changes
Copilot reviewed 41 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/tools_types.go | Adds SerenaToolConfig struct and parsing logic with dual-syntax support |
| pkg/workflow/runtime_setup.go | Implements language detection and language service installation steps |
| pkg/workflow/mcp_servers.go | Adds "serena" to standard MCP tools list |
| pkg/workflow/mcp_renderer.go | Adds Serena MCP rendering for all engines |
| pkg/workflow/mcp-config.go | Implements Serena MCP config generation with engine-specific options |
| pkg/workflow/compiler_yaml.go | Integrates Serena language service steps into compilation |
| pkg/parser/schemas/main_workflow_schema.json | Adds comprehensive JSON schema for Serena configuration |
| .github/workflows/smoke-*.md | Adds Serena to smoke tests for continuous validation |
| .github/workflows/test-serena-*.md | New test workflows for various Serena configurations |
| .github/workflows/*.lock.yml | Generated lock files showing MCP config (with duplicate args bug) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "--from", | ||
| "git+https://github.com/oraios/serena", | ||
| "serena", | ||
| "start-mcp-server", | ||
| "--context", | ||
| "codex", | ||
| "--project", | ||
| "${{ github.workspace }}", |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MCP configuration is generating duplicate arguments. The args array contains the full command sequence twice:
"--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "codex", "--project", "${{ github.workspace }}"
This pattern appears twice in the args array, which will cause the command to fail or behave incorrectly. This appears to be happening in multiple generated lock files (typist.lock.yml, semantic-function-refactor.lock.yml, repository-quality-improver.lock.yml, etc.).
See below for a potential fix:
|
|
||
| // Reset mock implementations to default | ||
| mockExistsSync.mockReturnValue(false); | ||
| mockReadFileSync.mockReturnValue(""); | ||
|
|
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Inconsistent whitespace: There are extra blank lines being removed (lines 35 and 39 in the diff) that are unrelated to the Serena functionality being added. These formatting changes should be in a separate commit or reverted to keep the PR focused on the Serena feature.
| "fmt" | ||
|
|
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import: The fmt package is imported but this file was already using fmt.Sprintf in existing code (line 513 in the diff), so the import should have already existed. However, if this is a new file or the import was previously missing, this is correct. Please verify that the existing code compiles without this import or if this import is actually needed for the new code.
Adds native Serena MCP support following the Playwright integration pattern. Enables language-specific code analysis through automatic runtime detection and language server installation.
Syntax
Short form:
Full configuration:
Implementation
Schema & Types
SerenaToolConfigstruct with per-language version configurationparseSerenaTool()go-mod-fileandgopls-versionMCP Rendering
uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context codex --project ${{ github.workspace }}Runtime Integration
detectSerenaLanguages()maps languages to runtime requirements (Go → go, TypeScript → node, Python → python)GenerateSerenaLanguageServiceSteps()installs language servers:go install golang.org/x/tools/gopls@<version>(configurable version)npm install -g typescript-language-server typescriptpip install python-lsp-serverrustup component add rust-analyzerGo Configuration Options
version: Explicitly set Go version (e.g., "1.21", 1.21)go-mod-file: Specify path to go.mod file for version detection (e.g., "backend/go.mod")gopls-version: Specify gopls version to install (e.g., "latest", "v0.14.2")Validation
mcp_servers.goValidateMCPConfigs()to prevent custom MCP schema conflictsSmoke Test Integration
serena: ["go"]to all smoke test workflows for continuous validation:smoke-copilot.md- Tests Serena with Copilot enginesmoke-claude.md- Tests Serena with Claude enginesmoke-codex.md- Tests Serena with Codex engineFiles Changed
main_workflow_schema.jsontools_types.go,args.gomcp-config.go,mcp_renderer.gocopilot_engine.go,claude_mcp.go,codex_engine.go,custom_engine.goruntime_setup.go,compiler_yaml.gomcp_config_validation.go,mcp_servers.godev.md, test workflowssmoke-copilot.md,smoke-claude.md,smoke-codex.mdtest-serena-go-config.md,test-serena-custom-gomod.md, updatedtest-serena-long.mdOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.