- Explore MCP Servers
- mcp-language-server
Mcp Language Server
What is Mcp Language Server
The mcp-language-server is a Model Context Protocol (MCP) server that manages multiple language servers for different programming languages within a single workspace, facilitating communication based on file context or explicit language specification.
Use cases
Use cases include enhancing code navigation and understanding in large projects, providing accurate symbol references, and improving the capabilities of language models in handling complex codebases.
How to use
To use the mcp-language-server, configure it with the desired language servers in a configuration file. Then, utilize the provided tools such as read_definition, find_references, get_diagnostics, and get_codelens by specifying the appropriate language argument or file extension.
Key features
Key features include support for multiple language servers in a single process, automatic routing of requests based on file extensions, and tools for retrieving definitions, references, diagnostics, and code lens hints.
Where to use
The mcp-language-server can be used in software development environments where multiple programming languages are utilized, particularly in integrated development environments (IDEs) and code editors that require sophisticated code understanding.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Language Server
The mcp-language-server is a Model Context Protocol (MCP) server that manages multiple language servers for different programming languages within a single workspace, facilitating communication based on file context or explicit language specification.
Use cases
Use cases include enhancing code navigation and understanding in large projects, providing accurate symbol references, and improving the capabilities of language models in handling complex codebases.
How to use
To use the mcp-language-server, configure it with the desired language servers in a configuration file. Then, utilize the provided tools such as read_definition, find_references, get_diagnostics, and get_codelens by specifying the appropriate language argument or file extension.
Key features
Key features include support for multiple language servers in a single process, automatic routing of requests based on file extensions, and tools for retrieving definitions, references, diagnostics, and code lens hints.
Where to use
The mcp-language-server can be used in software development environments where multiple programming languages are utilized, particularly in integrated development environments (IDEs) and code editors that require sophisticated code understanding.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Language Server
Note: This repository is a fork of isaacphi/mcp-language-server. It has undergone significant architectural changes (supporting multiple language servers in a single process via a configuration file) and is not intended for merging back into the original repository.
A Model Context Protocol (MCP) server that manages multiple language servers for different programming languages within a single workspace. It provides tools for communicating with the appropriate language server based on file context or explicit language specification.
Motivation
Language servers excel at tasks that LLMs often struggle with, such as precisely understanding types, navigating complex codebases, and providing accurate symbol references across large projects. This project aims to bring the power of multiple language servers to LLMs through a unified MCP interface, enabling more sophisticated code understanding and manipulation capabilities.
Status
⚠️ Pre-beta Quality ⚠️
I have tested this server with the following language servers
- pyright (Python)
- tsserver (TypeScript)
- gopls (Go)
- rust-analyzer (Rust)
But it should be compatible with many more.
Tools
This server provides the following tools, automatically routing requests to the appropriate language server based on file extensions (for file-based tools) or an explicit language argument.
read_definition: Retrieves the complete source code definition of a symbol. Requires alanguageargument (e.g.,"typescript","go") to specify which language server to query.find_references: Locates all usages and references of a symbol. Requires alanguageargument (e.g.,"typescript","go") to specify which language server to query.get_diagnostics: Provides diagnostic information for a specific file (language determined by file extension).get_codelens: Retrieves code lens hints for a specific file (language determined by file extension).execute_codelens: Runs a code lens action for a specific file (language determined by file extension).apply_text_edit: Allows making multiple text edits to a file programmatically (language determined by file extension). Supports simple insert/delete/replace, regex-based replacement (usingisRegex,regexPattern,regexReplace), and optional bracket balance protection (usingpreserveBrackets,bracketTypes) to prevent edits that break pairs like(),{},[].
Behind the scenes, this MCP server can act on workspace/applyEdit requests from the language servers, enabling features like refactoring, adding imports, and code formatting.
Most tools support options like showLineNumbers. Refer to the tool schemas for detailed usage.
About
This codebase makes use of edited code from gopls to handle LSP communication. See ATTRIBUTION for details.
mcp-golang is used for MCP communication.
Prerequisites
- Install Go: Follow instructions at https://golang.org/doc/install
- Install Language Servers: Install the language servers for the languages you want to use in your project. Examples:
- Python (pyright):
npm install -g pyright
- Python (pyright):
- TypeScript (tsserver):
npm install -g typescript typescript-language-server - Go (gopls):
go install golang.org/x/tools/gopls@latest - Rust (rust-analyzer):
rustup component add rust-analyzer - Or use any language server
Setup
-
Build the Server:
Clone the repository and build the executable:git clone https://github.com/isaacphi/mcp-language-server.git cd mcp-language-server go build -o mcp-language-server . -
Create Configuration File (
config.json):
Create a JSON configuration file (e.g.,config.jsonin the project root or another location) to define the language servers you want to manage.config.jsonExample:- Replace
/Users/you/dev/yourcodebasewith the absolute path to your project. - Replace
/path/to/your/goplsetc. with the correct command or absolute path for each language server.
- Replace
-
Configure MCP Client:
Add the following configuration to your Claude Desktop settings (or similar MCP-enabled client), adjusting paths as necessary:- Ensure the
commandpath points to themcp-language-serverexecutable you built. - Ensure the
--configargument points to theconfig.jsonfile you created. - Set
cwdif necessary (usually the directory containing the executable). - Add required environment variables (like
PATHif using shims likeasdf) to theenvobject.
- Ensure the
Development
Clone the repository:
git clone https://github.com/isaacphi/mcp-language-server.git
forcd mcp-language-server
Install dev dependencies:
go mod download
Build:
go build
Configure your Claude Desktop (or similar) to use the local binary, similar to the Setup section, ensuring the command points to your locally built executable and the --config argument points to your development config.json:
Remember to create a config.dev.json (or similar) for your development environment.
Rebuild (go build -o mcp-language-server .) after making code changes.
Feedback
Include
env: { "DEBUG": 1 }
To get detailed LSP and application logs. Please include as much information as possible when opening issues.
The following features are on my radar:
- [x] Read definition
- [x] Get references
- [x] Apply edit
- [x] Get diagnostics
- [x] Code lens
- [ ] Hover info
- [ ] Code actions
- [ ] Better handling of context and cancellation
- [ ] Add LSP server configuration options and presets for common languages
- [ ] Make a more consistent and scalable API for tools (pagination, etc.)
- [ ] Create tools at a higher level of abstraction, combining diagnostics, code lens, hover, and code actions when reading definitions or references.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










