RepositoryRust
bug-ops

bug-ops/mcpls

Universal MCP to LSP bridge - expose Language Server Protocol capabilities as MCP tools for AI agents

90stars
19forks
43issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: code-completion

#1 Repository of the week

1
TINIX TRENDING·Topic: language-server-protocol

#1 Repository of the week

1
TINIX TRENDING·Topic: code-navigation

#1 Repository of the week

mcpls

Crates.io docs.rs CI codecov MSRV License

Stop treating code as text. Give your AI agent a compiler's understanding.

mcpls is a universal bridge between AI coding assistants and language servers. It exposes the full power of LSP — type inference, cross-reference analysis, semantic navigation — through the Model Context Protocol, enabling AI agents to reason about code the way IDEs do.

Why mcpls?

AI coding assistants are remarkably capable, but they're working blind. They see code as text, not as the structured, typed, interconnected system it actually is.

mcpls changes that. By bridging MCP and LSP, it gives AI agents access to:

  • Type information — Know exactly what a variable is, not what it might be
  • Cross-references — Find every usage of a symbol across your entire codebase
  • Semantic navigation — Jump to definitions, implementations, type declarations
  • Real diagnostics — See actual compiler errors, not hallucinated ones
  • Safe refactoring — Rename symbols with confidence, workspace-wide

[!TIP] Zero configuration for Rust projects. Just install mcpls and rust-analyzer — ready to go.

Installation

cargo install mcpls
Pre-built binaries & other methods

Download from GitHub Releases:

PlatformArchitectureDownload
Linuxx86_64mcpls-linux-x86_64.tar.gz
Linuxx86_64 (static)mcpls-linux-x86_64-musl.tar.gz
macOSIntelmcpls-macos-x86_64.tar.gz
macOSApple Siliconmcpls-macos-aarch64.tar.gz
Windowsx86_64mcpls-windows-x86_64.zip

From source:

git clone https://github.com/bug-ops/mcpls
cd mcpls
cargo install --path crates/mcpls-cli
Prerequisites (language servers)

mcpls uses graceful degradation — if one language server fails, it continues with available servers.

Rust (rust-analyzer):

rustup component add rust-analyzer
# Or: brew install rust-analyzer (macOS)

Python (pyright):

npm install -g pyright

TypeScript:

npm install -g typescript-language-server typescript

Go (gopls):

go install golang.org/x/tools/gopls@latest

[!IMPORTANT] At least one language server must be available.

Quick Start

1. Configure Claude Code (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mcpls": {
      "command": "mcpls",
      "args": []
    }
  }
}

2. Experience the difference:

You: What's the return type of process_request on line 47?

Claude: [get_hover] It returns Result<Response, ApiError> where:
        - Response is defined in src/types.rs:23
        - ApiError is an enum with variants: Network, Parse, Timeout

You: Find everywhere ApiError::Timeout is handled

Claude: [get_references] Found 4 matches:
        - src/handlers/api.rs:89 — retry logic
        - src/handlers/api.rs:156 — logging
        - src/middleware/timeout.rs:34 — wrapper
        - tests/api_tests.rs:201 — test case

MCP Tools

Code Intelligence
ToolWhat it does
get_hoverType signatures, documentation, inferred types at any position
get_definitionJump to where a symbol is defined — across files, across crates
get_referencesEvery usage of a symbol in your workspace
get_completionsContext-aware suggestions that respect types and scope
get_document_symbolsStructured outline — functions, types, constants, imports
workspace_symbol_searchFind symbols by name across the entire workspace
Diagnostics & Analysis
ToolWhat it does
get_diagnosticsReal compiler errors and warnings, not guesses
get_cached_diagnosticsFast access to push-based diagnostics from LSP server
get_code_actionsQuick fixes, refactorings, and source actions at a position
Refactoring & Call Hierarchy
ToolWhat it does
rename_symbolWorkspace-wide rename with full reference tracking
format_documentApply language-specific formatting rules
prepare_call_hierarchyGet callable items at a position for call hierarchy
get_incoming_callsFind all callers of a function (who calls this?)
get_outgoing_callsFind all callees of a function (what does this call?)
Server Monitoring
ToolWhat it does
get_server_logsDebug LSP issues with internal log messages
get_server_messagesUser-facing messages from the language server

Configuration

Server Heuristics

mcpls uses smart heuristics to spawn only relevant language servers. Each server checks for project markers before starting.

