Get the FREE Ultimate OpenClaw Setup Guide →

gdb

MCP server from ayushtiwari110/gdb-MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ayushtiwari110-gdb-mcp-server node server.js \
  --env HOST="0.0.0.0" \
  --env PORT="3000"

How to use

This MCP server provides an HTTP-based interface to execute C++ code using OnlineGDB's online compiler. It exposes an HTTP MCP endpoint at POST /mcp and a REST API with /tools/list and /health, along with a web interface at /. You can interact with it by initializing the MCP connection, listing available tools, and invoking specific tools such as execute_cpp_code, submit_solution, optimize_code, and generate_test_cases. The agent can run C++ code, supply custom input, test complete solutions across multiple test cases, analyze performance, and report detailed compilation and runtime errors. Typical workflows include quickly prototyping a solution with execute_cpp_code, validating it with submit_solution against several test cases, and iterating with optimize_code to improve efficiency.

To use the tools, send a request to the /mcp endpoint with the appropriate method (e.g., execute_cpp_code, submit_solution, etc.) and provide the required arguments as shown in the examples in the README. The server is configured to listen on port 3000 by default, but you can adjust the PORT environment variable when starting the server. The available tools are designed to help an agent analyze problems, run code, and verify results end-to-end in a single HTTP workflow.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Basic familiarity with running commands in a terminal

Installation steps:

  1. Clone the repository (or download the package): git clone <repository-url> cd onlinegdb-mcp-server

  2. Install dependencies: npm install

  3. Build the project (if required by the project setup): npm run build

  4. Start the MCP server: npm start

Notes:

  • The server relies on Puppeteer for browser automation. On Linux/macOS, you may need to install system dependencies as described in the README (Chromium and related libraries).
  • If you need to run on a different port, set the PORT environment variable, e.g., PORT=3001 npm start

Additional notes

Tips and common considerations:

  • Ensure system dependencies for Puppeteer are installed (especially on Linux). The README lists commands for Ubuntu/Debian, macOS with Homebrew, and Windows where Chromium is downloaded automatically by Puppeteer.
  • If the server fails to start due to port conflicts, set a different port with PORT=<port> npm start.
  • The HTTP transport is the recommended integration path for MCP clients to interact with this server; the documentation includes sample requests for tools/list and initialize calls.
  • For long-running executions, adjust timeLimit in execute_cpp_code and consider increasing test case complexity in generate_test_cases to thoroughly validate behavior.
  • If OnlineGDB experiences temporary outages, you may see runtime errors; retrying with longer timeouts can help.
  • When deploying, ensure environment variables such as PORT and any security-related configurations are properly set for your hosting environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers