PersonalLeetcodeMCP
LeetCode MCP 连接器 for Claude.ai
一个远程 MCP 服务器,让 Claude 访问您的 LeetCode 提交历史记录和薄弱环节分析。
提供的工具
工具 | 描述 |
| 最近的提交记录,包含状态、语言和多尝试检测 |
| 按主题逐项分析最强与最薄弱环节,并提供建议 |
| 总体通过/提交次数、连续天数及排名百分位 |
| 今日的每日挑战题目 |
Related MCP server: LeetCode MCP Server
设置
1. 安装并在本地运行
npm install
npm start
# → Listening on http://localhost:30002. 部署(Claude.ai 需要)
Claude.ai 需要一个可公开访问的 HTTPS URL。请选择一种方式:
选项 A — Railway(最简单,有免费套餐)
将此文件夹推送到 GitHub 仓库
访问 railway.app → 新建项目 → 从 GitHub 部署
Railway 会自动检测 Node.js 并为您提供一个公共 URL,例如
https://leetcode-mcp-xxx.railway.app
选项 B — Render
推送到 GitHub
render.com → 新建 Web 服务 → 连接仓库
构建命令:
npm install,启动命令:node server.js获得一个 URL,例如
https://leetcode-mcp.onrender.com
选项 C — Docker(任意 VPS/云)
docker build -t leetcode-mcp .
docker run -p 3000:3000 leetcode-mcp
# Then point a domain + SSL at port 3000选项 D — Cloudflare Workers(高级)
Cloudflare 内置了 MCP 支持。参见:https://developers.cloudflare.com/mcp/
3. 添加到 Claude.ai
部署完成后:
前往 Claude.ai → 设置 → 连接器
点击 “添加自定义连接器”
输入您的服务器 URL:
https://your-deployment-url.com/mcp点击 添加
就是这样 — Claude 现在即可访问 LeetCode 工具。
示例提示
连接后,尝试向 Claude 提问:
“分析我在 LeetCode 上的薄弱环节 — 我的用户名是 @john_doe”
“显示我最近 20 次提交,并告诉我哪些题目我 struggled 了”
“我的 LeetCode 统计信息是什么?接下来应该重点关注什么?”
“今日的每日挑战是什么?”
关于 LeetCode 的 API 的注意事项
公开数据:
get_submission_history、get_user_stats、analyze_weak_areas和get_daily_challenge均使用公开的个人资料数据 — 无需登录,只要目标资料是公开的即可。私有资料:如果用户设置了私有资料,LeetCode 将返回空数据。用户需要在 LeetCode 设置 → 隐私中将资料设为公开。
LeetCode 没有官方的公开 API。此服务器使用的是 LeetCode 自身前端所用的相同 GraphQL 端点。如果 LeetCode 更改其 API 结构,它可能会失效。
扩展此服务器
要添加更多工具,请遵循 server.js 中的模式:
server.tool("tool_name", "description", { param: z.string() }, async ({ param }) => {
// call lcQuery() and return results
return { content: [{ type: "text", text: "..." }] };
});可添加的有用查询:
按标签/难度搜索题目(使用
problemsetQuestionList查询)公司标签题目(需要 LeetCode Premium 会话 cookie)
竞赛历史(文件中已有查询作为
CONTEST_HISTORY_QUERY)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityFmaintenanceA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.71944MIT
- AlicenseAqualityAmaintenanceA Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.9220139MIT
- Flicense-qualityCmaintenanceLets Claude read your Trello boards, lists, and cards via a remote MCP server.
- Flicense-qualityCmaintenanceA tutorial and working MCP server that connects to your LeetCode profile, enabling AI assistants to check solved problems and recommend new ones by topic and difficulty.1
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RishiSarraff/PersonalLeetcodeMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server