Get the FREE Ultimate OpenClaw Setup Guide β†’

mcp-language

mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

Installation steps:

  1. Install the MCP language server binary: go install github.com/isaacphi/mcp-language-server@latest
  2. Ensure your PATH includes the Go binaries directory so you can run mcp-language-server directly: export PATH=$PATH:$(go env GOPATH)/bin
  3. Start the server (example): mcp-language-server --workspace /Users/you/dev/yourproject/ --lsp gopls
  4. 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

Sponsor this space

Reach thousands of developers β†—