mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
claude mcp add --transport stdio isaacphi-mcp-language-server mcp-language-server --workspace /Users/you/dev/yourproject/ --lsp gopls \ --env PATH="/opt/homebrew/bin:/Users/you/go/bin" \ --env GOPATH="/users/you/go" \ --env GOCACHE="/users/you/Library/Caches/go-build" \ --env GOMODCACHE="/Users/you/go/pkg/mod"
How to use
This MCP server exposes a language server via the MCP interface to enable large language model clients to interact with your codebase using language-server features. It leverages the Go-based language server implementation (gopls) to provide definitions, references, diagnostics, hover information, and rename capabilities through the MCP protocol. To use it, start the mcp-language-server binary (installed with go install github.com/isaacphi/mcp-language-server@latest) and configure your MCP client to point at the server with the appropriate --workspace and --lsp arguments for the language server you want to run. The included tooling allows MCP-enabled clients to navigate code, obtain symbol information, and keep diagnostics in sync with the workspace.
How to install
Prerequisites:
- Go installed on your system (https://golang.org/dl/)
- A Go workspace set up where you can install binaries
Installation steps:
- Install the MCP language server binary: go install github.com/isaacphi/mcp-language-server@latest
- Ensure your PATH includes the Go binaries directory so you can run mcp-language-server directly: export PATH=$PATH:$(go env GOPATH)/bin
- Start the server (example): mcp-language-server --workspace /Users/you/dev/yourproject/ --lsp gopls
- Configure an MCP client to connect to the server using the mcpServers configuration (see mcp_config in this document).
Notes:
- The workspace path should point to the root of your project you want to analyze with gopls.
- If you use a different language server with the --lsp flag (e.g., rust-analyzer, pyright-langserver, etc.), adjust accordingly.
Additional notes
- The language server communicates over stdio; any arguments after -- are passed to the language server itself.
- Environment variables set in the MCP config are passed through to the language server; adjust PATH, GOPATH, GOCACHE, and GOMODCACHE as needed for your environment.
- This project is a beta tool; monitor for updates and report issues if you encounter mismatches between the MCP client and the language server.
- While the example uses gopls, you can swap in other LSPs by changing the --lsp value and, if needed, the workspace setup.
- Ensure the language server binary is compatible with your project workspace and that the language server can access the workspace files.
Related MCP Servers
kodit
π©βπ» MCP server to index external repositories
mcp
Teamwork.com MCP server
chromedp
MCP server for browser automation using chromedp
mcp-stockfish
π MCP server connecting AI systems to Stockfish chess engine
ai-create
ai-create-mcp is a Go-based tool that converts OpenAPI Specification (OAS) files into a Model Context Protocol (MCP) program.
mcp-turso
MCP server for interacting with Turso-hosted LibSQL databases