Integrations
Integrates with Python language server (pyright) to provide code intelligence, including definitions, references, diagnostics, and code lens for Python codebases
Integrates with Rust language server (rust-analyzer) to provide code intelligence, including definitions, references, diagnostics, and code lens for Rust codebases
Integrates with TypeScript language server (tsserver) to provide code intelligence, including definitions, references, diagnostics, and code lens for TypeScript codebases
MCP Language Server
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
- Install Go: Follow instructions at https://golang.org/doc/install
- Install or update this server:
go install github.com/isaacphi/mcp-language-server@latest
- Install a language server: follow one of the guides below
- Configure your MCP client: follow one of the guides below
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 OK as long as it is tested, passes checks, and doesn't smell too bad.
Setup
Clone the repo:
A justfile is included for convenience:
Configure your Claude Desktop (or similar) to use the local binary:
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 fromgopls
'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.
To update snapshots, run UPDATE_SNAPSHOTS=true go test ./integrationtests/...
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Runs a language server and provides tools for communicating with it. Language servers excel at tasks that LLMs often struggle with, such as precisely understanding types, understanding relationships, and providing accurate symbol references.
Related Resources
Related MCP Servers
- -securityFlicense-qualityA TypeScript-based server that provides a memory system for Large Language Models (LLMs), allowing users to interact with multiple LLM providers while maintaining conversation history and offering tools for managing providers and model configurations.Last updated -20JavaScript
- -securityAlicense-qualityA Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.Last updated -324288JavaScriptMIT License
- -securityAlicense-qualityA Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.Last updated -5PythonApache 2.0
- -securityAlicense-qualityBridges Large Language Models with Language Server Protocol interfaces, allowing LLMs to access LSP's hover information, completions, diagnostics, and code actions for improved code suggestions.Last updated -2TypeScriptMIT License