LanguageServerProject Markers
Rustrust-analyzerCargo.toml, rust-toolchain.toml
Pythonpyrightpyproject.toml, setup.py, requirements.txt
TypeScripttypescript-language-serverpackage.json, tsconfig.json
Gogoplsgo.mod, go.sum
C/C++clangdCMakeLists.txt, compile_commands.json, Makefile
Zigzlsbuild.zig, build.zig.zon

[!TIP] Heuristics use OR logic — if ANY marker exists, the server spawns.

Custom heuristics:

[[lsp_servers]]
language_id = "rust"
command = "rust-analyzer"

[lsp_servers.heuristics]
project_markers = ["Cargo.toml", "rust-toolchain.toml", ".rust-version"]
Environment Variables
VariableDescriptionDefault
MCPLS_CONFIGPath to configuration fileAuto-detected
MCPLS_LOGLog level (trace, debug, info, warn, error)info
MCPLS_LOG_JSONOutput logs as JSONfalse

Config file locations:

PlatformDefault Location
Linux~/.config/mcpls/mcpls.toml
macOS~/.config/mcpls/mcpls.toml or ~/Library/Application Support/mcpls/
Windows%APPDATA%\mcpls\mcpls.toml
Full Configuration Example
[workspace]
roots = ["/path/to/project"]
heuristics_max_depth = 10

[[lsp_servers]]
language_id = "rust"
command = "rust-analyzer"
args = []
file_patterns = ["**/*.rs"]
timeout_seconds = 30

[lsp_servers.heuristics]
project_markers = ["Cargo.toml", "rust-toolchain.toml"]

[lsp_servers.initialization_options]
cargo.features = "all"
checkOnSave.command = "clippy"

[[language_extensions]]
extensions = ["nu"]
language_id = "nushell"

See Configuration Reference for all options.

Supported Language Servers

mcpls works with any LSP 3.17 compliant server. Battle-tested with:

View supported servers
LanguageServerNotes
Rustrust-analyzerZero-config, built-in support
PythonpyrightFull type inference
TypeScript/JStypescript-language-serverJSX/TSX support
GogoplsModules and workspaces
C/C++clangdcompile_commands.json
JavajdtlsMaven/Gradle projects
Zigzlsbuild.zig support
And 24+ othersAny LSP 3.17 serverSee docs

Architecture

View architecture diagram
flowchart TB
    subgraph AI["AI Agent (Claude)"]
    end

    subgraph mcpls["mcpls Server"]
        MCP["MCP Server<br/>(rmcp)"]
        Trans["Translation Layer"]
        LSP["LSP Clients<br/>Manager"]
        MCP --> Trans --> LSP
    end

    subgraph Servers["Language Servers"]
        RA["rust-analyzer"]
        PY["pyright"]
        TS["tsserver"]
        Other["..."]
    end

    AI <-->|"MCP Protocol<br/>(JSON-RPC 2.0)"| mcpls
    mcpls <-->|"LSP Protocol<br/>(JSON-RPC 2.0)"| Servers

Key design decisions:

  • Single binary — No Node.js, Python, or other runtime dependencies
  • Async-first — Tokio-based, handles multiple LSP servers concurrently
  • Memory-safe — Pure Rust, zero unsafe blocks
  • Resource-bounded — Configurable limits on documents and file sizes

Documentation

Development

cargo build              # Build
cargo nextest run        # Test
cargo run -- --log-level debug  # Run locally

Requirements: Rust 1.88+ (Edition 2024)

Contributing

Contributions welcome. See CONTRIBUTING.md for guidelines.

License

Dual-licensed under Apache 2.0 or MIT at your option.


mcpls — Because AI deserves to understand code, not just read it.

Similar Projects

Discover other similar projects and AI models.

RepositoryKotlin
fwcd/kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol

2.0k
Jun 2, 2025
RepositoryJavaScript
affaan-m/ECC

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

315.1k
Dec 1, 2026
RepositoryJavaScript
DietrichGebert/ponytail

Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.

203.5k
Nov 22, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryRust
herdrdev/herdr

the runtime your coding agents live on

53.9k
Dec 1, 2026
RepositoryLua
neovim/nvim-lspconfig

Quickstart configs for Nvim LSP

14.0k
Dec 1, 2026
RepositoryF#
artempyanykh/marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.

3.4k
Sep 14, 2026
RepositoryTypeScript
typescript-language-server/typescript-language-server

Unofficial TypeScript & JavaScript Language Server

2.6k
Dec 1, 2026
RepositoryElixir
elixir-lsp/elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"

1.8k
Nov 24, 2026