A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data. - ๐ Fast access to LeetCode API - ๐ Search problems, retrieve daily challenges, and check user profiles - ๐ Query contest data and rankings - ๐งฉ Full support for MCP tools and resources - ๐ฆ Provides both CLI and programmable API To install mcp-server-le
Add this skill
npx mdskills install doggybee/mcp-server-leetcodeComprehensive MCP server with well-documented LeetCode API tools covering problems, users, and contests
1# MCP Server LeetCode23[](https://www.npmjs.com/package/@mcpfun/mcp-server-leetcode)4[](https://github.com/doggybee/mcp-server-leetcode/blob/main/LICENSE)5[](https://github.com/doggybee/mcp-server-leetcode/releases)6[](https://smithery.ai/server/@doggybee/mcp-server-leetcode)78A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.910## Features1112- ๐ Fast access to LeetCode API13- ๐ Search problems, retrieve daily challenges, and check user profiles14- ๐ Query contest data and rankings15- ๐งฉ Full support for MCP tools and resources16- ๐ฆ Provides both CLI and programmable API1718## Installation1920### Installing via Smithery2122To install mcp-server-leetcode for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@doggybee/mcp-server-leetcode):2324```bash25npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude26```2728### Global Installation2930```bash31npm install -g @mcpfun/mcp-server-leetcode32```3334Once installed, you can run it directly from the command line:3536```bash37mcp-server-leetcode38```3940### Local Installation4142```bash43npm install @mcpfun/mcp-server-leetcode44```4546## Usage4748### Integration with Claude for Desktop4950Add the following to your Claude for Desktop `claude_desktop_config.json` file:5152```json53{54 "mcpServers": {55 "leetcode": {56 "command": "mcp-server-leetcode"57 }58 }59}60```6162For local development:6364```json65{66 "mcpServers": {67 "leetcode": {68 "command": "node",69 "args": ["/path/to/dist/index.js"]70 }71 }72}73```7475### Use as a Library7677```javascript78import { LeetCodeService } from '@mcpfun/mcp-server-leetcode';7980// Initialize the service81const leetcodeService = new LeetCodeService();8283// Get daily challenge84const dailyChallenge = await leetcodeService.getDailyChallenge();8586// Search problems87const problems = await leetcodeService.searchProblems({88 difficulty: 'MEDIUM',89 tags: 'array+dynamic-programming'90});91```9293## Available Tools9495### Problem-related Tools9697| Tool Name | Description | Parameters |98|--------|------|------|99| `get-daily-challenge` | Get the daily challenge | None |100| `get-problem` | Get details for a specific problem | `titleSlug` (string) |101| `search-problems` | Search for problems based on criteria | `tags` (optional), `difficulty` (optional), `limit` (default 20), `skip` (default 0) |102103### User-related Tools104105| Tool Name | Description | Parameters |106|--------|------|------|107| `get-user-profile` | Get user information | `username` (string) |108| `get-user-submissions` | Get user submission history | `username` (string), `limit` (optional, default 20) |109| `get-user-contest-ranking` | Get user contest rankings | `username` (string) |110111### Contest-related Tools112113| Tool Name | Description | Parameters |114|--------|------|------|115| `get-contest-details` | Get contest details | `contestSlug` (string) |116117## Available Resources118119### Problem Resources120121- `leetcode://daily-challenge`: Daily challenge122- `leetcode://problem/{titleSlug}`: Problem details123- `leetcode://problems{?tags,difficulty,limit,skip}`: Problem list124125### User Resources126127- `leetcode://user/{username}/profile`: User profile128- `leetcode://user/{username}/submissions{?limit}`: User submissions129- `leetcode://user/{username}/contest-ranking`: User contest ranking130131## Local Development132133Clone the repository and install dependencies:134135```bash136git clone https://github.com/doggybee/mcp-server-leetcode.git137cd mcp-server-leetcode138npm install139```140141Run in development mode:142143```bash144npm run dev145```146147Build the project:148149```bash150npm run build151```152153## License154155MIT156157## Related Projects158159- [Model Context Protocol](https://modelcontextprotocol.io) - MCP specifications and documentation160- [Claude for Desktop](https://claude.ai/download) - AI assistant with MCP support161162## Acknowledgements163164- This project was inspired by [alfa-leetcode-api](https://github.com/alfaarghya/alfa-leetcode-api)165
Full transparency โ inspect the skill content before installing.