
ooo0ooo/lean-lsp-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
リーン定理証明MCP
概要
Language Server Protocolを通じてlean proverとLeanクライアントを用いてエージェント的にやり取りできるMCPサーバーです。このサーバーは、LLMエージェントがリーンプロジェクトを理解し、分析し、やり取りするためのさまざまなツールを提供します。 * : 診断、目標状態、用語情報、ホバードキュメントなどにアクセスできます。* : LeanSearch、Loogle、Lean Finder、Lean Hammer、Lean State Searchを使って関連する定理や定義を見つけられます。* : VSCode、カーソル、Claudeコードなど、さまざまなクライアント向けのシンプルな設定が可能です。 1. Pythonパッケージマネージャーのuvをインストールする。2. Lakeビルドを手動で実行して、Leanプロジェクトを迅速にビルドする。3. IDE/セットアップの設定を行う 4.(任意で強く推奨)ripgrep(rg)をインストールしてローカル検索とソーススキャンを行ってください(警告lean_verify)。 システム用にuvをインストールしてください。Linux/MacOSでは:curl -lssf https://astral.sh/uv/install.
概要(AI 翻訳)
リーン-LSP-MCP
リーン定理証明MCP
Language Server Protocolを通じてlean proverとLeanクライアントを用いてエージェント的にやり取りできるMCPサーバーです。このサーバーは、LLMエージェントがリーンプロジェクトを理解し、分析し、やり取りするためのさまざまなツールを提供します。
主な特徴
- リッチリーンインタラクション:診断、目標状態、用語情報、ホバードキュメントなどにアクセスできます。
- 外部検索ツール:関連する定理や定義を見つけるには、
LeanSearch、Loogle、Lean Finder、Lean Hammerを使用してください。 - 簡単なセットアップ:VSCode、カーソル、Claudeコードなど様々なクライアント向けの簡単な設定。
セットアップ
概要
- uvというPythonパッケージマネージャーをインストールする。
- リーンプロジェクトを手動で実行して迅速に構築するようにしましょう。
- IDE/セットアップの設定をする
- (任意で強く推奨される)ripgrep(
rg)をインストールしてローカル検索とソーススキャン(lean_verify警告)を行ってください。
1.UVをインストールしてください
システム用にUVをインストールしてください。Linux/MacOSでは:curl -LsSf https://astral.sh/uv/install.sh | sh
1b. 代替案:Nixでインストール
Nixを使う場合は、GitHubから直接パッケージをインストールできます:
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
lean-lsp-mcp
Lean Theorem Prover MCP
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.
Key Features
- Rich Lean Interaction: Access diagnostics, goal states, term information, hover documentation and more.
- External Search Tools: Use
LeanSearch,Loogle,Lean FinderandLean Hammerto find relevant theorems and definitions. - Easy Setup: Simple configuration for various clients, including VSCode, Cursor and Claude Code.
Setup
Overview
- Install uv, a Python package manager.
- Make sure your Lean project builds quickly by running
lake buildmanually. - Configure your IDE/Setup
- (Optional, highly recommended) Install ripgrep (
rg) for local search and source scanning (lean_verifywarnings).
1. Install uv
Install uv for your system. On Linux/MacOS: curl -LsSf https://astral.sh/uv/install.sh | sh
1b. Alternative: Install with Nix
If you use Nix, you can install the package directly from GitHub:
nix profile install github:oOo0oOo/lean-lsp-mcp
Or run it without installing: nix run github:oOo0oOo/lean-lsp-mcp.
This provides the MCP server only. You still need a Lean toolchain (elan/lake) for your project, same as the uv setup below.
2. Run lake build
lean-lsp-mcp will run lake serve in the project root to use the language server (for most tools). Some clients (e.g. Cursor) might timeout during this process. Therefore, it is recommended to run lake build manually before starting the MCP. This ensures a faster build time and avoids timeouts.
3. Configure your IDE/Setup
One-click config setup:
インストール
uvx lean-lsp-mcp設定
{
"mcpServers": {
"lean-lsp": {
"command": "uvx",
"args": ["lean-lsp-mcp"]
}
}
}