MCP server that allows agentic interaction with the [Lean theorem prover](https://lean-lang.org/) via the [Language Server
Lean Lsp MCP becomes available to MCP clients through the lean lsp mcp mcp server. MCP server that allows agentic interaction with the Lean theorem prover via the Language Server Protocol using leanclient. This server.
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.
lake build manually. 3. Configure your IDE/Setup 4. (Optional, highly recommended) Install ripgrep (rg) for local search and source scanning (lean_verify warnings).Once connected, the assistant can call these 4 tools directly:
LEAN_MCP_DISABLED_TOOLS — Comma-separated tool names (for example lean_run_code,lean_build)LEAN_MCP_INSTRUCTIONS — Replacement server instructions stringLEAN_MCP_TOOL_DESCRIPTIONS — JSON object to override tool descriptionsOverview — 1. Install uv, a Python package manager. 2. Make sure your Lean project builds quickly by runningThe server is distributed via npm as @modelcontextprotocol/inspector, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
Before the server will start you need to supply 8 environment variables: LEAN_PROJECT_PATH, LEAN_LOG_LEVEL, LEAN_MCP_DISABLED_TOOLS, LEAN_MCP_INSTRUCTIONS, LEAN_MCP_TOOL_DESCRIPTIONS, CONTROL_PLANE_API_KEY, LEAN_LSP_MCP_TOKEN, LEAN_REPL. Keep credentials in your client's env block or a secrets manager rather than committing them.
Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Lean Lsp MCP sits in that group, and the shape of its toolset — LEAN_MCP_DISABLED_TOOLS, LEAN_MCP_INSTRUCTIONS, LEAN_MCP_TOOL_DESCRIPTIONS among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| LEAN_MCP_DISABLED_TOOLS | Comma-separated tool names (for example lean_run_code,lean_build). |
| LEAN_MCP_INSTRUCTIONS | Replacement server instructions string. |
| LEAN_MCP_TOOL_DESCRIPTIONS | JSON object to override tool descriptions. |
| Overview | 1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/), a Python package manager. 2. Make sure your Lean project builds quickly by running lake build manually. 3. Configure your IDE/Setup 4. (Optional, |
{
"mcpServers": {
"lean-lsp": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/inspector"],
"env": {
"LEAN_PROJECT_PATH": "your-value",
"LEAN_LOG_LEVEL": "your-value",
"LEAN_MCP_DISABLED_TOOLS": "your-value",
"LEAN_MCP_INSTRUCTIONS": "your-value",
"LEAN_MCP_TOOL_DESCRIPTIONS": "your-value",
"CONTROL_PLANE_API_KEY": "your-value",
"LEAN_LSP_MCP_TOKEN": "your-value",
"LEAN_REPL": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
| Variable | Description | Required |
|---|---|---|
| LEAN_PROJECT_PATH | Filesystem location the server is allowed to use. | Optional |
| LEAN_LOG_LEVEL | Configuration value read at startup. | Optional |
| LEAN_MCP_DISABLED_TOOLS | Configuration value read at startup. | Optional |
| LEAN_MCP_INSTRUCTIONS | Configuration value read at startup. | Optional |
| LEAN_MCP_TOOL_DESCRIPTIONS | Configuration value read at startup. | Optional |
| CONTROL_PLANE_API_KEY | Credential the server authenticates with. | Yes |
| LEAN_LSP_MCP_TOKEN | Credential the server authenticates with. | Yes |
| LEAN_REPL | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.