$git clone https://github.com/isaacphi/mcp-language-serverThis is an MCP server that runs and exposes a language server to LLMs. Not a language server for MCP, whatever that would be.
| 1 | # MCP Language Server |
| 2 | |
| 3 | [](https://github.com/isaacphi/mcp-language-server/actions/workflows/go.yml) |
| 4 | [](https://goreportcard.com/report/github.com/isaacphi/mcp-language-server) |
| 5 | [](https://pkg.go.dev/github.com/isaacphi/mcp-language-server) |
| 6 | [](https://github.com/isaacphi/mcp-language-server/blob/main/go.mod) |
| 7 | |
| 8 | This is an [MCP](https://modelcontextprotocol.io/introduction) server that runs and exposes a [language server](https://microsoft.github.io/language-server-protocol/) to LLMs. Not a language server for MCP, whatever that would be. |
| 9 | |
| 10 | ## Demo |
| 11 | |
| 12 | `mcp-language-server` helps MCP enabled clients navigate codebases more easily by giving them access semantic tools like get definition, references, rename, and diagnostics. |
| 13 | |
| 14 |  |
| 15 | |
| 16 | ## Setup |
| 17 | |
| 18 | 1. **Install Go**: Follow instructions at <https://golang.org/doc/install> |
| 19 | 2. **Install or update this server**: `go install github.com/isaacphi/mcp-language-server@latest` |
| 20 | 3. **Install a language server**: _follow one of the guides below_ |
| 21 | 4. **Configure your MCP client**: _follow one of the guides below_ |
| 22 | |
| 23 | <details> |
| 24 | <summary>Go (gopls)</summary> |
| 25 | <div> |
| 26 | <p><strong>Install gopls</strong>: <code>go install golang.org/x/tools/gopls@latest</code></p> |
| 27 | <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> |
| 28 | |
| 29 | <pre> |
| 30 | { |
| 31 | "mcpServers": { |
| 32 | "language-server": { |
| 33 | "command": "mcp-language-server", |
| 34 | "args": ["--workspace", "/Users/you/dev/yourproject/", "--lsp", "gopls"], |
| 35 | "env": { |
| 36 | "PATH": "/opt/homebrew/bin:/Users/you/go/bin", |
| 37 | "GOPATH": "/users/you/go", |
| 38 | "GOCACHE": "/users/you/Library/Caches/go-build", |
| 39 | "GOMODCACHE": "/Users/you/go/pkg/mod" |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | </pre> |
| 45 | |
| 46 | <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> |
| 47 | <ul> |
| 48 | <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> |
| 49 | <li><code>GOPATH</code>, <code>GOCACHE</code>, and <code>GOMODCACHE</code> may be different on your machine. These are the defaults.</li> |
| 50 | </ul> |
| 51 | |
| 52 | </div> |
| 53 | </details> |
| 54 | <details> |
| 55 | <summary>Rust (rust-analyzer)</summary> |
| 56 | <div> |
| 57 | <p><strong>Install rust-analyzer</strong>: <code>rustup component add rust-analyzer</code></p> |
| 58 | <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> |
| 59 | |
| 60 | <pre> |
| 61 | { |
| 62 | "mcpServers": { |
| 63 | "language-server": { |
| 64 | "command": "mcp-language-server", |
| 65 | "args": [ |
| 66 | "--workspace", |
| 67 | "/Users/you/dev/yourproject/", |
| 68 | "--lsp", |
| 69 | "rust-analyzer" |
| 70 | ] |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | </pre> |
| 75 | </div> |
| 76 | </details> |
| 77 | <details> |
| 78 | <summary>Python (pyright)</summary> |
| 79 | <div> |
| 80 | <p><strong>Install pyright</strong>: <code>npm install -g pyright</code></p> |
| 81 | <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> |
| 82 | |
| 83 | <pre> |
| 84 | { |
| 85 | "mcpServers": { |
| 86 | "language-server": { |
| 87 | "command": "mcp-language-server", |
| 88 | "args": [ |
| 89 | "--workspace", |
| 90 | "/Users/you/dev/yourproject/", |
| 91 | "--lsp", |
| 92 | "pyright-langserver", |
| 93 | "--", |
| 94 | "--stdio" |
| 95 | ] |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | </p |