learn-mcp
An MCP server for agent-guided DSA practice that generates LeetCode-style problems and provides tutoring with escalating hints, concept explanations, and progress tracking.
README
learn-mcp
An MCP server for agent-guided DSA practice. Connect it to an IDE agent (Claude Code, Cursor, etc.) and instead of static LeetCode problems, the agent generates immersive, LeetCode-style problems on demand and tutors you through them — escalating hints, concept explanations, and multi-step think-throughs.
The server provides structure and memory (problems, sessions, hint escalation, progress); the connected agent provides the creativity and teaching. No LLM runs inside the server.
Install
Install once from GitHub — it ships prebuilt (no build step on install) and exposes a learn-mcp command:
npm install -g https://github.com/abp2204/learn-mcp/tarball/main
Install from the tarball URL above, not the
github:abp2204/learn-mcpshorthand. On recent npm versions a global git-dependency install links the package from npm's cache git-clone temp dir and then garbage-collects it, leaving a dangling symlink — solearn-mcpends up "command not found". The tarball URL extracts a real package directory and avoids this. See Troubleshooting if a previous attempt left things broken.
Then register it with any MCP-capable agent. The command is global, but learn-mcp works inside one dedicated folder that becomes your personal practice environment (see Set up your practice folder below).
Claude Code:
claude mcp add learn-mcp -- learn-mcp
Cursor / Claude Desktop / any client (mcpServers config):
{
"mcpServers": {
"learn-mcp": { "command": "learn-mcp" }
}
}
Prefer not to install globally? Use npx instead — same effect, nothing installed:
{
"mcpServers": {
"learn-mcp": { "command": "npx", "args": ["-y", "https://github.com/abp2204/learn-mcp/tarball/main"] }
}
}
Set up your practice folder
learn-mcp turns one folder into your DSA practice repo. Make a clean folder, open it in your agent, and say "set up my practice workspace" (or have it call setup_workspace). That scaffolds:
active/ # problems you're solving now — one folder each (PROBLEM.md, solution.<ext>, notes.md)
completed/ # solved problems (moved here automatically on a pass)
paused/ # unsolved problems you've set aside (moved here via pause_problem)
STATS.md # your progress over time
AGENTS.md # the rules your agent follows in this folder
.learn-mcp/ # the workspace SQLite store + config
.claudeignore / .cursorignore / .gitignore
From then on, just talk to your agent: "generate me a medium graph problem in python". You can have several problems going at once in active/; the agent works there and never wanders into completed/ or paused/ — to look back it uses list_problems / revisit_problem. Every other tool requires this setup and will tell you to run setup_workspace first if you're in a plain folder.
From source (development)
git clone https://github.com/abp2204/learn-mcp && cd learn-mcp
npm install # install deps
npm run build # compile src/ -> dist/ (dist/ is committed; rebuild after src changes)
npm run dev # run from TS source (stdio)
npm run inspect # explore the tools in the MCP Inspector
How a session goes
- One-time:
setup_workspacein a clean folder (see above). - You ask the agent for, say, a medium graph problem with a story.
- Agent authors it and calls
generate_problem→ it's stored with a stable id. start_sessiondrops you into the problem (answers hidden).- Stuck?
get_hintescalates 1 → 4 (nudge → near-solution); the server tracks the level so hints don't over-reveal.explain_conceptteaches an underlying idea.next_stepadvances multi-step problems. submit_solutionrecords your attempt; apassmarks it solved and moves it tocompleted/.- Stopping work on an unsolved one?
pause_problemsets it aside inpaused/. progressshows what you've solved and which topics are weak.
Tools
| Tool | Purpose |
|---|---|
setup_workspace |
Scaffold the current folder into a practice environment (run once) |
generate_problem |
Store an agent-authored problem (with a language); write it into active/<seq>-<slug>/ |
start_session |
Begin a session; returns the solver-facing problem + sessionId |
get_hint |
Advance the escalating hint level (server-tracked) |
explain_concept |
Record/echo a taught concept |
submit_solution |
Record an attempt; pass solves it, moves it to completed/, refreshes STATS.md |
pause_problem |
Set aside an unsolved problem → paused/ (excluded from stats; solved problems can't be paused) |
next_step |
Advance a multi-step problem |
progress |
Single-user stats, solved-by-difficulty, weak topics |
list_problems |
List problems (titles + state) without dumping their content into context |
revisit_problem |
Re-open a past problem by slug/id (solver view) |
Plus an author_problem MCP prompt: a rubric the agent can pull in to write well-calibrated, immersive problems.
Storage
Everything lives in your workspace folder: a SQLite store at <folder>/.learn-mcp/store.sqlite (the source of truth) plus a human-browsable file mirror (active/, completed/, paused/, STATS.md). Uses Node's built-in node:sqlite, so there's no native build step. The workspace root is found by walking up from the launch directory to the .learn-mcp/workspace.json marker (override with LEARN_MCP_WORKSPACE); the server prints the detected workspace to stderr on startup. Finished/paused problems (completed/, paused/) and the internal store are kept out of the agent's context via .claudeignore/.cursorignore.
Troubleshooting
npm error ENOTDIR ... rename '.../node_modules/learn-mcp' (install aborts instantly). A previous npm install -g . or npm link left a leftover symlink at <npm-prefix>/lib/node_modules/learn-mcp that npm can't move out of the way. Remove it and reinstall:
rm -f "$(npm prefix -g)/lib/node_modules/learn-mcp" "$(npm prefix -g)/bin/learn-mcp"
npm install -g https://github.com/abp2204/learn-mcp/tarball/main
Install succeeds but learn-mcp is "command not found". You likely installed via the github:abp2204/learn-mcp shorthand, which leaves a dangling symlink (see the note under Install). Clean up as above and reinstall from the tarball URL. Confirm it took with ls -ld "$(npm prefix -g)/lib/node_modules/learn-mcp" — it should be a real directory, not a -> symlink.
Status
v1. Solutions are agent-judged (the agent evaluates your code and reports pass/fail). A sandboxed code executor with generated test cases is the planned next step. Domain is DSA; DSP is a parked future idea.
Development
See CLAUDE.md for architecture and conventions. Run the end-to-end test with:
node scripts/smoke.mjs
Requires Node 22.5+ (uses built-in node:sqlite).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。