> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperprobe.co/llms.txt
> Use this file to discover all available pages before exploring further.

# AI-Native Debugging with MCP

> Use your favorite AI assistant (opencode, Cursor, Windsurf, Claude) to autonomously debug and trace production code using HyperProbe Model Context Protocol (MCP) workspace configuration.

HyperProbe is the world's first **AI-native production debugger**. By exposing the HyperProbe engine through a Model Context Protocol (MCP) server, LLM agents can autonomously inspect live running systems to diagnose production incidents, find bugs, and retrieve real-time state.

<img src="https://mintcdn.com/hypertest-cee1a811/kV6wEn8JLwpRaN7D/images/ai-debugging-flow.svg?fit=max&auto=format&n=kV6wEn8JLwpRaN7D&q=85&s=d3c76c273f40076c49e00584634e23a0" alt="AI Debugging Flow" width="800" height="250" data-path="images/ai-debugging-flow.svg" />

***

## Configuring the MCP Server

### 🔒 Workspace-Level Isolation (Best Practice)

In professional environments, enabling the HyperProbe MCP server system-wide is not recommended. You should enable it **only inside the specific project workspace** you are actively debugging. This prevents environment variable leakage and ensures the debugger is only active when working on that specific codebase.

To configure, check your tool's documentation to add the HyperProbe server block to your workspace-specific configuration file:

<Tabs>
  <Tab title="opencode">
    Configure the server in your project's root `opencode.json` file. This locks the debugger strictly to this repository and checks it into Git for team collaboration.

    *Note: opencode utilizes **`"environment"`** as the configuration key.*

    ```json opencode.json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "hyperprobe": {
          "type": "local",
          "command": ["npx", "-y", "@hyperprobe/mcp-server"],
          "enabled": true,
          "environment": {
            "BACKEND_URL": "https://app.hyperprobe.co"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Other Coding Agents">
    For other assistants (such as **Cursor**, **Windsurf**, **Cline**, or **Claude Desktop**), add this block to your tool's workspace-specific or folder-level settings file.

    *Note: Most other coding assistants utilize **`"env"`** as the configuration key.*

    ```json config.json theme={null}
    {
      "mcpServers": {
        "hyperprobe": {
          "command": "npx",
          "args": [
            "-y",
            "@hyperprobe/mcp-server"
          ],
          "env": {
            "BACKEND_URL": "https://app.hyperprobe.co"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Note>
  **Important:** Remember to restart your coding agent (or reload your editor window) after adding the MCP configuration for the changes to take effect.
</Note>

***

## The Case of the Mystery Stripe Webhook 500

It is 2 AM. Your phone buzzes with a high-severity Sentry alert: **`POST /api/stripe/webhook - 500 Internal Server Error`**.

The error occurs exclusively on subscription renewals. Regular checkout payments go through cleanly, but a handful of automated subscription renewals are failing silently. The stack trace points deep into your billing service: `TypeError: Cannot read properties of null (reading 'country')`.

Debugging third-party asynchronous webhooks is historically miserable:

* **No local reproduction:** You cannot easily replicate the exact Stripe customer state, payment history, and subscription variables locally.
* **No live attached debugger:** Running a debugger in production is out of the question due to blocking connections and latency overhead.
* **The log-deploy cycle:** Your only resort is adding print statements, redeploying, waiting for another renewal failure, and parsing raw logs.

With **HyperProbe + MCP**, you don't debug this. **Your AI Assistant does.**

### How the AI Assistant Autonomously Cracks the Case

When you configure your LLM agent with the HyperProbe MCP server, here is the exact, compressed flow of how it solves the incident:

1. **You ask the AI:** *"Sentry reports a 500 error on Stripe webhooks for renewals. Can you figure out why and fix it?"*
2. **The AI scans your codebase:** It automatically finds `src/webhooks/StripeWebhookHandler.ts` and inspects the database queries and billing logic.
3. **The AI places a probe:** It dynamically registers a conditional probe inside your running application to inspect local variables when a subscription renewal event arrives.
4. **Telemetry Capture:** When the next live renewal hits, HyperProbe captures the exact local variables in scope and sends them back to the AI without interrupting or slowing down your service.
5. **Diagnosis:** The AI inspects the variables and instantly catches the anomaly:
   ```json theme={null}
   {
     "user": {
       "id": "usr_9A2X1",
       "email": "legacy@old.com",
       "address": null,
       "isLegacyUser": true
     }
   }
   ```
   **The root cause is revealed:** Users migrated from your legacy billing system do not have an `address` object populated in the database. The new tax calculation logic assumed `address` would always be present, throwing an exception.
6. **The AI writes the fix:** The AI modifies your code to handle null addresses gracefully, runs your test suite to verify, and submits a clean pull request.
