MCP server for Leeroopedia ML/AI knowledge search
Project description
Leeroopedia MCP Server
Give your AI coding agent access to curated ML/AI knowledge.
What is Leeroopedia?
Your ML & Data Knowledge Wiki. Learnt by AI, built by AI, for AI. A centralized playbook of best practices and expert-level knowledge for Machine Learning and Data domains.
Browse the full knowledge base at leeroopedia.com. Apply for early beta access.
This MCP server lets AI coding agents (Claude Code, Cursor) search that knowledge base directly while they work — no copy-pasting needed.
Quick Start
1. Install
pip install leeroopedia-mcp
2. Get Your API Key
- Go to app.leeroopedia.com
- Create an account or log in
- Navigate to Dashboard > API Keys
- Copy your API key (format:
kpsk_...)
3. Configure Claude Code
Add to your ~/.claude.json or project .mcp.json:
{
"mcpServers": {
"leeroopedia": {
"command": "leeroopedia-mcp",
"env": {
"LEEROOPEDIA_API_KEY": "kpsk_your_key_here"
}
}
}
}
4. Configure Cursor
Add to your Cursor settings (.cursor/mcp.json):
{
"mcpServers": {
"leeroopedia": {
"command": "leeroopedia-mcp",
"env": {
"LEEROOPEDIA_API_KEY": "kpsk_your_key_here"
}
}
}
}
Available Tools
The MCP server provides 8 agentic tools. Each tool (except get_page) triggers an AI agent on the backend that searches the knowledge base from multiple angles, reads relevant pages, and synthesizes a structured response.
| Tool | What it does |
|---|---|
search_knowledge |
Search the KB for framework docs, APIs, and best practices |
build_plan |
Build a step-by-step ML execution plan |
review_plan |
Review a plan against KB best practices |
verify_code_math |
Verify code against authoritative math/ML descriptions |
diagnose_failure |
Diagnose training/deployment failures |
propose_hypothesis |
Propose ranked next-step hypotheses |
query_hyperparameter_priors |
Query hyperparameter values, ranges & heuristics |
get_page |
Retrieve a specific KB page by ID |
search_knowledge — Search the knowledge base
Search the knowledge base for framework documentation, API references, config formats, and best practices. An AI agent synthesizes a grounded answer with [PageID] citations.
| Parameter | Required | Description |
|---|---|---|
query |
Yes | What you want to find out |
context |
No | Optional context about what you're building |
build_plan — Build a step-by-step ML execution plan
Build a step-by-step ML execution plan grounded in knowledge base evidence. Returns an overview, key specs, numbered steps, and validation criteria.
| Parameter | Required | Description |
|---|---|---|
goal |
Yes | What you want to accomplish |
constraints |
No | Constraints or requirements (e.g., hardware limits, time budget) |
review_plan — Review a plan against best practices
Review a proposed ML plan against knowledge base best practices. Returns approvals, risks, and improvement suggestions.
| Parameter | Required | Description |
|---|---|---|
proposal |
Yes | The plan or proposal to review |
goal |
Yes | The intended goal of the plan |
verify_code_math — Verify code against ML/math concepts
Verify code correctness against authoritative ML/math concept descriptions. Returns a Pass/Fail verdict with analysis.
| Parameter | Required | Description |
|---|---|---|
code_snippet |
Yes | The code to verify |
concept_name |
Yes | The mathematical/ML concept being implemented |
diagnose_failure — Diagnose training/deployment failures
Diagnose ML training or deployment failures using knowledge base evidence. Returns diagnosis, fix steps, and prevention advice.
| Parameter | Required | Description |
|---|---|---|
symptoms |
Yes | Description of the failure symptoms |
logs |
Yes | Relevant log output or error messages |
propose_hypothesis — Propose ranked research hypotheses
Propose ranked research hypotheses grounded in knowledge base evidence. Returns ranked ideas with rationale and suggested experiments.
| Parameter | Required | Description |
|---|---|---|
current_status |
Yes | Where the project stands now |
recent_experiments |
No | Description of recent experiments and their outcomes |
query_hyperparameter_priors — Query hyperparameter heuristics
Query documented hyperparameter values, ranges, and tuning heuristics. Returns a suggestion table with KB-grounded justification.
| Parameter | Required | Description |
|---|---|---|
query |
Yes | Hyperparameter question (e.g., "learning rate for LoRA fine-tuning Llama-3 8B") |
get_page — Retrieve a KB page by ID
Retrieve the full content of a specific knowledge base page by its exact ID. A direct lookup — no AI agent needed.
| Parameter | Required | Description |
|---|---|---|
page_id |
Yes | Exact page ID (e.g., Workflow/QLoRA_Finetuning, Principle/LoRA_Rank_Selection) |
How It Works
The MCP server uses an async task-based API:
- Your agent calls a tool (e.g.,
search_knowledge) - The MCP client sends
POST /v1/searchwith the tool name and arguments - The backend queues the search task and returns a
task_idimmediately - The client polls
GET /v1/search/task/{task_id}with exponential backoff - When the task completes, results are returned to your agent
This architecture allows the backend AI agents to take the time they need for thorough research without blocking or timing out.
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
LEEROOPEDIA_API_KEY |
Yes | — | Your Leeroopedia API key |
LEEROOPEDIA_API_URL |
No | https://api.leeroopedia.com |
API endpoint |
LEEROOPEDIA_POLL_MAX_WAIT |
No | 300 |
Max seconds to wait for a search task |
LEEROOPEDIA_POLL_INTERVAL |
No | 0.5 |
Initial poll interval in seconds (grows via backoff) |
Troubleshooting
"LEEROOPEDIA_API_KEY is required"
Set your API key in the MCP config:
{
"mcpServers": {
"leeroopedia": {
"command": "leeroopedia-mcp",
"env": {
"LEEROOPEDIA_API_KEY": "kpsk_..."
}
}
}
}
"Invalid or revoked API key" (401)
Double-check your API key at app.leeroopedia.com. Re-copy if needed.
"Insufficient credits" (402)
Purchase more credits at app.leeroopedia.com.
"Rate limit exceeded" (429)
Wait for the retry period before making more requests.
"Search timed out" (504)
The search task didn't complete within the poll window. Try a more specific query, or increase LEEROOPEDIA_POLL_MAX_WAIT.
Contributing
We welcome contributions! Please see our Contributing Guide for details on how to get started.
This project follows our Code of Conduct.
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leeroopedia_mcp-0.1.3.tar.gz.
File metadata
- Download URL: leeroopedia_mcp-0.1.3.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9b62883ab5bc894d7480e215a704bbf293540d8548bcf3f4f79e93271bea09a
|
|
| MD5 |
17e4e43fb12b1db5cc9e23b477a91b75
|
|
| BLAKE2b-256 |
bb6708b1f4e43c2e496e3ed362bba08387920b9662a55eb1681fdd52d6e2985a
|
File details
Details for the file leeroopedia_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: leeroopedia_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
308410d263d301deecb55e590b5b05eaf9a5f936769a04e7ed7a73a406d79941
|
|
| MD5 |
8f83717d1d9ac057b701c2058e4a5eba
|
|
| BLAKE2b-256 |
2ed5d979264c58358e9fa9799f5186093724535eb87fc0b375faaa5bcee9758c
|