Skip to main content
Glama

Servidor MCP LeetCode

versión npm Licencia de GitHub Versión

Un servidor de Protocolo de Contexto de Modelo (MCP) para LeetCode que permite a los asistentes de IA acceder a los problemas de LeetCode, la información del usuario y los datos del concurso.

Características

  • 🚀 Acceso rápido a la API de LeetCode

  • 🔍Busca problemas, recupera desafíos diarios y consulta perfiles de usuarios

  • 🏆 Consultar datos y clasificaciones del concurso

  • 🧩 Soporte completo para herramientas y recursos de MCP

  • 📦 Proporciona tanto CLI como API programable

Related MCP server: LeetCode MCP Server

Instalación

Instalación global

npm install -g @mcpfun/mcp-server-leetcode

Una vez instalado, puedes ejecutarlo directamente desde la línea de comandos:

mcp-server-leetcode

Instalación local

npm install @mcpfun/mcp-server-leetcode

Uso

Integración con Claude para escritorio

Agregue lo siguiente a su archivo claude_desktop_config.json de Claude for Desktop:

{
  "mcpServers": {
    "leetcode": {
      "command": "mcp-server-leetcode"
    }
  }
}

Para el desarrollo local:

{
  "mcpServers": {
    "leetcode": {
      "command": "node",
      "args": ["/path/to/dist/index.js"]
    }
  }
}

Uso como biblioteca

import { LeetCodeService } from '@mcpfun/mcp-server-leetcode';

// Initialize the service
const leetcodeService = new LeetCodeService();

// Get daily challenge
const dailyChallenge = await leetcodeService.getDailyChallenge();

// Search problems
const problems = await leetcodeService.searchProblems({
  difficulty: 'MEDIUM',
  tags: 'array+dynamic-programming'
});

Herramientas disponibles

Herramientas relacionadas con problemas

Nombre de la herramienta

Descripción

Parámetros

get-daily-challenge

Consigue el desafío diario

Ninguno

get-problem

Obtenga detalles de un problema específico

titleSlug (cadena)

search-problems

Búsqueda de problemas según criterios

tags (opcional), difficulty (opcional), limit (predeterminado 20), skip (predeterminado 0)

Herramientas relacionadas con el usuario

Nombre de la herramienta

Descripción

Parámetros

get-user-profile

Obtener información del usuario

username (cadena)

get-user-submissions

Obtener el historial de envíos del usuario

username (cadena), limit (opcional, predeterminado 20)

get-user-contest-ranking

Obtener clasificaciones de concursos de usuarios

username (cadena)

Herramientas relacionadas con el concurso

Nombre de la herramienta

Descripción

Parámetros

get-contest-details

Obtenga detalles del concurso

contestSlug (cadena)

Recursos disponibles

Recursos para el problema

  • leetcode://daily-challenge : Desafío diario

  • leetcode://problem/{titleSlug} : Detalles del problema

  • leetcode://problems{?tags,difficulty,limit,skip} : Lista de problemas

Recursos para el usuario

  • leetcode://user/{username}/profile : Perfil de usuario

  • leetcode://user/{username}/submissions{?limit} : Envíos de usuarios

  • leetcode://user/{username}/contest-ranking : Clasificación del concurso de usuarios

Desarrollo local

Clonar el repositorio e instalar las dependencias:

git clone https://github.com/doggybee/mcp-server-leetcode.git
cd mcp-server-leetcode
npm install

Ejecutar en modo de desarrollo:

npm run dev

Construir el proyecto:

npm run build

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Proyectos relacionados

Expresiones de gratitud

Available Tools

7 tools
get-contest-detailsD
ParametersJSON Schema
NameRequiredDescriptionDefault
contestSlugYesThe URL slug of the contest

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-daily-challengeD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-problemD
ParametersJSON Schema
NameRequiredDescriptionDefault
titleSlugYesThe URL slug of the problem (e.g., 'two-sum')

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-user-contest-rankingD
ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesLeetCode username

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-user-profileD
ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesLeetCode username

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-user-submissionsD
ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesLeetCode username
limitNoMaximum number of submissions to return

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-problemsD
ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNoTags to filter by, separated by '+' (e.g., 'array+dynamic-programming')
difficultyNoDifficulty level
limitNoMaximum number of problems to return
skipNoNumber of problems to skip

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

C2.1/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose targeting different LeetCode resources: contests, daily challenges, problems, user rankings, profiles, submissions, and problem search. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using kebab-case (e.g., get-contest-details, search-problems). The naming is uniform throughout with no deviations in style or convention.

Tool Count5/5

With 7 tools, the server is well-scoped for a LeetCode integration, covering key areas like problem access, user data, and contests. Each tool serves a specific, necessary function without bloat.

Completeness4/5

The tool set provides comprehensive read-only coverage for LeetCode data, including problems, user profiles, contests, and submissions. A minor gap exists in write operations (e.g., submitting solutions or managing account settings), but core retrieval needs are fully met.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.
    9
    239
    141
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    An MCP server that provides tools to interact with the LeetCode API, enabling problem fetching, code template generation, and solution execution/submission.
    7
    1
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that provides structured, AI-powered guidance for LeetCode problems, including approach analysis, hints, complexity breakdowns, and optimization directions without spoiling solutions.
    4
    1
  • F
    license
    Not graded
    quality
    C
    maintenance
    A tutorial and working MCP server that connects to your LeetCode profile, enabling AI assistants to check solved problems and recommend new ones by topic and difficulty.
    1

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/doggybee/mcp-server-leetcode'

If you have feedback or need assistance with the MCP directory API, please join our Discord server