LeetCode MCP Server Integration
Integrate LeetCode’s powerful coding resources and user data into FlowHunt with the LeetCode MCP Server for AI-driven productivity, analytics, and contest insights.

What does “LeetCode” MCP Server do?
The LeetCode MCP Server is a Model Context Protocol (MCP) implementation designed to connect AI assistants with LeetCode’s vast repository of coding problems, user data, and contest information via GraphQL. By interfacing with the LeetCode API, this MCP server enables AI-driven tools and workflows to perform advanced tasks such as searching problems, retrieving daily challenges, accessing user profiles, and querying contest data and rankings. This integration streamlines the development workflow for AI assistants, allowing them to surface up-to-date coding challenges, user statistics, and competitive programming data, thereby enhancing productivity and the user experience for developers and learners alike.
List of Prompts
No prompt templates are explicitly mentioned in the repository files or documentation.
List of Resources
- LeetCode Problems: Provides access to the full set of LeetCode problems, including filtering and search capabilities.
- Daily Challenge: Exposes the daily LeetCode coding challenge as a resource for users or AI agents.
- User Profiles: Allows retrieval of user information, such as solved problems and ranking.
- Contest Data: Offers access to contest information and rankings from LeetCode.
List of Tools
No explicit list of tools is provided in server.py
or the main documentation. However, the following functionality is described:
- Search Problems: Enables searching LeetCode problems by difficulty or other filters.
- Retrieve Daily Challenge: Allows getting the current daily coding challenge.
- User Profile Access: Retrieves user statistics and information.
- Contest Querying: Enables fetching contest details and rankings.
Use Cases of this MCP Server
- Automated Coding Practice: AI assistants can fetch and recommend daily or targeted coding challenges, helping users maintain a steady practice routine.
- Personal Progress Tracking: Developers can use AI tools to monitor their LeetCode progress, solved problems, and rankings, enabling data-driven learning strategies.
- Contest Preparation and Analytics: Retrieve up-to-date contest data to prepare for upcoming competitions or analyze past performance.
- Curriculum Integration: Educators and bootcamps can integrate LeetCode resources into their teaching workflows, providing students with real-time coding assignments.
- AI-Powered Interview Prep: Assistants can surface relevant problems based on job roles or difficulty, helping candidates prepare more efficiently.
How to set it up
Windsurf
- Ensure Node.js is installed on your system.
- Install the LeetCode MCP server globally:
npm install -g @mcpfun/mcp-server-leetcode
- Locate Windsurf’s MCP server configuration file.
- Add the following JSON to the configuration:
{ "mcpServers": { "leetcode": { "command": "mcp-server-leetcode" } } }
- Save the file and restart Windsurf to apply the changes.
Securing API Keys
If API keys are needed, use environment variables:
{
"mcpServers": {
"leetcode": {
"command": "mcp-server-leetcode",
"env": {
"LEETCODE_SESSION": "your-session-token"
}
}
}
}
Claude
- Install the MCP server via Smithery CLI:
npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
- Edit
claude_desktop_config.json
:{ "mcpServers": { "leetcode": { "command": "mcp-server-leetcode" } } }
- For development, use:
{ "mcpServers": { "leetcode": { "command": "node", "args": ["/path/to/dist/index.js"] } } }
- Save and restart Claude Desktop.
- Verify by checking MCP server status in the app.
Securing API Keys
{
"mcpServers": {
"leetcode": {
"command": "mcp-server-leetcode",
"env": {
"LEETCODE_SESSION": "your-session-token"
}
}
}
}
Cursor
- Install Node.js and the MCP server package globally.
- Edit Cursor’s MCP configuration or plugin settings to add:
{ "mcpServers": { "leetcode": { "command": "mcp-server-leetcode" } } }
- Save and restart Cursor.
- Verify MCP server is running.
Securing API Keys
{
"mcpServers": {
"leetcode": {
"command": "mcp-server-leetcode",
"env": {
"LEETCODE_SESSION": "your-session-token"
}
}
}
}
Cline
- Install Node.js and
@mcpfun/mcp-server-leetcode
globally. - Open the Cline MCP server configuration.
- Add the following configuration:
{ "mcpServers": { "leetcode": { "command": "mcp-server-leetcode" } } }
- Save the config and restart Cline.
- Confirm the server is active.
Securing API Keys
{
"mcpServers": {
"leetcode": {
"command": "mcp-server-leetcode",
"env": {
"LEETCODE_SESSION": "your-session-token"
}
}
}
}
How to use this MCP inside flows
Using MCP in FlowHunt
To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:
{
"leetcode": {
"transport": "streamable_http",
"url": "https://yourmcpserver.example/pathtothemcp/url"
}
}
Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change “leetcode” to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.
Overview
Section | Availability | Details/Notes |
---|---|---|
Overview | ✅ | |
List of Prompts | ⛔ | No prompt templates listed in the repository |
List of Resources | ✅ | Problems, daily challenge, user profiles, contest data |
List of Tools | ✅ | Problem search, daily challenge retrieval, user profile access, contest querying (not explicit) |
Securing API Keys | ✅ | Example provided using env in configuration |
Sampling Support (less important in evaluation) | ⛔ | Not mentioned |
Based on the tables above, the LeetCode MCP server is a solid implementation for accessing LeetCode data via MCP. It covers the core features for integration, resource access, and setup, but lacks detailed prompt templates and explicit sampling or roots support information. The documentation is clear and provides practical configuration examples.
MCP Score
Has a LICENSE | Yes (MIT) |
---|---|
Has at least one tool | Yes |
Number of Forks | 3 |
Number of Stars | 14 |
Frequently asked questions
- What is the LeetCode MCP Server?
It’s a Model Context Protocol server that bridges AI assistants and automation tools to LeetCode’s coding problems, user profiles, contests, and more through the LeetCode GraphQL API.
- What resources can I access with this integration?
You can search and filter coding problems, retrieve the daily challenge, access user statistics, and fetch contest details and rankings directly in your AI workflows.
- How do I secure my LeetCode session or API keys?
Store your LEETCODE_SESSION token securely using environment variables in your MCP server configuration. Example: 'env': { 'LEETCODE_SESSION': 'your-session-token' }.
- What are typical use cases?
Automated coding practice, personal progress tracking, contest analytics, curriculum integration for educators, and AI-powered interview preparation.
- Is this MCP Server open-source?
Yes, the LeetCode MCP Server is MIT licensed and can be freely used and extended.
Start with LeetCode MCP in FlowHunt
Boost your coding workflows, contest prep, and analytics by integrating the LeetCode MCP Server with FlowHunt’s AI-powered automation.