Skip to main content

MCP server for Leeroopedia ML/AI knowledge search

Project description

Leeroopedia MCP Server

Give your AI coding agent access to curated ML/AI knowledge.

PyPI Discord GitHub commit activity Y Combinator X25


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

  1. Go to app.leeroopedia.com
  2. Create an account or log in
  3. Navigate to Dashboard > API Keys
  4. 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
consult_literature Research a topic with synthesized, cited answers
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
consult_literature — Research a topic like a librarian

Search the knowledge base like a research librarian. An AI agent synthesizes a consensus answer grounded in evidence, with [PageID] citations.

Parameter Required Description
query Yes Research question or topic to investigate
context No Additional context to guide the search
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:

  1. Your agent calls a tool (e.g., consult_literature)
  2. The MCP client sends POST /v1/search with the tool name and arguments
  3. The backend queues the search task and returns a task_id immediately
  4. The client polls GET /v1/search/task/{task_id} with exponential backoff
  5. 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

leeroopedia_mcp-0.1.2.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leeroopedia_mcp-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file leeroopedia_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: leeroopedia_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for leeroopedia_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 194545f79d580e8456ddd565c0df68dde7f47ece884c4feeed7991dbf46940f4
MD5 454590906d8144186a410741748e65a5
BLAKE2b-256 0aeb6de3bf6843db14274f8a14e432b6a795ea10ece6d81d98943d15a57618a9

See more details on using hashes here.

File details

Details for the file leeroopedia_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for leeroopedia_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 91a1c89c00d93b528d9010ea59007128e0eed79bad04ab3f7eed4af6f6e0e842
MD5 6784e82c2a2cb278416293762ef35d1c
BLAKE2b-256 4059ee8b8ce3c64c7e99900dc61dba02bbcd46e401f8d99d1f4851fe06bf80e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page