npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-lean-mcp

v1.0.0

Published

Bridges the Lean 4 language server into DeepSeek Harness so agents can inspect proof goals, run Lean code, build projects, and search Mathlib.

Readme

dsh-lean-mcp

Connect Lean 4 to DeepSeek Harness: proof goals, compiler errors, tactic trials, project builds, axiom checks, and Mathlib search — all as tools the agent can call.

Under the hood this bundle mounts @deepseek-ai/dsh-mcp-client against lean-lsp-mcp over stdio. No wrapper code, no fork: the tools the agent sees are lean-lsp-mcp's own tools, namespaced as mcp__lean4__*.

Not affiliated with the Lean FRO, leanprover, or OpenAI. "Lean" refers to the Lean 4 theorem prover.

What you get

| Tool | What it does | |---|---| | lean_goal | Proof state at a line (before/after), the single most useful tool | | lean_diagnostic_messages | Compiler errors and warnings, categorised | | lean_multi_attempt | Try several tactics at one position without editing the file | | lean_run_code | Run a standalone snippet | | lean_verify | Axiom check — catches sorry and non-standard axioms | | lean_build | lake build + restart the language server | | lean_local_search / lean_leansearch / lean_loogle / lean_leanfinder / lean_hammer_premise | Find the lemma instead of guessing | | lean_hover_info, lean_completions, lean_file_outline, lean_references, lean_declaration_file, lean_code_actions, lean_term_goal, lean_minimal_hypotheses, lean_profile_proof | The rest of the IDE surface |

Requirements

  • DSH ≥ 0.2.2-rc.2
  • uv — the bundle runs uvx --from lean-lsp-mcp==0.33.0 lean-lsp-mcp
  • Lean 4 via elan — elan on PATH, plus a project that builds (lake build)
  • ripgrep — required by lean_local_search; brew install ripgrep, apt install ripgrep, or a release binary
  • macOS or Linux. Windows is not supported by the bundled PATH composition yet.

Lean itself is not installed by this plugin. Install it first:

curl -sSf https://elan.lean-lang.org/elan-init.sh | sh
elan default leanprover/lean4:stable

Install

From a local checkout:

git clone <this repo> dsh-lean-mcp

then Plugins → Add plugin and pick the directory, or:

plugin_manager install_bundle { "target": "/absolute/path/to/dsh-lean-mcp" }

From npm (once published):

plugin_manager install_bundle { "target": "[email protected]" }

After installation, 20+ mcp__lean4__* tools appear in the session. Startup downloads the pinned lean-lsp-mcp through uvx on first run; later starts are instant.

Pointing it at a project

The server infers the Lean project from the file paths you pass. Give the agent an absolute path inside a project:

Prove demo_add_zero in ~/work/lean-demo/LeanDemo/Basic.lean; use lean_goal before each step.

Tools that take no path (lean_run_code, lean_local_search) fall back to the project the server learned last. Call any path-based tool first after a restart.

Projects with Mathlib work the same way; build once (lake build, or lake exe cache get && lake build) before the agent starts, otherwise the first language-server start can take minutes.

Configuration

This is a configuration-only bundle, so the settings live in cordis.patch.yml and are not editable from the settings UI. Pin a different lean-lsp-mcp version or raise the timeouts by editing that file in your plugin directory:

        args:
          - --from
          - lean-lsp-mcp==0.33.0      # pin changes here
          - lean-lsp-mcp
        toolCallTimeoutMs: 900000     # 15 min per tool call

failOnStartupError: true means a missing uvx or an unreachable PyPI fails the plugin row instead of silently yielding no tools — check Plugins for the error.

Limitations

  • No cross-platform PATH magic. macOS and Linux only, and it expects ~/.elan/bin and ~/.local/bin.
  • Mathlib is not bundled. Small proofs work on core Lean; norm_num, ring, linarith need a Mathlib project.
  • First call after a restart is slow — the language server has to elaborate the file.
  • lake build is expensive. lean_build is for new imports, not for iterating; prefer lean_goal + lean_multi_attempt.
  • The server caches detection at startup. A tool installed later (for example rg) needs a plugin reload or a DSH restart before it is noticed.

Security

lean_run_code executes Lean code, and lean_build runs the project's own build definitions. Pointing this plugin at an untrusted repository therefore means letting that repository's build run on your machine. Use a container or a dedicated user when working with code you do not trust. No credentials are read or sent by this bundle.

Troubleshooting

| Symptom | Cause | |---|---| | No mcp__lean4__* tools | uvx missing or PyPI unreachable; check Plugins for the row error | | No valid Lean project path found | No path-based tool call yet, or the file is outside a Lake project | | unknown tactic for norm_num/ring | Project has no Mathlib | | ripgrep (rg) was not found | Install rg, then reload the plugin | | Everything times out on the first request | Mathlib project cold start; build it once first |

License

MIT. See LICENSE.