leetcode-mcp-server
by jinzcdev·★ 113·综合分 47
MCP服务器提供对LeetCode题目、解答和用户数据的自动访问,支持可选认证功能。
概述
LeetCode MCP服务器是一个综合性工具,将AI助手与LeetCode庞大的编程问题数据库连接起来。它既允许对公共问题数据的只读访问,也支持对用户特定功能(如提交记录和个人笔记)的认证访问。该服务器同时支持LeetCode全球版(leetcode.com)和中国版(leetcode.cn),使其对国际用户都很实用。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
如果你是准备编码面试或练习算法的开发者,需要自动化访问 LeetCode 的题目数据库和解答分析,请选择这个 server。
什么时候不要选它
如果你需要访问 LeetCode 的高级内容或其 API 未暴露的功能,或者担心分享你的 LeetCode 凭据,请不要选择它。
此 server 暴露的工具
从 README 抽取出 12 个工具get_daily_challengeRetrieves today's LeetCode Daily Challenge problem
get_problemRetrieves details for a specific LeetCode problem
search_problemsSearches for LeetCode problems with multiple filter criteria
get_user_profileRetrieves profile information for a LeetCode user
get_recent_ac_submissionsRetrieves a user's recent accepted submissions
run_codeRuns code for a problem and waits until finished
submit_solutionSubmits code for a problem and waits until finished
list_problem_solutionsRetrieves a list of community solutions for a specific problem
get_noteRetrieves notes for a specific LeetCode problem
create_noteCreates a new note for a specific LeetCode problem
get_problem_submission_reportProvides detailed submission analysis for a specific problem
get_problem_progressRetrieves current user's problem-solving progress
可对比工具
安装
安装
通过Smithery安装(推荐用于Claude Desktop)
npx -y @smithery/cli install @jinzcdev/leetcode-mcp-server --client claude手动安装
npm install @jinzcdev/leetcode-mcp-server -gClaude Desktop配置
添加到您的settings.json文件:
{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "<您的LEETCODE_SESSION_COOKIE>"
}
}
}
}
}FAQ
- 使用此服务器需要LeetCode账户吗?
- 不需要,无需认证即可访问基本题目数据。但是,提交记录、个人笔记和运行代码等功能需要使用LeetCode会话cookie进行身份验证。
- 我可以在leetcode.com和leetcode.cn上使用此服务器吗?
- 可以,该服务器支持LeetCode全球版(leetcode.com)和中国版(leetcode.cn)。您可以使用--site参数或LEETCODE_SITE环境变量指定站点。
- 源代码是否可用?
- 是的,这是一个开源项目。您可以克隆仓库并在使用npm install && npm run build构建项目后本地运行。
leetcode-mcp-server 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。