# Lsp Mcp

> LSP MCP Server

- **Type:** MCP server
- **Install:** `agentstack add mcp-bumpyclock-lsp-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [BumpyClock](https://agentstack.voostack.com/s/bumpyclock)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [BumpyClock](https://github.com/BumpyClock)
- **Source:** https://github.com/BumpyClock/lsp-mcp

## Install

```sh
agentstack add mcp-bumpyclock-lsp-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# lsp-mcp

LSP-MCP is built off the lsproxy project by Agentic Labs.

The goal is to provide a multi-language MCP server that offers precise code navigation and analysis through Language Servers and tree-sitter

Primarily designed to expose LSP functionality over MCP stdio for AI coding agents. Tested for Golang, Rust, and Typescript. Although support for Python , Ruby etc is also present based on the original lsproxy implementation.

## Credits
This is built on top of the lsproxy project by Agentic Labs and tree-sitter implementation is inspired by the Roo Code project. All credits to them for the original implementation.

## Key Features

- 🎯 **Precise Code Navigation**: Jump to definitions, find all references, and navigate implementations across your entire project.
- 🔍 **Symbol Search**: Search symbols by name across the workspace or find identifiers within files.
- 📝 **Code Intelligence**: Get hover information, type signatures, and context-aware code details at any position.
- 🌳 **Call Hierarchies**: Query incoming and outgoing function calls, including external dependencies.
- 🔗 **Reference Analysis**: Find symbols referenced by a definition and explore code relationships.
- 📊 **Code Diagnostics**: Get language-specific lint errors, warnings, and diagnostics for files or the entire workspace.
- 🔄 **Semantic Search**: (Optional) Perform natural language code search using embeddings for semantic similarity.
- 🌐 **Multi-Language Support**: Access multiple language servers (Rust, TypeScript, Go, Python, Ruby, Java, PHP, C/C++) through a single MCP server.
- 🛠️ **Auto-Configuration**: Guided setup tool to detect and configure language servers based on your project files.
- 📁 **File Operations**: List workspace files and read source code with line/character range support.
    
Runs one MCP server per project root. The server uses the current working directory as the workspace unless overridden.

## Installation
```bash
cargo run --bin lsp-mcp -- --workspace-root /path/to/project
```

Source builds need ast-grep rules installed under `/usr/src/ast_grep`:

```bash
bash scripts/install-ast-grep-rules.sh
```

Configure your MCP client to launch the server with the project root as the working directory. The server communicates over stdio.

## Pre-building the Semantic Search Index

When semantic search is enabled, the initial indexing can be resource-intensive. To avoid slowdowns during normal MCP usage, you can pre-build the index from the command line:

```bash
# Build index for current directory
lsp-mcp --index

# Build index for a specific workspace
lsp-mcp --index --workspace-root /path/to/project

# Force full rebuild from scratch
lsp-mcp --index --force
```

The `--index` flag:
- Builds the semantic search index and exits (does not start the MCP server)
- Auto-enables semantic search even if not configured in `.lsp-mcp.json`
- Shows progress: `Indexing: 150/500 files (30%)`
- Reports final stats: chunks indexed and time elapsed

The `--force` flag deletes any existing index and rebuilds from scratch.

## GPU Acceleration (FastEmbed)

FastEmbed uses ONNX Runtime execution providers. GPU acceleration is enabled at build time via cargo features and used
automatically at runtime (highest-priority available provider is selected, then CPU fallback).

Build flags:

```bash
# macOS Apple Silicon (CoreML / ANE where available)
cargo build --features ort-coreml

# Windows NVIDIA (CUDA) + DirectML fallback
cargo build --features ort-cuda,ort-directml

# Windows DirectML only (AMD/Intel/NVIDIA DX12 GPUs)
cargo build --features ort-directml

# Linux AMD ROCm (optional)
cargo build --features ort-rocm
```

Notes:
- CUDA requires a CUDA-enabled ONNX Runtime build and compatible NVIDIA drivers/runtime on the target machine.
- DirectML requires Windows 10+ and a DX12-capable GPU (AMD/Intel/NVIDIA).
- CoreML is supported on macOS and will use ANE when available.

