home / mcp / codex lsp bridge mcp server

Codex LSP Bridge MCP Server

Exposes LSP capabilities as MCP tools for IDE-grade code navigation and actions across multiple languages.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cesarpetrescu-lsp-mcp": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "CODEX_LSP_BRIDGE_CONFIG": "/path/to/config/default.toml"
      }
    }
  }
}

Codex LSP Bridge exposes Language Server Protocol features as MCP tools, enabling IDE-grade navigation, hover information, code actions, and more across multiple languages. It lets you drive code understanding directly from the MCP client, using a single endpoint or a local bridge process for fast, consistent results across projects.

How to use

Connect your MCP client to the Codex LSP Bridge to start using LSP-powered actions. You can run the bridge locally and point your MCP client to the bridge’s MCP endpoint, or you can connect through a remote HTTP configuration. Once connected, you will be able to navigate code, inspect definitions, get hover documentation, apply autofixes, and perform many other language-aware operations through MCP tools.

How to install

Prerequisites: you need Python to install the bridge and manage its environment. You may also install language servers for your target languages using your preferred package manager.

# from the project root
pip install -e .

Install language servers for the languages you want to support. The following commands install common servers used by the bridge.

# Python language server
pip install basedpyright   # provides basedpyright-langserver
# OR
npm i -g pyright           # provides pyright-langserver

# Rust language server
rustup component add rust-analyzer

# C/C++ language server
# install clangd via your platform (llvm package)
clangd --version

# TypeScript/JavaScript/Node/React
npm i -g typescript typescript-language-server

# HTML/CSS
npm i -g vscode-langservers-extracted

Run the MCP bridge with a configuration file and host/port of your choice.

codex-lsp-bridge serve --config ./config/default.toml --host 127.0.0.1 --port 8000

Connect Codex CLI by configuring the MCP endpoint in your user configuration. Use HTTP or stdio transport as shown.

experimental_use_rmcp_client = true

[mcp_servers.lsp_bridge]
url = "http://127.0.0.1:8000/mcp"
```

Or use the Codex CLI helper to add the MCP server:

```bash
codex mcp add lsp_bridge --url http://127.0.0.1:8000/mcp

Additional usage notes

Working with LSP tools yields accurate navigation and refactoring results. Prefer LSP rename_symbol, go_to_definition, and code_action over plain text search for optimal correctness.

Available tools

go_to_definition

Navigate to the location where a symbol is defined in the current file or project.

type_definition

Navigate to the type definition of a symbol if available.

find_references

Find all references to a symbol across the workspace.

rename_symbol

Rename a symbol across the codebase with LSP support.

hover

Show quick information about a symbol under the cursor.

signature_help

Show function/method signature and parameter information.

document_symbols

List symbols defined in the current document.

workspace_symbols

List symbols across the entire workspace.

code_action

Apply quick fixes or refactors suggested by language servers.

format_document

Format the current document according to language-specific rules.

call_hierarchy

Explore call relationships for a symbol (who calls whom).

diagnostics

Show diagnostic information such as errors and warnings from language servers.

wait_for_diagnostics

Wait for the latest diagnostic information after edits.

lsp_bridge_status

Check the status of the LSP bridge and its connections.

resolve_symbol

Fuzzy or name-based lookup to locate symbols across files.