Get the FREE Ultimate OpenClaw Setup Guide →

mcp -leetcode

A Model Context Protocol (MCP) server for LeetCode that provides access to problems, user data, and contest information through GraphQL

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio doggybee-mcp-server-leetcode mcp-server-leetcode

How to use

This MCP server provides programmatic access to LeetCode data through a collection of tools and a CLI, enabling AI assistants to fetch daily challenges, problem details, search problems, and retrieve user and contest information. It exposes problem-related, user-related, and contest-related tools that can be invoked by MCP-enabled agents. You can use the server as a library in code or run it as a standalone service via its CLI entry point, then integrate it with your MCP client or assistant.

Key capabilities include: getting the daily LeetCode challenge, fetching details for a specific problem, searching problems by tags or difficulty, retrieving user profiles and submission history, and obtaining contest details and rankings. The server also exposes resources URLs for quick access to LeetCode endpoints and supports both local development and production deployments via a simple CLI.

How to install

Prerequisites:

  • Node.js and npm (typically Node 14+ or newer)
  • Access to a terminal or shell

Installation options:

  1. Global installation (CLI usage):
npm install -g @mcpfun/mcp-server-leetcode

Then run:

mcp-server-leetcode
  1. Local project installation (as a dependency in your app):
npm install @mcpfun/mcp-server-leetcode

You can start the server from your codebase or via the CLI depending on your setup. Smithery installation (if you use Smithery) can be done as described in the Smithery docs for automated installation.

  1. Local development steps (if cloning the repo):
git clone https://github.com/doggybee/mcp-server-leetcode.git
cd mcp-server-leetcode
npm install

Then run in development mode if supported by the project (e.g., via npm run dev) and build when ready (npm run build).

Additional notes

Tips and notes:

  • The server is published as @mcpfun/mcp-server-leetcode on npm; use the global install for quick CLI access or install locally for integration into applications.
  • The CLI entry point is mcp-server-leetcode; in local development scenarios, you may run it with a node-based startup if your environment requires dist/index.js as the entry point.
  • If you are configuring an MCP client (e.g., Claude Desktop or another assistant), point the MCP configuration to the server’s command: mcp-server-leetcode.
  • Available tools cover problem retrieval, search, and user/contest data; you can also use the provided resources URLs to access LeetCode endpoints directly when needed.
  • For local development, use npm run dev (if supported) and npm run build before deployment.
  • Ensure network access to LeetCode APIs, and consider rate limits or API changes on LeetCode when integrating into an assistant workflow.

Related MCP Servers

Sponsor this space

Reach thousands of developers