home / mcp / mcp language server
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
Configuration
View docs{
"mcpServers": {
"isaacphi-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"
}
}
}
}You run an MCP language server that exposes a language server over stdio to help MCP-enabled clients navigate codebases with semantic tooling like go-to-definition, references, renaming, and diagnostics. This guide shows how to install the server and connect it to your preferred MCP client using different language servers.
Install the MCP language server and a language-server frontend of your choice. Start the MCP language server locally and configure your MCP client to launch the language server with the appropriate workspace and language-server executable. You can enable features such as definition lookup, references, hover information, diagnostics, and symbol renaming within your editor or client. Each language server variant is started as a stdio-based MCP endpoint, and environment variables you provide will be forwarded to the language server.
Prerequisites: you need a Go toolchain installed to build or install the MCP language server. You also need a supported MCP client configuration to run an MCP language server via stdio.
Install the MCP language server locally using Go’s install command.
Install a compatible language server for your workflow and prepare your MCP client with the appropriate workspace configuration.
{
"mcpServers": {
"language_server_go": {
"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"
}
}
}
}{
"mcpServers": {
"language_server_rust": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"rust-analyzer"
]
}
}
}{
"mcpServers": {
"language_server_py": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"pyright-langserver",
"--",
"--stdio"
]
}
}
}{
"mcpServers": {
"language_server_ts": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"typescript-language-server",
"--",
"--stdio"
]
}
}
}{
"mcpServers": {
"language_server_clang": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"/path/to/your/clangd_binary",
"--",
"--compile-commands-dir=/path/to/yourproject/build_or_compile_commands_dir"
]
}
}
}The language server communicates over stdio. Any arguments after -- are forwarded to the language server, and any environment variables are passed along as well.
If you encounter verbose logging, set LOG_LEVEL=DEBUG to see detailed messages for all components, including handshakes with the language server and its internal logs.
Retrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
Locates all usages and references of a symbol throughout the codebase.
Provides diagnostic information for a specific file, including warnings and errors.
Display documentation, type hints, or other hover information for a given location.
Rename a symbol across a project.
Allows making multiple text edits to a file based on line numbers.