You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LeetCode MCP Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that provides seamless integration with LeetCode APIs, enabling advanced automation and intelligent interaction with LeetCode's programming problems, contests, solutions, and user data.
7
8
@@ -22,29 +23,44 @@ The LeetCode MCP Server is a [Model Context Protocol (MCP)](https://modelcontext
22
23
23
24
```bash
24
25
# Install from npm
25
-
npm install @jinzcdev/mcp-server-leetcode -g
26
+
npm install @jinzcdev/leetcode-mcp-server -g
26
27
27
-
#Run with China site configuration
28
-
@jinzcdev/mcp-server-leetcode --site cn
28
+
#Or run with Global site configuration
29
+
npx -y @jinzcdev/leetcode-mcp-server --site global
29
30
30
31
# Run with authentication (for accessing private data)
31
-
@jinzcdev/mcp-server-leetcode --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
32
+
npx -y @jinzcdev/leetcode-mcp-server --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
33
+
```
34
+
35
+
Alternatively, you can clone the repository and run it locally:
npm run build && node build/index.js --site global
32
46
```
33
47
34
48
## Usage
35
49
36
50
### Visual Studio Code Integration
37
51
38
-
Add the following JSON configuration to your User Settings (JSON) file Code. Access this by pressing `Ctrl + Shift + P` and searching for `Preferences: Open User Settings (JSON)`.
52
+
Add the following JSON configuration to your User Settings (JSON) file Code. Access this by pressing `Ctrl/Cmd + Shift + P` and searching for `Preferences: Open User Settings (JSON)`.
39
53
40
54
```json
41
55
{
42
56
"mcp": {
43
57
"servers": {
44
58
"leetcode": {
45
59
"type": "stdio",
46
-
"command": "mcp-server-leetcode",
60
+
"command": "npx",
47
61
"args": [
62
+
"-y",
63
+
"@jinzcdev/leetcode-mcp-server",
48
64
"--site",
49
65
"global",
50
66
"--session",
@@ -68,7 +84,7 @@ The server supports the following environment variables:
68
84
**Priority Note**:
69
85
Command-line arguments take precedence over environment variables when both are specified. For example:
70
86
71
-
- If `LEETCODE_SITE=cn` is set but you run `mcp-server-leetcode --site global`, the server will use `global`.
87
+
- If `LEETCODE_SITE=cn` is set but you run `leetcode-mcp-server --site global`, the server will use `global`.
72
88
- If `LEETCODE_SESSION` exists but you provide `--session "new_cookie"`, the command-line session value will be used.
0 commit comments