MCP Language Server

MCP Language Server

Bridge codebase navigation tools to AI models using MCP-enabled language servers.

1,256
Stars
94
Forks
1,256
Watchers
39
Issues
MCP Language Server implements the Model Context Protocol, allowing MCP-enabled clients, such as LLMs, to interact with language servers for codebase navigation. It exposes standard language server features—like go to definition, references, rename, and diagnostics—over MCP for seamless integration with AI tooling. The server supports multiple languages by serving as a proxy to underlying language servers, including gopls, rust-analyzer, and pyright.

Key Features

MCP protocol server implementation
Exposes language server features for AI/LLM clients
Supports multiple languages (Go, Rust, Python, etc)
Get definition and reference lookup
Rename symbol functionality
Code diagnostics support
Compatible with MCP-enabled clients like Claude Desktop
Environment-variable configurability
Easy language server integration
Demo and configuration examples provided

Use Cases

Assisting LLMs and AI agents in semantic code analysis
Automated code review and refactoring with language server support
Integrating developer tools with advanced code navigation for MCP clients
Providing context-aware code suggestions in AI coding assistants
Enhancing AI understanding of large codebases
Enabling custom code search for developers via MCP
Empowering chat-based tools to interact with project files intelligently
Supporting multi-language projects through flexible server orchestration
Connecting AI agents to industry-standard language servers
Facilitating code intelligence in IDE plugins using MCP

README

MCP Language Server

Go Tests Go Report Card GoDoc Go Version

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.

Demo

Setup

  1. Install Go: Follow instructions at https://golang.org/doc/install
  2. Install or update this server: go install github.com/isaacphi/mcp-language-server@latest
  3. Install a language server: follow one of the guides below
  4. Configure your MCP client: follow one of the guides below
<p><strong>Note</strong>:</p>
<ul>
  <li>Replace <code>/path/to/your/clangd_binary</code> with the actual path to your clangd executable.</li>
  <li><code>--compile-commands-dir</code> should point to the directory containing your <code>compile_commands.json</code> file (e.g., <code>./build</code>, <code>./cmake-build-debug</code>).</li>
  <li>Ensure <code>compile_commands.json</code> is generated for your project for clangd to work effectively.</li>
</ul>

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 O.K. as long as it is tested, passes checks, and doesn't smell too bad.

Setup

Clone the repo:

bash
git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server

A justfile is included for convenience:

bash
just -l
Available recipes:
    build    # Build
    check    # Run code audit checks
    fmt      # Format code
    generate # Generate LSP types and methods
    help     # Help
    install  # Install locally
    snapshot # Update snapshot tests
    test     # Run tests

Configure your Claude Desktop (or similar) to use the local binary:

json
{
  "mcpServers": {
    "language-server": {
      "command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server",
      "args": [
        "--workspace",
        "/path/to/workspace",
        "--lsp",
        "language-server-executable"
      ],
      "env": {
        "LOG_LEVEL": "DEBUG"
      }
    }
  }
}

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 from gopls'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.

integrationtests/
├── tests/        # Tests are in this folder
├── snapshots/    # Snapshots of tool outputs
├── test-output/  # Gitignored folder showing the final state of each workspace and logs after each test run
└── workspaces/   # Mock workspaces that the tools run on

To update snapshots, run UPDATE_SNAPSHOTS=true go test ./integrationtests/...

Star History

Star History Chart

Repository Owner

isaacphi
isaacphi

User

Repository Details

Language Go
Default Branch main
Size 2,651 KB
Contributors 4
License BSD 3-Clause "New" or "Revised" License
MCP Verified Nov 12, 2025

Programming Languages

Go
94.83%
Python
2.43%
TypeScript
0.88%
Rust
0.79%
Makefile
0.64%
C
0.3%
Just
0.14%

Tags

Topics

ai language-server-protocol mcp mcp-server model-context-protocol

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Bifrost

    Bifrost

    VSCode Dev Tools exposed via the Model Context Protocol for AI tool integration.

    Bifrost is a Visual Studio Code extension that launches a Model Context Protocol (MCP) server, enabling external AI coding assistants to access advanced code navigation, analysis, and manipulation features from VSCode. It exposes language server capabilities, symbol search, semantic code analysis, and refactoring tools through MCP-compatible HTTP and SSE endpoints. The extension is designed for seamless integration with AI assistants, supporting multi-project environments and configuration via JSON files.

    • 184
    • MCP
    • biegehydra/BifrostMCP
  • Neovim MCP Server

    Neovim MCP Server

    Connect AI assistants to Neovim via the Model Context Protocol.

    Neovim MCP Server enables seamless integration between Neovim instances and AI assistants by implementing the Model Context Protocol (MCP). It allows for multi-connection management, supports both stdio and HTTP server transport modes, and provides access to structured diagnostic information via URI schemes. With LSP integration, plugin support, and an extensible tool system, it facilitates advanced interaction with Neovim for context-aware AI workflows.

    • 20
    • MCP
    • linw1995/nvim-mcp
  • Exa MCP Server

    Exa MCP Server

    Fast, efficient web and code context for AI coding assistants.

    Exa MCP Server provides a Model Context Protocol (MCP) server interface that connects AI assistants to Exa AI’s powerful search capabilities, including code, documentation, and web search. It enables coding agents to retrieve precise, token-efficient context from billions of sources such as GitHub, StackOverflow, and documentation sites, reducing hallucinations in coding agents. The platform supports integration with popular tools like Cursor, Claude, and VS Code through standardized MCP configuration, offering configurable access to various research and code-related tools via HTTP.

    • 3,224
    • MCP
    • exa-labs/exa-mcp-server
  • Kanboard MCP Server

    Kanboard MCP Server

    MCP server for seamless AI integration with Kanboard project management.

    Kanboard MCP Server is a Go-based server implementing the Model Context Protocol (MCP) for integrating AI assistants with the Kanboard project management system. It enables users to manage projects, tasks, users, and workflows in Kanboard directly via natural language commands through compatible AI tools. With built-in support for secure authentication and high performance, it facilitates streamlined project operations between Kanboard and AI-powered clients like Cursor or Claude Desktop. The server is configurable and designed for compatibility with MCP standards.

    • 15
    • MCP
    • bivex/kanboard-mcp
  • MCP Claude Code

    MCP Claude Code

    Claude Code-like functionality via the Model Context Protocol.

    Implements a server utilizing the Model Context Protocol to enable Claude Code functionality, allowing AI agents to perform advanced codebase analysis, modification, and command execution. Supports code understanding, file management, and integration with various LLM providers. Offers specialized tools for searching, editing, and delegating tasks, with robust support for Jupyter notebooks. Designed for seamless collaboration with MCP clients including Claude Desktop.

    • 281
    • MCP
    • SDGLBL/mcp-claude-code
  • Lara Translate MCP Server

    Lara Translate MCP Server

    Context-aware translation server implementing the Model Context Protocol.

    Lara Translate MCP Server enables AI applications to seamlessly access professional translation services via the standardized Model Context Protocol. It supports features such as language detection, context-aware translations, and translation memory integration. The server acts as a secure bridge between AI models and Lara Translate, managing credentials and facilitating structured translation requests and responses.

    • 76
    • MCP
    • translated/lara-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results