This project provides a Minimal MCP (Model Context Protocol) Server for searching Lean Mathlib 4 documentation. It allows LLMs to query Lean Mathlib 4 declarations and retrieve relevant documentation links and details. The MCP server is only available for VSCode at the moment.
- Search Lean Mathlib 4 Documentation: Query the documentation for declarations, modules, and instances.
- MCP Server Integration: Implements the MCP protocol for seamless integration with tools.
- Local Data Handling: Downloads and processes Lean Mathlib 4 documentation data locally after the first run.
- Python 3.11 or higher
requestslibrarymcpMCP Server library
-
Clone the repository:
git clone https://github.com/CriticalLine/lean-mathlib-docs-mcp.git cd lean-mathlib-docs-mcp -
Install the required Python dependencies:
conda env create -f environment.yml conda activate lean-mathlib-docs-env
-
Ensure the
mcp.jsonfile is correctly configured in the.vscodefolder or the project root.
- VSCode will automatically start the MCP server when you launch it with the appropriate configuration.
- Query the server by explicitly using
#search_lean_doc <query>or tell the LLM to use the search function.
lean-mathlib-docs-mcp/
├── LICENSE
├── README.md
├── src/
│ ├── lean_docs_server.py
│ └── mcp.json
- test the mcp server
- add check the original code
This project is licensed under the GPLv3 License. See the LICENSE file for details.
Prohibits all commercial use.
- Lean Mathlib 4 for the documentation data.
- The MCP Server library for providing the protocol implementation.