我的LeetCode出题MCP
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"leetcode": {
"args": [
"-y",
"@jinzcdev/leetcode-mcp-server",
"--site",
"cn"
],
"command": "npx",
"env": {
"LEETCODE_SESSION": "${LEETCODE_SESSION}"
}
}
}
}
该服务需要配置环境变量:LEETCODE_SESSION
可用工具 (18 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
get_daily_challenge
Retrieves today's LeetCode Daily Challenge problem with complete details, including problem description, constraints, and examples
该工具无需必填参数,直接调用即可
get_problem 1 个参数 需填 1 项
Retrieves details about a specific LeetCode problem, including its description, examples, constraints, and related information
必填参数:titleSlug
search_problems 6 个参数
Searches for LeetCode problems based on multiple filter criteria including categories, tags, difficulty levels, and keywords, with pagination support
该工具无需必填参数,直接调用即可
get_user_profile 1 个参数 需填 1 项
Retrieves profile information about a LeetCode user, including user stats, solved problems, and profile details
必填参数:username
get_recent_ac_submissions 2 个参数 需填 1 项
Retrieves a user's recent accepted (AC) submissions on LeetCode China, with details about each successfully solved problem
必填参数:username
get_user_status
Retrieves the current user's status on LeetCode, including login status, premium membership details, and user information (requires authentication)
该工具无需必填参数,直接调用即可
get_problem_submission_report 1 个参数 需填 1 项
Retrieves detailed information about a specific LeetCode submission by its ID, including source code, runtime stats, and test results (requires authentication)
必填参数:id
get_problem_progress 4 个参数
Retrieves the current user's problem-solving status with filtering options, including detailed solution history for attempted or solved questions (requires authentication)
该工具无需必填参数,直接调用即可
get_all_submissions 6 个参数
Retrieves a list of the current user's submissions on LeetCode China with extensive filtering options, including pagination support via lastKey parameter (requires authentication)
该工具无需必填参数,直接调用即可
get_user_contest_ranking 2 个参数 需填 1 项
Retrieves a user's contest ranking information on LeetCode, including overall ranking, participation history, and performance metrics across contests
必填参数:username
list_problem_solutions 6 个参数 需填 1 项
Retrieves a list of community solutions for a specific LeetCode problem, including only metadata like article slug. To view the full content of a solution, use the 'get_problem_solution' tool with the slug returned by this tool.
必填参数:questionSlug
get_problem_solution 1 个参数 需填 1 项
Retrieves the complete content and metadata of a specific solution, including the full article text, author information, and related navigation links
必填参数:slug
search_notes 4 个参数
Searches for user notes on LeetCode with filtering options, returning note content and associated problem information (requires authentication)
该工具无需必填参数,直接调用即可
get_note 3 个参数 需填 1 项
Retrieves user notes for a specific LeetCode problem by its question ID, returning the complete note content and metadata (requires authentication)
必填参数:questionId
create_note 3 个参数 需填 2 项
Creates a new note for a specific LeetCode problem, allowing users to save personal comments and observations for future reference (requires authentication, CN only)
必填参数:questionId、content
update_note 3 个参数 需填 1 项
Updates an existing note with new content or title, allowing users to refine their saved observations (requires authentication, CN only)
必填参数:noteId
run_code 6 个参数 需填 3 项
Runs code for a LeetCode problem (requires authentication). Starts an interpret request then polls the /check/ endpoint until finished, returning both the start response and final check JSON.
必填参数:titleSlug、lang、typedCode
submit_solution 5 个参数 需填 3 项
Submits code for a LeetCode problem (requires authentication). Starts a submission then polls the /check/ endpoint until finished, returning both the start response and final check JSON.
必填参数:titleSlug、lang、typedCode
服务介绍
这是一个基于 @jinzcdev/leetcode-mcp-server 的 LeetCode.cn MCP 服务,用于查询 LeetCode 题目、标签和题解信息,辅助 Python 程序设计课程出题。