Skip to main content

codex-lsp-mcp

codex-lsp-mcp is a local MCP stdio server that exposes read-only LSP navigation tools to Codex.

Built-in defaults target clangd for C/C++ and pyright for Python; additional LSP backends can be configured in ~/.config/codex-lsp-mcp/config.toml.

Quick start

Run the published package from PyPI:

uvx codex-lsp-mcp

Local development

uv run pytest
uvx --from . codex-lsp-mcp

Codex configuration

codex mcp add codex-lsp-mcp -- uvx codex-lsp-mcp

Check registration:

codex mcp get codex-lsp-mcp

If clangd is not on Codex's PATH, set:

[mcp_servers.codex-lsp-mcp.env]
CLANGD_BIN = "/path/to/clangd"

For Python navigation, ensure pyright-langserver is on Codex's PATH. If pyright is installed in a non-standard location, override the built-in backend in ~/.config/codex-lsp-mcp/config.toml:

[servers.pyright]
command = "/home/miot/.local/share/nvim/mason/bin/pyright-langserver"
args = ["--stdio"]
root_markers = [["pyrightconfig.json"], ["pyproject.toml"], ["setup.py"], ["setup.cfg"], ["requirements.txt"], ["Pipfile"], ["poetry.lock"], [".git", ".repo"]]
workspace_hint_extension = ".py"

[servers.pyright.extension_to_language]
".py" = "python"

The server discovers the closest compile_commands.json from the queried file path.

Tool coordinates follow the LSP convention: zero-based line and character.

Workspace roots

File-oriented tools (definition, references, hover, diagnostics, and document_symbols) accept an optional root_hint argument. Use it when file is relative or when the MCP server process is not running from the project root:

{
  "file": "miio_test/cli.py",
  "line": 86,
  "character": 18,
  "root_hint": "/home/miot/Work/miot/tool/miio_test"
}

Absolute file paths are not rewritten by root_hint, but the hint is still used as the fallback workspace root when no server-specific root marker is found. Server-specific markers still take precedence, such as compile_commands.json for clangd and pyproject.toml for pyright.

workspace_symbols already accepts root_hint and can also take server_name when a directory is ambiguous across multiple configured LSP backends.

Metadata

Release files for codex-lsp-mcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codex-lsp-mcp 0.3.0
File Size Uploaded Provenance Actions
codex_lsp_mcp-0.3.0.tar.gz 28.9 kB Without provenance Details for codex_lsp_mcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codex-lsp-mcp 0.3.0
File Interpreter ABI Platform Actions
codex_lsp_mcp-0.3.0-py3-none-any.whl Python 3 none any Details for codex_lsp_mcp-0.3.0-py3-none-any.whl

Total release size: 42.6 kB

Release files / codex_lsp_mcp-0.3.0.tar.gz

Download URL codex_lsp_mcp-0.3.0.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d0389c17735d710c924e5678ae87472efeb1c98b6611b604f09f5f80523721dd
BLAKE2b-256 checksum
How to use checksums
3c70cbf269724f8b56395680ba5b964304443ba30627cd2620545a48dda0ef68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / codex_lsp_mcp-0.3.0-py3-none-any.whl

Download URL codex_lsp_mcp-0.3.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87fc7fe29900ccef1fef30cd188436fbfe277b51c8fe8628ffa0aff3e4300e48
BLAKE2b-256 checksum
How to use checksums
0113aed3f4a4183b0c3aa6fe0121fbfab9d54fcb0fc9b98a2fd68a8e44ddbfd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for codex-lsp-mcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page