
How to add MCP Language Server to Cursor
Gives MCP-enabled clients semantic code tools: definition, references, rename, diagnostics, and more. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 1.5k★ · stdio · no auth
Cursor config for MCP Language Server
go install github.com/isaacphi/mcp-language-server@latest{
"mcpServers": {
"mcp-language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"gopls"
],
"env": {
"PATH": "/opt/homebrew/bin:/Users/you/go/bin",
"GOPATH": "/users/you/go",
"GOCACHE": "/users/you/Library/Caches/go-build",
"GOMODCACHE": "/Users/you/go/pkg/mod"
}
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the MCP Language Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of MCP Language Server's tools to confirm it's connected.
Before you start
- Go installed (https://golang.org/doc/install) to install the server via 'go install'
- A language server installed and on PATH (e.g. gopls, rust-analyzer, pyright, typescript-language-server, or clangd)
- The chosen language server must communicate over stdio
What MCP Language Server can do in Cursor
definitionRetrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
referencesLocates all usages and references of a symbol throughout the codebase.
diagnosticsProvides diagnostic information for a specific file, including warnings and errors.
hoverDisplays documentation, type hints, or other hover information for a given location.
rename_symbolRenames a symbol across a project.
edit_fileAllows making multiple text edits to a file based on line numbers. Provides a more reliable and context-economical way to edit files compared to search-and-replace based edit tools.
MCP Language Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MCP Language Server config there under the "mcpServers" key and restart the client.
Is this a language server for MCP?
No. It is an MCP server that runs and exposes an existing LSP language server to LLMs, so MCP clients can use semantic code tools.
Which language servers are supported?
The author has tested gopls (Go), rust-analyzer (Rust), pyright (Python), typescript-language-server (TypeScript), and clangd (C/C++), but it should be compatible with many more. The only requirement is that the language server communicates over stdio.
How do I pass arguments to the underlying language server?
Any arguments placed after '--' in the args array are forwarded to the language server, and environment variables in 'env' are passed on to it as well.