Lean Lsp MCP Server

MCP server that allows agentic interaction with the [Lean theorem prover](https://lean-lang.org/) via the [Language Server

Remote serverstreamable-httpPython

What is the Lean Lsp MCP Server?

Lean Lsp MCP becomes available to MCP clients through the Lean Lsp MCP. MCP server that allows agentic interaction with the Lean theorem prover via the Language Server Protocol using leanclient. This server.

What Lean Lsp MCP does

MCP server that allows agentic interaction with the Lean theorem prover via the Language Server Protocol using leanclient. This server provides a range of tools for LLM agents to understand, analyze and interact with Lean projects.

  1. Install uv, a Python package manager. 2. Make sure your Lean project builds quickly by running lake build manually. 3. Configure your IDE/Setup 4. (Optional, highly recommended) Install ripgrep (rg) for local search and source scanning (lean_verify warnings).

Key capabilities

  • Rich Lean Interaction — Access diagnostics, goal states, term information, hover documentation and more
  • External Search Tools — Use LeanSearch, Loogle, Lean Finder, Lean Hammer and Lean State Search to find relevant theorems and definitions
  • Easy Setup — Simple configuration for various clients, including VSCode, Cursor and Claude Code

Practical notes

  • Maintained by oOo0oOo, written in Python.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Configuration

VariableDescriptionRequired
LEAN_PROJECT_PATHFilesystem location the server is allowed to use.Optional
LEAN_LOG_LEVELConfiguration value read at startup.Optional
LEAN_MCP_DISABLED_TOOLSConfiguration value read at startup.Optional
LEAN_MCP_INSTRUCTIONSConfiguration value read at startup.Optional
LEAN_MCP_TOOL_DESCRIPTIONSConfiguration value read at startup.Optional
CONTROL_PLANE_API_KEYCredential the server authenticates with.Yes
LEAN_LSP_MCP_TOKENCredential the server authenticates with.Yes
LEAN_REPLConfiguration value read at startup.Optional

Example prompts to try

  • “Use Lean Lsp MCP to LEAN MCP DISABLED TOOLS.”
  • “Use Lean Lsp MCP to LEAN MCP INSTRUCTIONS.”
  • “Use Lean Lsp MCP to LEAN MCP TOOL DESCRIPTIONS.”

Frequently asked questions

MCP server that allows agentic interaction with the [Lean theorem prover](https://lean-lang.org/) via the [Language Server Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.