An MCP server for fetching LeetCode problems and generating AI-powered solutions using OpenAI's API
Server has 3 tools with basic naming (verb_noun pattern) but critical gaps in schema documentation and parameter descriptions. Tool schemas are partially visible but lack complete JSON Schema definitions with type constraints. Descriptions exist but are generic (avg ~80 chars, below 194-char baseline). No parameter descriptions visible in schema. No output schema documentation. Error handling is minimal, no recovery guidance or error classification. No tool annotations (readOnlyHint, etc.). Composition is reasonable (3 focused tools) but parameter naming lacks type suffixes (e.g., 'problem' should be 'problem_object' or 'problem_id'). Security concern: OpenAI API key loaded from config file in __init__, not injected server-side.
Generate a detailed explanation of all solutions for a problem.
Generate a solution using OpenAI's API with rate limit handling.
Fetch problem details using LeetCode's GraphQL API.
Input schemas lack complete JSON Schema definitions. 'problem' parameter in generate_solution and explain_solutions is typed as 'object' with no nested field definitions, constraints, or required fields. Cannot validate or guide LLM input.
No parameter descriptions in schemas. 'problem_name' in get_problem has a description, but nested fields in 'problem' object (title, difficulty, description, examples, constraints) lack descriptions. LLM cannot infer what each field means.
No output schema documentation. Tools return Solution or LeetCodeProblem dataclasses but no schema is exposed to the LLM. Agent cannot plan downstream calls or extract required fields.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 38 | <=2025-11-25 | v2 |
Error handling lacks recovery guidance. generate_solution catches OpenAI quota/rate-limit errors and prints user-facing messages, but does not return structured error responses with actionable next steps for the LLM (e.g., 'retry in 60 seconds' or 'call search_problems instead').
Security: OpenAI API key is loaded from config.json in __init__ and stored in self.client. This couples credential management to tool initialization and risks key exposure in logs. Should use server-side secret injection (environment variables or vault).