-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
Description:
The current implementation of the gopls MCP server (https://tip.golang.org/gopls/features/mcp) presents challenges when working with multiple workspaces in environments like VS Code. Specifically, managing the MCP port (-mcp.listen) is cumbersome, and there is no seamless way to configure it for both shared and standalone gopls instances.
Problem:
-
Random MCP Port:
- When using
-mcp.listen=localhost:0, the MCP server assigns a random port. This makes it difficult to pin down the port for use in themcp.jsonfile or other tools that rely on a static MCP endpoint. - Dynamically updating the
mcp.jsonfile to reflect the random port is non-trivial.
- When using
-
Fixed MCP Port:
- Using a fixed MCP port allows for per-workspace configurations, but this requires manual setup for each workspace. This is not ideal for users who want a more automated solution.
-
Shared
goplsDaemon:- A shared
goplsdaemon with-mcp.listenand-remoteflags is a viable solution. However, the-remote=autoflag does not currently support forwarding the-mcp.listenflag to the shared daemon. This makes it impossible to configure the MCP port for the shared daemon in an automated way.
- A shared
Proposed Solutions:
- Enhance
-remote=auto:- Allow the
-remote=autoflag to forward the-mcp.listenflag (or other arbitrary flags) to the sharedgoplsdaemon. This would enable users to configure the MCP port for the shared daemon seamlessly.
- Allow the
Metadata
Metadata
Assignees
Labels
ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.