karellen-lsp-mcp
MCP server bridging LLMs to LSP servers for structured code intelligence — definitions, references, call/type hierarchies, hover, symbols, diagnostics. Multi-session shared daemon with refcounted LSP server instances. Starts with C/C++ via clangd, extensible to any language.
Install / Use
claude mcp add karellen -- npx -y github:karellen/karellen-lsp-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of karellen-lsp-mcp
karellen-lsp-mcp scores 83/100 on our quality scale, 656th of 953 AI & Machine Learning skills we index.
Its MCP Server is 23 KB long, well organised into 37 sections with 33 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 25 days ago, so karellen-lsp-mcp is actively maintained.
- Our last check on 2026-09-20 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky: README instructs users to add broad MCP auto-approve allow-list entries (mcp__karellen-lsp-mcp__*) to Claude settings, weakening permission safeguards.
AI review: risky
- README instructs users to add broad MCP auto-approve allow-list entries (mcp__karellen-lsp-mcp__*) to Claude settings, weakening permission safeguards.
- It provides a CLAUDE.md template that tells the agent to perform project setup (search, generate compile_commands.json, register) without asking the user or pausing for confirmation.
- The build and LSP commands shown are otherwise normal, legitimate development tooling.
AI review by kimi-k2.7-code on 2026-10-02. Automated pattern scan on 2026-10-02. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
karellen-lsp-mcp compared with similar skills
All 4 of these similar skills score higher than karellen-lsp-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| karellen-lsp-mcp (this skill)by karellen | 83 | 3 | 25d ago | MCP Server |
| claude-memby thedotmack | 100 | 113.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 108.9k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.7k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
Frequently asked questions
- How do I install karellen-lsp-mcp?
- Run
claude mcp add karellen -- npx -y github:karellen/karellen-lsp-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does karellen-lsp-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is karellen-lsp-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky: README instructs users to add broad MCP auto-approve allow-list entries (mcp__karellen-lsp-mcp__*) to Claude settings, weakening permission safeguards. It is Apache-2.0-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is karellen-lsp-mcp still maintained?
- The repository was last updated 25 days ago, so karellen-lsp-mcp is actively maintained.
Skill content
View source on GitHubMCP Server for LSP Code Intelligence (karellen-lsp-mcp)
Overview
karellen-lsp-mcp gives LLM clients structured code intelligence via
LSP (Language Server Protocol)
servers. Instead of reading through entire codebases, the LLM can query definitions,
references, call hierarchies, type hierarchies, hover documentation, symbols, and
diagnostics — the same information a human developer gets from their IDE.
Two interfaces, one daemon:
- MCP interface (
karellen-lsp-mcp): Explicit tool calls with structured responses. Requires MCP tool approval or allow-rules. - LSP proxy interface (
karellen-lsp): Native LSP server that Claude Code uses transparently — no permission prompts, no manual project registration. Auto-detects languages and routes to backend LSP servers.
Architecture
Multiple Claude sessions share a single daemon process and a single LSP server per project, avoiding duplicate server instances and redundant indexing:
Claude Code LSP Claude MCP Session 1 Claude MCP Session 2
│ (stdio) │ (stdio) │ (stdio)
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ LSP proxy │ │ MCP stdio │ │ MCP stdio │
│ frontend │ │ frontend │ │ frontend │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ (Unix socket) │ │
▼ ▼ ▼
┌──────────────────────────────────────────────────────────────┐
│ karellen-lsp-mcp daemon │
│ │
│ Project Registry (refcounted) │
│ project-A refcount=3 ──► clangd │
│ project-B refcount=1 ──► jdtls │
└──────────────────────────────────────────────────────────────┘
- Daemon: Persistent process, owns all LSP server subprocesses and the project registry. Listens on Unix domain socket. User-scoped. Auto-starts when the first frontend connects, auto-exits after idle timeout with no connections.
- MCP frontend: Thin stdio process per Claude session. Connects to daemon, proxies MCP tool calls. Returns structured data (dataclasses) for fast LLM processing.
- LSP proxy frontend: Standard LSP server over stdio. Auto-detects languages on
initialize, registers projects, routes LSP requests to the correct backend. Reuses the same adapters, normalizers, and readiness tracking as MCP.
Supported Languages
| Language | Default LSP Server | Autodetection | Details |
|----------|-------------------|---------------|---------|
| C / C++ | clangd | CMake, Meson, autotools, Make, Bazel | docs/c-cpp.md |
| Java / Kotlin | jdtls | Gradle, Maven, Ant | docs/java-kotlin.md |
| Python | pyright | PyBuilder, pyproject.toml, setup.py, Pipfile, requirements.txt | docs/python.md |
| Rust | rust-analyzer | Cargo.toml, workspace detection | docs/rust.md |
| Any | Custom via lsp_command parameter | — | Provide the command in lsp_register_project |
Projects are autodetected when language is omitted from lsp_register_project, or
inspected explicitly via lsp_detect_project. Detection scans build system markers,
IDE metadata (JetBrains .idea/, Eclipse, VS Code), and source file conventions.
Requirements
- Python >= 3.10
- An LSP server for your language, installed and on PATH
- Linux or macOS (uses Unix domain sockets; Windows 10 build 17063+ also works)
Installation
pip install --user karellen-lsp-mcp
Install with LSP server dependencies:
pip install --user karellen-lsp-mcp[clangd] # C/C++ support
pip install --user karellen-lsp-mcp[jdtls] # Java/Kotlin support
pip install --user karellen-lsp-mcp[pyright] # Python support
pip install --user karellen-lsp-mcp[all] # All LSP servers
# Rust: rustup component add rust-analyzer
Or with pipx for an isolated environment:
pipx install 'karellen-lsp-mcp[all]'
Claude Code Integration
Plugin Installation (Recommended)
The plugin provides both interfaces in one package:
- Native LSP server (
karellen-lsp): Transparent code intelligence — Claude Code uses it automatically for supported file types. No permission prompts, no manual registration. Auto-detects languages from CWD and routes to backend LSP servers. - MCP tools (
karellen-lsp-mcp): Explicit tool calls with structured responses, plus hooks (prerequisite checks, compiler error detection), skills (/karellen-lsp-mcp:lsp-register,/karellen-lsp-mcp:lsp-investigate), and an autonomouslsp-investigatoragent.
Both share the same daemon — MCP-registered projects are visible to native LSP queries and vice versa.
From Karellen marketplace:
claude plugin marketplace add karellen/claude-plugins
claude plugin install karellen-lsp-mcp@karellen-plugins
From local checkout:
claude --plugin-dir /path/to/karellen-lsp-mcp
Manual MCP Configuration (Alternative)
If you prefer not to use the plugin system, configure the MCP server directly:
claude mcp add --transport stdio karellen-lsp-mcp -- karellen-lsp-mcp
Or manually add to ~/.claude.json (user scope) or .mcp.json in your project root
(project scope, shared via version control):
{
"mcpServers": {
"karellen-lsp-mcp": {
"type": "stdio",
"command": "karellen-lsp-mcp"
}
}
}
If installed with pipx:
claude mcp add --transport stdio karellen-lsp-mcp -- pipx run karellen-lsp-mcp
or manually:
{
"mcpServers": {
"karellen-lsp-mcp": {
"type": "stdio",
"command": "pipx",
"args": ["run", "karellen-lsp-mcp"]
}
}
}
Note: manual MCP configuration provides tools only, without hooks, skills, or agents.
Auto-approve MCP tools
The native LSP interface requires no approval — Claude Code uses it transparently.
For MCP tools, Claude Code prompts for confirmation by default. To auto-approve, add
a permission rule to your user settings
(~/.claude/settings.json):
{
"permissions": {
"allow": [
"mcp__karellen-lsp-mcp__*",
"mcp__plugin_karellen-lsp-mcp_karellen-lsp-mcp__*"
]
}
}
Or for a project-scoped setting, add the same rule to .claude/settings.json in your
project root (this file can be committed to version control so all team members get it).
Teach Claude the LSP workflow
Claude will automatically discover all lsp_* tools, but to teach it when and how to
use them effectively, add the following to your project's CLAUDE.md:
## LSP Code Intelligence
### When to Use LSP Tools
Use the `lsp_*` MCP tools for navigating and understanding codebases — especially when
you need to trace call chains, find all references to a symbol, understand type
hierarchies, or check compiler diagnostics without reading entire files.
### Setup
Register your project once at the start of a session. Do NOT ask the user for
configuration details. Do NOT narrate intermediate steps. Do the entire setup
(search, generate if needed, register) in one action sequence without pausing for
confirmation.
**C/C++ projects** use clangd as the default LSP server. clangd needs a
`compile_commands.json` for accurate results. Most projects don't have one pre-built.
Do all of this in one go:
1. Search for an existing `compile_commands.json` — use `Glob` to check the project
tree. Also check if there's an existing build directory (look for `build/`,
`cmake-build-*/`, `out/`, or a `compile_commands.json` symlink in the project root).
2. If not found, detect the build system and generate it:
- `CMakeLists.txt` → check if there's already a build directory with cmake cache
(in-tree or out-of-tree). If an existing build dir has `CMakeCache.txt`, re-run
cmake there with `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. Otherwise run
`cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build`.
- `meson.build` → `meson setup build` (generates it automatically)
- `Makefile`/`configure`/autotools → use Bear if available (`bear -- make`), or
run `make -n` to get compiler commands and write `compile_commands.json` yourself
- No build system → register without `build_info` (clangd still works for basics)
3. Register immediately — don't ask for confirmation:
```
lsp_register_project(
project_path="/path/to/project",
language="cpp", # or "c"
build_info={"compile_commands_dir": "/path/to/dir/containing/compile_commands.json"}
)
```
**Other languages**: pass a custom `lsp_command`:
```
lsp_register_project(
project_path="/path/to/project",
language="go",
lsp_command=["gopls"]
)
```
### Key Rules
- **Use LSP instead of grepping**: `lsp_find_references` is semantically aware — it finds
actual references, not string matches. It won't return comments, strings, or unrelated
symbols with the same name
- **Hover before reading**: `lsp_hover` gives you the type signature and documentation
for any symbol — often enough to understand usage without reading the full definition
- **Call hierarchy for impact analysis**: before changing a function, use
`lsp_call_tree_incoming` to get the full recursive call tree in one shot, or
`lsp_call_hierarchy_incoming` for a single level
- **Single-file queries work immediately**: `lsp_read_definition`, `lsp_hover`, and
`lsp_document_symbols` don't wait for background indexing. Use these freely even on
large codebases that are still indexing
- **Cross-file queries wait for indexing automatically**: `lsp_find_references`,
call hierarchy, type hierarchy, and `lsp_diagnostics` wait for indexing to finish,
with the timeout extending automatically as long as progress is being made. No need
to poll or sleep. Use `lsp_indexing_status(project_id)` to check progress on large
codebases
- **All positions are 1-based**: line and character offsets in both input and output
start at 1. Values from one tool's output (e.g. `lsp_workspace_symbols`) can be
fed directly into another tool's input (e.g. `lsp_read_definition`)
- **Stale compile_commands.json is auto-detected**: if build config files
(`CMakeLists.txt`, `meson.build`) are newer than `compile_commands.json`, or
5% or more of referenced
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
113.0kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
108.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
90.7kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
