Language Server
About
🏎️ - MCP Language Server gives MCP enabled clients access to semantic tools like get definition, references, rename, and diagnostics.
Explore
- Definition: retrieves complete source code definition of any symbol.
- References: locates all usages and references of a symbol.
- Diagnostics: provides diagnostic warnings and errors for a file.
- Hover: displays documentation and type hints for a location.
- Rename symbol: renames a symbol across the entire project.
- Edit file: makes multiple text edits to a file by line numbers.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Language ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
1. Install Go: Follow instructions at <https://golang.org/doc/install>
2. Install or update this server: go install github.com/isaacphi/mcp-language-server@latest
3. Install a language server: _follow one of the guides below_
4. Configure your MCP client: _follow one of the guides below_
<details>
<summary>Go (gopls)</summary>
<div>
<p><strong>Install gopls</strong>: <code>go install golang.org/x/tools/gopls@latest</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"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"
}
}
}
}
</pre>
<p><strong>Note</strong>: Not all clients will need these environment variables. For Claude Desktop you will need to update the environment variables above based on your machine and username:</p>
<ul>
<li><code>PATH</code> needs to contain the path to <code>go</code> and to <code>gopls</code>. Get this with <code>echo $(which go):$(which gopls)</code></li>
<li><code>GOPATH</code>, <code>GOCACHE</code>, and <code>GOMODCACHE</code> may be different on your machine. These are the defaults.</li>
</ul>
</div>
</details>
<details>
<summary>Rust (rust-analyzer)</summary>
<div>
<p><strong>Install rust-analyzer</strong>: <code>rustup component add rust-analyzer</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"rust-analyzer"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>Python (pyright)</summary>
<div>
<p><strong>Install pyright</strong>: <code>npm install -g pyright</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"pyright-langserver",
"--",
"--stdio"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>Typescript (typescript-language-server)</summary>
<div>
<p><strong>Install typescript-language-server</strong>: <code>npm install -g typescript typescript-language-server</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"typescript-language-server",
"--",
"--stdio"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>C/C++ (clangd)</summary>
<div>
<p><strong>Install clangd</strong>: Download prebuilt binaries from the <a href="https://github.com/clangd/clangd/releases">official LLVM releases page</a> or install via your system's package manager (e.g., <code>apt install clangd</code>, <code>brew install clangd</code>).</p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"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"
]
}
}
}
</pre>
<p><strong>Note</strong>:</p>
<ul>
<li>Replace <code>/path/to/your/clangd_binary</code> with the actual path to your clangd executable.</li>
<li><code>--compile-commands-dir</code> should point to the directory containing your <code>compile_commands.json</code> file (e.g., <code>./build</code>, <code>./cmake-build-debug</code>).</li>
<li>Ensure <code>compile_commands.json</code> is generated for your project for clangd to work effectively.</li>
</ul>
</div>
</details>
<details>
<summary>Other</summary>
<div>
<p>I have only tested this repo with the servers above but it should be compatible with many more. Note:</p>
<ul>
<li>The language server must communicate over stdio.</li>
<li>Any aruments after <code>--</code> are sent as arguments to the language server.</li>
<li>Any env variables are passed on to the language server.</li>
</ul>
</div>
</details>
definition
Retrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
references
Locates all usages and references of a symbol throughout the codebase.
diagnostics
Provides diagnostic information for a specific file, including warnings and errors.
hover
Display documentation, type hints, or other hover information for a given location.
rename_symbol
Rename a symbol across a project.
edit_file
Allows 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.
- definition: Retrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
- references: Locates all usages and references of a symbol throughout the codebase.
- diagnostics: Provides diagnostic information for a specific file, including warnings and errors.
- hover: Display documentation, type hints, or other hover information for a given location.
- rename_symbol: Rename a symbol across a project.
- edit_file: Allows 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.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"language server": {
"language-server": {
"command": "go",
"args": [
"run",
"github.com/isaacphi/mcp-language-server@latest",
"--workspace",
"/path/to/codebase/",
"--lsp",
"language-server-executable"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}
}
McpServers
{
"language-server": {
"command": "go",
"args": [
"run",
"github.com/isaacphi/mcp-language-server@latest",
"--workspace",
"/path/to/codebase/",
"--lsp",
"language-server-executable"
],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
This is an MCP server that runs and exposes a language server to LLMs. Not a language server for MCP, whatever that would be.
Demo
mcp-language-server helps MCP enabled clients navigate codebases more easily by giving them access semantic tools like get definition, references, rename, and diagnostics.

Setup
1. Install Go: Follow instructions at <https://golang.org/doc/install>
2. Install or update this server: go install github.com/isaacphi/mcp-language-server@latest
3. Install a language server: _follow one of the guides below_
4. Configure your MCP client: _follow one of the guides below_
<details>
<summary>Go (gopls)</summary>
<div>
<p><strong>Install gopls</strong>: <code>go install golang.org/x/tools/gopls@latest</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"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"
}
}
}
}
</pre>
<p><strong>Note</strong>: Not all clients will need these environment variables. For Claude Desktop you will need to update the environment variables above based on your machine and username:</p>
<ul>
<li><code>PATH</code> needs to contain the path to <code>go</code> and to <code>gopls</code>. Get this with <code>echo $(which go):$(which gopls)</code></li>
<li><code>GOPATH</code>, <code>GOCACHE</code>, and <code>GOMODCACHE</code> may be different on your machine. These are the defaults.</li>
</ul>
</div>
</details>
<details>
<summary>Rust (rust-analyzer)</summary>
<div>
<p><strong>Install rust-analyzer</strong>: <code>rustup component add rust-analyzer</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"rust-analyzer"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>Python (pyright)</summary>
<div>
<p><strong>Install pyright</strong>: <code>npm install -g pyright</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"pyright-langserver",
"--",
"--stdio"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>Typescript (typescript-language-server)</summary>
<div>
<p><strong>Install typescript-language-server</strong>: <code>npm install -g typescript typescript-language-server</code></p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"command": "mcp-language-server",
"args": [
"--workspace",
"/Users/you/dev/yourproject/",
"--lsp",
"typescript-language-server",
"--",
"--stdio"
]
}
}
}
</pre>
</div>
</details>
<details>
<summary>C/C++ (clangd)</summary>
<div>
<p><strong>Install clangd</strong>: Download prebuilt binaries from the <a href="https://github.com/clangd/clangd/releases">official LLVM releases page</a> or install via your system's package manager (e.g., <code>apt install clangd</code>, <code>brew install clangd</code>).</p>
<p><strong>Configure your MCP client</strong>: This will be different but similar for each client. For Claude Desktop, add the following to <code>~/Library/Application\\ Support/Claude/claude_desktop_config.json</code></p>
<pre>
{
"mcpServers": {
"language-server": {
"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"
]
}
}
}
</pre>
<p><strong>Note</strong>:</p>
<ul>
<li>Replace <code>/path/to/your/clangd_binary</code> with the actual path to your clangd executable.</li>
<li><code>--compile-commands-dir</code> should point to the directory containing your <code>compile_commands.json</code> file (e.g., <code>./build</code>, <code>./cmake-build-debug</code>).</li>
<li>Ensure <code>compile_commands.json</code> is generated for your project for clangd to work effectively.</li>
</ul>
</div>
</details>
<details>
<summary>Other</summary>
<div>
<p>I have only tested this repo with the servers above but it should be compatible with many more. Note:</p>
<ul>
<li>The language server must communicate over stdio.</li>
<li>Any aruments after <code>--</code> are sent as arguments to the language server.</li>
<li>Any env variables are passed on to the language server.</li>
</ul>
</div>
</details>
Tools
- definition: Retrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
- references: Locates all usages and references of a symbol throughout the codebase.
- diagnostics: Provides diagnostic information for a specific file, including warnings and errors.
- hover: Display documentation, type hints, or other hover information for a given location.
- rename_symbol: Rename a symbol across a project.
- edit_file: Allows 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.
About
This codebase makes use of edited code from gopls to handle LSP communication. See ATTRIBUTION for details. Everything here is covered by a permissive BSD style license.
mcp-go is used for MCP communication. Thank you for your service.
This is beta software. Please let me know by creating an issue if you run into any problems or have suggestions of any kind.
Contributing
Please keep PRs small and open Issues first for anything substantial. AI slop O.K. as long as it is tested, passes checks, and doesn't smell too bad.
Setup
Clone the repo:
git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server
A justfile is included for convenience:
just -l
Available recipes:
build # Build
check # Run code audit checks
fmt # Format code
generate # Generate LSP types and methods
help # Help
install # Install locally
snapshot # Update snapshot tests
test # Run tests
Configure your Claude Desktop (or similar) to use the local binary:
{
"mcpServers": {
"language-server": {
"command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server",
"args": [
"--workspace",
"/path/to/workspace",
"--lsp",
"language-server-executable"
],
"env": {
"LOG_LEVEL": "DEBUG"
}
}
}
}
Rebuild after making changes.
Logging
Setting the LOG_LEVEL environment variable to DEBUG enables verbose logging to stderr for all components including messages to and from the language server and the language server's logs.
LSP interaction
- internal/lsp/methods.go contains generated code to make calls to the connected language server.
- internal/protocol/tsprotocol.go contains generated code for LSP types. I borrowed this from gopls's source code. Thank you for your service.
- LSP allows language servers to return different types for the same methods. Go doesn't like this so there are some ugly workarounds in internal/protocol/interfaces.go.
Local Development and Snapshot Tests
There is a snapshot test suite that makes it a lot easier to try out changes to tools. These run actual language servers on mock workspaces and capture output and logs.
You will need the language servers installed locally to run them. There are tests for go, rust, python, and typescript.
integrationtests/
├── tests/ # Tests are in this folder
├── snapshots/ # Snapshots of tool outputs
├── test-output/ # Gitignored folder showing the final state of each workspace and logs after each test run
└── workspaces/ # Mock workspaces that the tools run on
To update snapshots, run UPDATE_SNAPSHOTS=true go test ./integrationtests/...
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



