hackerearth-mcp is an MCP (Model Context Protocol) server whose goal is to add the ability to "run code" to any MCP-compatible AI assistant. The project description notes that AI assistants are good at writing code but not at judging whether code will actually run, and often resort to guessing; this server lets assistants submit code to HackerEarth's sandboxed cloud servers for actual execution and read the real output.
Purpose and positioning: This project is an unofficial community project with no affiliation with or endorsement from HackerEarth, and users must supply their own free HackerEarth API Key. It does not require installing toolchains for various languages locally, and untrusted code is not executed on the local machine.
Main capabilities: Two tools are registered via FastMCP. run_code(code: str, language: str) -> str executes code in the specified language on HackerEarth and returns the program's printed output or error information; list_languages() -> str returns a newline-separated list of all supported language identifiers. The server supports 24 programming languages, provides friendly language aliases (for example, python maps to PYTHON3), and handles missing HACKEREARTH_KEY or unknown languages gracefully without making network calls. The internal function _normalize_language is responsible for normalizing user-provided language names or aliases into HackerEarth's exact identifiers.
Usage: First register a client on the HackerEarth developer dashboard to obtain the client-secret; the free tier includes a fairly generous request quota. Installation can be done via uvx or pip, or the project can be run from source; the project provides PyPI packaging, can be installed and run with the single command uvx hackerearth-mcp, and includes a server.json for the official MCP registry. To connect to Claude Desktop, you need to edit its configuration file (on macOS, ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows, %APPDATA%\Claude\claude_desktop_config.json), and when run from source it points to the local checkout directory. After restarting Claude Desktop, you can ask the assistant to run code and explain the output. The execution flow is: the assistant calls run_code, the server submits it to HackerEarth with the key and obtains a tracking token, polls until the run finishes, HackerEarth executes the code in a closed sandbox on its machines, and the server returns the output to the assistant for explanation.
Use cases: suitable for AI-assisted development scenarios that need to verify the actual output of code snippets, check compile-time or runtime errors, and quickly try out code across multiple languages; it can be used with MCP-compatible assistants such as Claude Desktop, Claude Code, and Cursor.
Limitations and notes: the project is explicitly an unofficial community project and depends on the HackerEarth code execution API and the user's own API key; the materials do not provide specific request quota figures, per-language version details, or execution time limits. The project version history shows that v0.1 includes code submission, status polling, output download, compile/runtime error reporting, and a list of 24 languages, while v0.2 adds PyPI packaging, single-command installation and running via uvx, and support for the official MCP registry; it has been published to the official MCP registry and Glama, and submitted to awesome-mcp. The repository includes a local test script test_local.py, and the GitHub Actions workflow test.yml runs the same command on every push or pull request. The project uses the MIT license.