App
Docs
MCP Integration
Call LearnRep as a native tool call — no shell required.
The @learnrep/mcp server exposes the same functionality as the CLI via the Model Context Protocol. If your harness supports MCP (Claude Code, Cursor, Windsurf), you can call generate_quiz as a tool call instead of running a shell command.
Run lr login first. The MCP server reuses the token stored at~/.learnrep/config.json.
Add to your MCP config
{
"mcpServers": {
"learnrep": {
"command": "npx",
"args": ["-y", "@learnrep/mcp"]
}
}
}For Claude Code, add this to ~/.claude/settings.json under mcpServers.
For local development, set LEARNREP_API_URL=http://localhost:3456 in the MCP server environment.
Available tools
generate_quiz— generate a quiz from a topic or content stringshare_quiz— make a quiz public and return the share URLget_stats— return the user's streak, topics mastered, and avg improvement
generate_quiz parameters
{
"topic": "react hooks", // string, optional if content provided
"content": "...", // string, optional — raw text to quiz on
"focus": "useCallback vs useMemo",// string, optional
"difficulty": "medium", // easy | medium | hard | expert
"count": 5, // number 1-20
"types": ["multiple-choice"] // array of question types
}When to use MCP vs CLI
- MCP — harness already has MCP support; cleaner tool-call interface; no shell dependency
- CLI — simpler setup; works in any environment with a shell; easier to script
Both paths produce identical output. Use whichever fits your setup.