oOo0oOo/lean-lsp-mcp
Lean Theorem Prover MCP
7932203d79dblean-lsp-mcp0.33.0 in pyproject.tomlPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- In 46 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 1 of 23 tools, prompts and resources could not be followed through the code
Top risks in plain words
- MEDIUM1 production dependency has known vulnerabilities (worst: medium).
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it a narrowly scoped token
Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.
- Update its vulnerable packages
Use
opentelemetry-api1.45.2 or later. - Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 23 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
lean_code_actions, lean_completions, lean_declaration_file, lean_diagnostic_messages, lean_file_outline, lean_get_widget_source and 10 morelean_code_actions, lean_completions, lean_declaration_file, lean_diagnostic_messages, lean_file_outline, lean_get_widget_source and 13 morelean_build, lean_code_actions, lean_completions, lean_declaration_file, lean_diagnostic_messages, lean_file_outline and 13 moreNo tool was seen to: connect to the internet or other hosts; read passwords, tokens or keys; touch sensitive locations.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files6 tools · lean_declaration_file, lean_hammer_premise, lean_leanfinder +3
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (23: 23 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
functiontool
No description.
lean_buildtool Build the Lean project and restart LSP. Use only if needed (e.g. new imports).Env vars
Build the Lean project and restart LSP. Use only if needed (e.g. new imports).
lean_code_actionstool Get LSP code actions for a line. Returns resolved edits for TryThis suggestions (simp?, exact?, apply?) and other quick fixes.ProcessesFilesEnv vars
Get LSP code actions for a line. Returns resolved edits for TryThis suggestions (simp?, exact?, apply?) and other quick fixes.
lean_completionstool Get IDE autocompletions. Use on INCOMPLETE code (after `.` or partial name).ProcessesFilesEnv vars
Get IDE autocompletions. Use on INCOMPLETE code (after `.` or partial name).
lean_declaration_filetool Get declaration source with the source-line range and surrounding context.ProcessesFilesEnv varsoutside text
Get declaration source with the source-line range and surrounding context.
Generated declarations include their source declaration when it is clear.
Set full_file=True for the whole file (can be very large).lean_diagnostic_messagestool Get compiler diagnostics (errors, warnings, infos) for a Lean file.ProcessesFilesEnv vars
Get compiler diagnostics (errors, warnings, infos) for a Lean file.
lean_file_outlinetool Get imports and declarations with type signatures. Token-efficient.ProcessesFilesEnv vars
Get imports and declarations with type signatures. Token-efficient.
lean_get_widget_sourcetool Get JavaScript source of a widget by hash. Useful for understanding custom widget rendering logic. Returns full JS module - may be large.ProcessesFilesEnv vars
Get JavaScript source of a widget by hash. Useful for understanding custom widget rendering logic. Returns full JS module - may be large.
lean_get_widgetstool Get panel widgets at a position (proof visualizations, #html, custom widgets). Returns raw widget data - may be large.ProcessesFilesEnv vars
Get panel widgets at a position (proof visualizations, #html, custom widgets). Returns raw widget data - may be large.
lean_goaltool Get proof goals at a position. MOST IMPORTANT tool - use often!ProcessesFilesEnv vars
Get proof goals at a position. MOST IMPORTANT tool - use often!
Omit column to see goals_before (line start) and goals_after (line end),
showing how the tactic transforms the state. status='complete' means the
proof is finished at this point; status='no_goal_at_position' means the
position carries no proof state (e.g. outside a proof).lean_hammer_premisetool Get premise suggestions for automation tactics at a goal position.ProcessesFilesEnv varsoutside text
Get premise suggestions for automation tactics at a goal position.
Returns lemma names to try with `simp only [...]`, `aesop`, or as hints.lean_hover_infotool Get type signature and docs for a symbol. Essential for understanding APIs.ProcessesFilesEnv vars
Get type signature and docs for a symbol. Essential for understanding APIs.
lean_leanfindertool Semantic search by mathematical meaning via Lean Finder.Filesoutside text
Semantic search by mathematical meaning via Lean Finder.
Examples: "commutativity of addition on natural numbers",
"I have h : n < m and need n + 1 < m + 1", proof state text.
The `version` argument selects which mathlib snapshot to query
(v4.19.0, v4.24.0, or v4.28.0). Default: v4.28.0.lean_leansearchtool Search Mathlib via leansearch.net using natural language.Filesoutside text
Search Mathlib via leansearch.net using natural language.
Examples: "sum of two even numbers is even", "Cauchy-Schwarz inequality",
"{f : A → B} (hf : Injective f) : ∃ g, LeftInverse g f"lean_local_searchtool Fast local search to verify declarations exist. Use BEFORE trying a lemma name.ProcessesEnv vars
Fast local search to verify declarations exist. Use BEFORE trying a lemma name.
lean_loogletool Search Mathlib by type signature via loogle.lean-lang.org.FilesEnv varsoutside text
Search Mathlib by type signature via loogle.lean-lang.org.
Examples: `Real.sin`, `"comm"`, `(?a → ?b) → List ?a → List ?b`,
`_ * (_ ^ _)`, `|- _ < _ → _ + 1 < _ + 1`lean_minimal_hypothesestool For each explicit `(h : T)` hypothesis of a theorem, drop it and re-elaborateProcessesFilesEnv vars
For each explicit `(h : T)` hypothesis of a theorem, drop it and re-elaborate
a scratch copy of the file. Reports which hypotheses are load-bearing and which
are actually unused. Skips implicit `{x : α}` and instance `[inst : C]` binders
(those are usually inferable / always load-bearing). Does not rewrite the proof
body — a body that names `h` will fail to elaborate without the binder, which
is the truthful answer (load-bearing).
Variants are checked in parallel on scratch documents; the file is never edited.lean_multi_attempttool Try multiple tactics without modifying file. Returns goal state for each.
Try multiple tactics without modifying file. Returns goal state for each.
lean_profile_prooftool Run `lean --profile` on a theorem. Returns per-line timing and categories. SLOW - avoid on theorems that already hit heartbeat limits.ProcessesFilesEnv varsoutside text
Run `lean --profile` on a theorem. Returns per-line timing and categories. SLOW - avoid on theorems that already hit heartbeat limits.
lean_referencestool Find all references to a symbol (including the declaration). Position cursor at the symbol.ProcessesFilesEnv vars
Find all references to a symbol (including the declaration). Position cursor at the symbol.
lean_run_codetool Run a code snippet and return diagnostics. Must include all imports.FilesEnv vars
Run a code snippet and return diagnostics. Must include all imports.
lean_term_goaltool Get the expected type at a position.ProcessesFilesEnv vars
Get the expected type at a position.
lean_verifytool Check theorem axioms + optional source scan. Only scans the given file, not imports.ProcessesFilesEnv vars
Check theorem axioms + optional source scan. Only scans the given file, not imports.
Text the model reads (23)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
function tool
lean_multi_attempt tool
Try multiple tactics without modifying file. Returns goal state for each.
lean_run_code tool
Run a code snippet and return diagnostics. Must include all imports.
lean_verify tool
Check theorem axioms + optional source scan. Only scans the given file, not imports.
lean_minimal_hypotheses tool
For each explicit `(h : T)` hypothesis of a theorem, drop it and re-elaborate
a scratch copy of the file. Reports which hypotheses are load-bearing and which
are actually unused. Skips implicit `{x : α}` and instance `[inst : C]` binders
(those are usually inferable / always load-bearing). Does not rewrite the proof
body — a body that names `h` will fail to elaborate without the binder, which
is the truthful answer (load-bearing).
Variants are checked in parallel on scratch documents; the file is never edited.lean_profile_proof tool
Run `lean --profile` on a theorem. Returns per-line timing and categories. SLOW - avoid on theorems that already hit heartbeat limits.
lean_build tool
Build the Lean project and restart LSP. Use only if needed (e.g. new imports).
lean_file_outline tool
Get imports and declarations with type signatures. Token-efficient.
lean_diagnostic_messages tool
Get compiler diagnostics (errors, warnings, infos) for a Lean file.
lean_code_actions tool
Get LSP code actions for a line. Returns resolved edits for TryThis suggestions (simp?, exact?, apply?) and other quick fixes.
lean_goal tool
Get proof goals at a position. MOST IMPORTANT tool - use often!
Omit column to see goals_before (line start) and goals_after (line end),
showing how the tactic transforms the state. status='complete' means the
proof is finished at this point; status='no_goal_at_position' means the
position carries no proof state (e.g. outside a proof).lean_term_goal tool
Get the expected type at a position.
lean_hover_info tool
Get type signature and docs for a symbol. Essential for understanding APIs.
lean_completions tool
Get IDE autocompletions. Use on INCOMPLETE code (after `.` or partial name).
lean_declaration_file tool
Get declaration source with the source-line range and surrounding context.
Generated declarations include their source declaration when it is clear.
Set full_file=True for the whole file (can be very large).lean_references tool
Find all references to a symbol (including the declaration). Position cursor at the symbol.
lean_local_search tool
Fast local search to verify declarations exist. Use BEFORE trying a lemma name.
lean_leansearch tool
Search Mathlib via leansearch.net using natural language.
Examples: "sum of two even numbers is even", "Cauchy-Schwarz inequality",
"{f : A → B} (hf : Injective f) : ∃ g, LeftInverse g f"lean_loogle tool
Search Mathlib by type signature via loogle.lean-lang.org.
Examples: `Real.sin`, `"comm"`, `(?a → ?b) → List ?a → List ?b`,
`_ * (_ ^ _)`, `|- _ < _ → _ + 1 < _ + 1`lean_leanfinder tool
Semantic search by mathematical meaning via Lean Finder.
Examples: "commutativity of addition on natural numbers",
"I have h : n < m and need n + 1 < m + 1", proof state text.
The `version` argument selects which mathlib snapshot to query
(v4.19.0, v4.24.0, or v4.28.0). Default: v4.28.0.lean_hammer_premise tool
Get premise suggestions for automation tactics at a goal position.
Returns lemma names to try with `simp only [...]`, `aesop`, or as hints.lean_get_widgets tool
Get panel widgets at a position (proof visualizations, #html, custom widgets). Returns raw widget data - may be large.
lean_get_widget_source tool
Get JavaScript source of a widget by hash. Useful for understanding custom widget rendering logic. Returns full JS module - may be large.
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Requests any addressNo tool sends a request to an address the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processes16 of 23 capabilities start processes; 6 more call code the scanner could not follow, where it may happen
- Tools that touch files19 of 23 capabilities touch files; 3 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 23 capabilities; 22 more call code the scanner could not follow, where it may happen
Where the code is: 23 handlers in 8 files at commit 7932203d79db
src/lean_lsp_mcp/tool_registry.pyfunctionsrc/lean_lsp_mcp/tools/analysis.pylean_multi_attempt, lean_run_code, lean_verify, lean_minimal_hypotheses, lean_profile_proofsrc/lean_lsp_mcp/tools/build.pylean_buildsrc/lean_lsp_mcp/tools/diagnostics.pylean_file_outline, lean_diagnostic_messages, lean_code_actionssrc/lean_lsp_mcp/tools/goals.pylean_goal, lean_term_goalsrc/lean_lsp_mcp/tools/navigation.pylean_hover_info, lean_completions, lean_declaration_file, lean_referencessrc/lean_lsp_mcp/tools/search.pylean_local_search, lean_leansearch, lean_loogle, lean_leanfinder, lean_hammer_premisesrc/lean_lsp_mcp/tools/widgets.pylean_get_widgets, lean_get_widget_source
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests1 manifest: pyproject.toml
- Lockfiles checked against OSV1 file resolved and checked against the OSV database; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
- Known vulnerabilities in production dependencies MEDIUM1 production package with known advisories
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK versionNo MCP SDK declared in a manifest
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentialsNot seen in the traced code of 23 capabilities; 22 more call code the scanner could not follow, where it may happen
- Environment variables19 capabilities read environment variables (often API keys)
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (1 in production)
Dependency ranges were not resolved against a lockfile, so the score is capped at 7.
opentelemetry-apiPyPI 1.45.1 MEDIUM 1 advisory 1.45.2
- MEDIUMGHSA-mf5v-w3w3-f6cg CVE-2026-126360OpenTelemetry Python API: Denial of service through quadratic-time traceparent parsing
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | not stated in the code the scanner read; most local servers talk over stdio |
| Sign-in | not checked needs the live server |
The project's own security
| Security policy | none no SECURITY.md in the repository: report issues privately through GitHub if it is enabled |
|---|---|
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-11-03 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 5 catalogs (awesome_tensorblock, github_search, glama, mcp_toplist, mcpservers_org) |
|---|---|
| License | MIT |
| Created | 2025-03-29 |
| Topics | lean4 lsp mcp |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.