Skip to main content
Glama
RishiSarraff

PersonalLeetcodeMCP

by RishiSarraff

LeetCode MCP 连接器 for Claude.ai

一个远程 MCP 服务器,让 Claude 访问您的 LeetCode 提交历史记录和薄弱环节分析。

提供的工具

工具

描述

get_submission_history

最近的提交记录,包含状态、语言和多尝试检测

analyze_weak_areas

按主题逐项分析最强与最薄弱环节,并提供建议

get_user_stats

总体通过/提交次数、连续天数及排名百分位

get_daily_challenge

今日的每日挑战题目

Related MCP server: LeetCode MCP Server

设置

1. 安装并在本地运行

npm install
npm start
# → Listening on http://localhost:3000

2. 部署(Claude.ai 需要)

Claude.ai 需要一个可公开访问的 HTTPS URL。请选择一种方式:

选项 A — Railway(最简单,有免费套餐)

  1. 将此文件夹推送到 GitHub 仓库

  2. 访问 railway.app → 新建项目 → 从 GitHub 部署

  3. Railway 会自动检测 Node.js 并为您提供一个公共 URL,例如 https://leetcode-mcp-xxx.railway.app

选项 B — Render

  1. 推送到 GitHub

  2. render.com → 新建 Web 服务 → 连接仓库

  3. 构建命令:npm install,启动命令:node server.js

  4. 获得一个 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

部署完成后:

  1. 前往 Claude.ai → 设置 → 连接器

  2. 点击 “添加自定义连接器”

  3. 输入您的服务器 URL:https://your-deployment-url.com/mcp

  4. 点击 添加

就是这样 — Claude 现在即可访问 LeetCode 工具。

示例提示

连接后,尝试向 Claude 提问:

  • “分析我在 LeetCode 上的薄弱环节 — 我的用户名是 @john_doe”

  • “显示我最近 20 次提交,并告诉我哪些题目我 struggled 了”

  • “我的 LeetCode 统计信息是什么?接下来应该重点关注什么?”

  • “今日的每日挑战是什么?”

关于 LeetCode 的 API 的注意事项

  • 公开数据get_submission_historyget_user_statsanalyze_weak_areasget_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

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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