LeetCode CN MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEETCODE_COOKIE | No | Complete cookie string containing csrftoken and LEETCODE_SESSION, used as a fallback when no system keychain is available. | |
| LEETCODE_SESSION | No | LeetCode session token, alternative to LEETCODE_COOKIE. | |
| LEETCODE_CSRFTOKEN | No | CSRF token, alternative to LEETCODE_COOKIE. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| auth_statusA | 检查 LeetCode 中国站登录状态,不返回或显示任何 Cookie。 |
| loginB | 通过本机安全页面登录 LeetCode 中国站并将 Cookie 保存到系统钥匙串。Cookie 不作为工具参数,也不会进入模型上下文。 |
| logoutA | 删除系统钥匙串中保存的 LeetCode 中国站凭证。 |
| get_problemA | 根据中国站题号、中文/英文标题、titleSlug 或题目 URL 获取题目信息。题目查询不需要登录。language 可指定 python3、cpp、java、typescript 等代码模板。 |
| get_submissions_by_dateA | 获取当前登录用户某个自然日的全部 LeetCode 中国站提交。date 默认为 Asia/Shanghai 时区的今天,格式 YYYY-MM-DD;包含 AC 和失败提交。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool has a clear, non-overlapping responsibility: authentication lifecycle (login, logout, auth_status), problem lookup (get_problem), and submission history retrieval (get_submissions_by_date). There is no realistic ambiguity between tool purposes.
Most tools follow a readable snake_case pattern with clear verbs and nouns, such as get_problem and get_submissions_by_date. login/logout and auth_status are minor deviations but remain conventional and predictable.
Five tools is well-scoped for a focused LeetCode CN server handling authentication, problem data, and submission history. Each tool earns its place with no redundancy or bloat.
Authentication status/login/logout form a complete lifecycle, and problem fetching plus daily submission retrieval cover the core read-only workflows. Minor gaps such as broader problem search or submission detail endpoints are workable but not critical.