Lean LSP MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEAN_LOG_LEVEL | No | Log level for the server. Options are "INFO", "WARNING", "ERROR", "NONE". | INFO |
| LEAN_HAMMER_URL | No | URL for a self-hosted Lean Hammer Premise Search instance. | http://leanpremise.net |
| LEAN_LOOGLE_LOCAL | No | Set to true, 1, or yes to enable local loogle. | |
| LEAN_PROJECT_PATH | No | Path to your Lean project root. Set this if the server cannot automatically detect your project. | |
| LEAN_LSP_MCP_TOKEN | No | Secret token for bearer authentication when using streamable-http or sse transport. | |
| LEAN_LOOGLE_CACHE_DIR | No | Override the cache directory for local loogle. | ~/.cache/lean-lsp-mcp/loogle |
| LEAN_STATE_SEARCH_URL | No | URL for a self-hosted premise-search.com instance. | https://premise-search.com |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| lean_buildA | Build the Lean project and restart LSP. Use only if needed (e.g. new imports). |
| lean_file_outlineA | Get imports and declarations with type signatures. Token-efficient. |
| lean_diagnostic_messagesB | Get compiler diagnostics (errors, warnings, infos) for a Lean file. |
| lean_code_actionsA | Get LSP code actions for a line. Returns resolved edits for TryThis suggestions (simp?, exact?, apply?) and other quick fixes. |
| lean_goalA | Get proof goals at a position. MOST IMPORTANT tool - use often! |
| lean_term_goalB | Get the expected type at a position. |
| lean_hover_infoA | Get type signature and docs for a symbol. Essential for understanding APIs. |
| lean_completionsA | Get IDE autocompletions. Use on INCOMPLETE code (after |
| lean_declaration_fileA | Get the source of a symbol's declaration (declaration slice + context). |
| lean_referencesA | Find all references to a symbol (including the declaration). Position cursor at the symbol. |
| lean_local_searchA | Fast local search to verify declarations exist. Use BEFORE trying a lemma name. |
| lean_leansearchA | Limit: 90req/30s. Search Mathlib via leansearch.net using natural language. |
| lean_loogleA | Search Mathlib by type signature via loogle.lean-lang.org. |
| lean_leanfinderA | Limit: 10req/30s. Semantic search by mathematical meaning via Lean Finder. |
| lean_state_searchB | Limit: 6req/30s. Find lemmas to close the goal at a position. Searches premise-search.com. |
| lean_hammer_premiseA | Limit: 6req/30s. Get premise suggestions for automation tactics at a goal position. |
| lean_multi_attemptA | Try multiple tactics without modifying file. Returns goal state for each. |
| lean_run_codeA | Run a code snippet and return diagnostics. Must include all imports. |
| lean_verifyA | Check theorem axioms + optional source scan. Only scans the given file, not imports. |
| lean_minimal_hypothesesA | For each explicit |
| lean_profile_proofA | Run |
| lean_get_widgetsA | Get panel widgets at a position (proof visualizations, #html, custom widgets). Returns raw widget data - may be large. |
| lean_get_widget_sourceA | Get JavaScript source of a widget by hash. Useful for understanding custom widget rendering logic. Returns full JS module - may be large. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/oOo0oOo/lean-lsp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server