2026-01-27·Chiheb Nabil

How to Debug Production with AI — MCP Server for Cursor and Claude

Stop copy-pasting error messages into ChatGPT. Connect FlareLog's MCP server to Cursor or Claude and let your AI read your production logs, find the crash, and suggest the fix.

mcpai-debuggingcursorclaudevibe-codingproduction

You're debugging production at 2 AM. Your app is crashing. You copy the error message from Cloudflare's dashboard (which shows "Error 1101" with no details) and paste it into ChatGPT. ChatGPT says "maybe it's a null reference?" You don't know what that means. You change random code based on the guess. You deploy. It's still broken. You repeat.

This is how most vibe coders debug production — by guessing. It's slow, it's frustrating, and it doesn't work. The problem isn't that your AI is dumb. The problem is that your AI can't see your production. It only sees the error message you pasted — not your logs, not your traces, not the request that caused the crash, not the 50 other errors that happened in the same minute.

There's a better way. It's called MCP, and it takes 2 minutes to set up.

What is MCP?

MCP (Model Context Protocol) is a standard that lets AI tools like Cursor and Claude Desktop connect to external data sources. Think of it like an API for your AI — instead of you copy-pasting data into the chat, the AI fetches the data it needs directly.

FlareLog runs an MCP server at mcp.flarelog.dev that exposes your production logs, errors, traces, and cost data. When you connect it to Cursor or Claude, your AI can:

  • Query your logs in natural language
  • Search for specific errors by traceId, URL, or message
  • See the full stack trace of a crash
  • Correlate errors with recent deploys
  • Suggest fixes based on your actual codebase (in Cursor)

The old way vs. the MCP way

The old way (broken):

  1. App crashes in production
  2. You see "500 Internal Server Error"
  3. You open Cloudflare dashboard — "Error 1101, no logs"
  4. You copy-paste the error into ChatGPT
  5. ChatGPT guesses — "maybe it's a null reference?"
  6. You change random code based on a guess
  7. Deploy. Still broken. Repeat.

The MCP way:

  1. App crashes in production
  2. FlareLog's Tail Worker captures the full stack trace
  3. You open Cursor (or Claude Desktop)
  4. You ask: "What broke in production in the last hour?"
  5. Cursor queries FlareLog via MCP — sees the actual error, stack trace, request URL
  6. Cursor opens the file, highlights the bug, suggests a fix
  7. Apply. Deploy. Fixed. Done.

The entire loop — from crash to fix — takes 2 minutes instead of 2 hours. And the fix is based on real data, not a guess.

Set up MCP in 2 minutes

For Cursor

Create a file at .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "flarelog": {
      "url": "https://mcp.flarelog.dev",
      "headers": {
        "Authorization": "Bearer fl_your_api_key_here"
      }
    }
  }
}

Replace fl_your_api_key_here with your FlareLog API key (get it from your dashboard). Restart Cursor. Done.

For Claude Desktop

Edit claude_desktop_config.json (on macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "flarelog": {
      "url": "https://mcp.flarelog.dev",
      "headers": {
        "Authorization": "Bearer fl_your_api_key_here"
      }
    }
  }
}

Restart Claude Desktop. Done.

What you can ask your AI

Once connected, you can ask your AI anything about your production in natural language:

"What errors happened in production in the last hour?"

Your AI queries FlareLog and returns a list of errors with timestamps, messages, and affected endpoints. You see exactly what broke and when.

"Show me the stack trace for the crash that happened at 3:42 AM"

Your AI finds the specific error and shows you the full stack trace — the file, line number, and function that caused it. No more guessing.

"Which API endpoint is throwing the most 500s?"

Your AI aggregates errors by URL and shows you the worst offenders. You know exactly where to focus your debugging.

"Find the request that caused this traceId and suggest a fix"

Your AI looks up the trace, sees the full request flow (which functions ran, which API calls were made), identifies where the error occurred, and — in Cursor — opens the file and suggests a fix you can apply directly.

"Are there any patterns in the errors from the last deploy?"

Your AI correlates errors with your deploy timestamps and identifies whether a recent deploy caused the spike. You know immediately if you need to roll back.

"What's my Cloudflare bill looking like today?"

Your AI queries FlareLog's cost tracking and tells you your estimated spend for the day, broken down by resource (Workers, KV, R2, D1). If you're approaching your threshold, it warns you.

How the AI uses this to fix bugs

Here's a real example. Let's say your Lovable app crashes when a user tries to view their profile.

Without MCP:

  • You see "500 Internal Server Error" in the browser
  • You check Cloudflare's dashboard — "Error 1101"
  • You paste "Error 1101" into ChatGPT
  • ChatGPT says: "This means your Worker threw an exception. Check your code for errors."
  • Helpful? No.

With MCP (in Cursor):

  • You open Cursor and ask: "What broke in production in the last 10 minutes?"
  • Cursor queries FlareLog and returns: "3 errors in the last 10 minutes, all on GET /api/profile. The error is TypeError: Cannot read properties of null (reading 'name') in src/routes/profile.ts:42."
  • Cursor opens src/routes/profile.ts, highlights line 42: const name = user.profile.name;
  • Cursor explains: "The user.profile is null when the user hasn't set up their profile yet. The code assumes it always exists."
  • Cursor suggests a fix: const name = user?.profile?.name ?? "Unknown";
  • You click "Apply". Deploy. Fixed.

The entire flow — from "my app is broken" to "fixed and deployed" — takes 90 seconds. And the fix is correct because the AI saw the actual error, not a guess.

Is this safe?

Yes. Here's why:

  • Read-only: The MCP server only exposes READ operations. Your AI can query logs and traces — it can't modify or delete anything.
  • Scoped API key: Your API key is scoped per-project. The AI can only see logs for the project whose key you provided.
  • No data leaves your dashboard: The MCP server queries your FlareLog dashboard. Your logs stay in FlareLog — the AI just reads them via the protocol.
  • Revoke anytime: Rotate your API key to instantly revoke AI access. Generate a new key to re-grant.

Which AI tools support MCP?

Tool MCP support How to connect
Cursor .cursor/mcp.json in project root
Claude Desktop claude_desktop_config.json
ChatGPT Not yet (use the FlareLog dashboard directly)
GitHub Copilot Not yet
Windsurf Similar to Cursor — check their MCP docs
Zed ~/.config/zed/settings.json

The MCP ecosystem is growing fast. If your tool isn't listed here, check their docs — they may have added support since this was written.

The vibe coder's debugging workflow

Here's what your workflow should look like once MCP is set up:

  1. Get a Slack alert — FlareLog pings you when errors spike
  2. Open Cursor — don't touch the browser or Cloudflare's dashboard
  3. Ask "what broke?" — Cursor queries FlareLog and shows you the exact error
  4. Ask "fix it" — Cursor opens the file and suggests a fix
  5. Apply + deploy — one click to apply, one command to deploy
  6. Done — go back to vibing

No copy-pasting. No guessing. No 2 AM debugging sessions. Just your AI, your logs, and a 2-minute fix loop.

Start debugging with AI

MCP is the missing piece between vibe coding and production debugging. Your AI can write code — now it can also see what that code does in production, and fix it when it breaks.

Start free — 10k logs/month, MCP server included, no credit card. Then check the AI debugging guide for the full setup walkthrough.

Never miss an invisible crash again

FlareLog catches the errors Cloudflare can't log. Set up the Tail Worker in 5 minutes and see every crash, timeout, and cost spike in real time.

Start logging free →