***Note on CoreML:*** I've tested this on my M1 Max Macbook Pro and it works but is slower than the CPU fallback. CPU fallback will consume a lot of resources on initial indexing for a couple of minutes and then settle down to minor spikes when re-indexing files. 

### MCP client configuration

Use a stdio MCP client configuration that launches one server per workspace. The key pieces are the `command` and `args`; if your client supports `cwd`, set it to the workspace root.

Dev (run from source):
```json
{
  "mcpServers": {
    "lsp-mcp": {
      "command": "cargo",
      "args": [
        "run",
        "--bin",
        "lsp-mcp",
        "--",
        "--workspace-root",
        "/path/to/project"
      ],
      "cwd": "/path/to/project"
    }
  }
}
```

Package (installed binary):
```json
{
  "mcpServers": {
    "lsp-mcp": {
      "command": "lsp-mcp",
      "args": [
        "--workspace-root",
        "/path/to/project"
      ],
      "cwd": "/path/to/project"
    }
  }
}
```

Claude Code (`~/.claude.json`):
Dev (run from source):
```json
{
  "mcpServers": {
    "lsp-mcp": {
      "type": "stdio",
      "command": "cargo",
      "args": [
        "run",
        "--bin",
        "lsp-mcp",
        "--",
        "--workspace-root",
        "/path/to/project"
      ],
      "cwd": "/path/to/project"
    }
  }
}
```

Package (installed binary):
```json
{
  "mcpServers": {
    "lsp-mcp": {
      "type": "stdio",
      "command": "lsp-mcp",
        }
  }
}
```

Codex CLI (`~/.codex/config.toml`):
Dev (run from source):
```toml
[mcp_servers.lsp-mcp]
command = "cargo"
args = ["run", "--bin", "lsp-mcp", "--", "--workspace-root", "/path/to/project"]
```

Package (installed binary):
```toml
[mcp_servers.lsp-mcp]
command = "lsp-mcp"
args = ["--workspace-root", "/path/to/project"]
```

## Configuration

You can customize `lsp-mcp` behavior with a `.lsp-mcp.json` file in your workspace root.
See `CONFIGURATION.md` for the full schema and examples.

### First-time setup

On first launch (no project config), the `initialSetup` tool is enabled in the standard preset to help configure languages and binaries.
If a project `.lsp-mcp.json` exists, `initialSetup` is auto-disabled unless you set `"tools": { "initial_setup": "enabled" }`.
After setup, add `initialSetup` to `"tools": { "disable": ["initialSetup"] }` and restart your agent.

### Output Mode

Control the verbosity of tool outputs:

```json
{
  "output": {
    "mode": "verbose"
  }
}
```

- `"default"` (default): Compact output format
- `"verbose"`: Detailed output with full information

  
## Supported languages

|Language|Server|URL|
|:-|:-|:-|
|C/C++|`clangd`|https://clangd.llvm.org/|
|Golang|`gopls`|https://github.com/golang/tools/tree/master/gopls|
|Java|`jdtls`|https://github.com/eclipse-jdtls/eclipse.jdt.ls|
|Javascript|`typescript-language-server`|https://github.com/typescript-language-server/typescript-language-server|
|PHP|`phpactor`|https://github.com/phpactor/phpactor|
|Python|`jedi-language-server`|https://github.com/pappasam/jedi-language-server|
|Rust|`rust-analyzer`|https://github.com/rust-lang/rust-analyzer|
|Typescript|`typescript-language-server`|https://github.com/typescript-language-server/typescript-language-server|
|csharp|`omnisharp-roslyn`|https://github.com/OmniSharp/omnisharp-roslyn|
|Your Favorite Language | Awesome Language Server | https://github.com/agentic-labs/lsproxy/issues/new |

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [BumpyClock](https://github.com/BumpyClock)
- **Source:** [BumpyClock/lsp-mcp](https://github.com/BumpyClock/lsp-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-bumpyclock-lsp-mcp
- Seller: https://agentstack.voostack.com/s/bumpyclock
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
