Connect Claude Code or Cursor to Your Production Logs (MCP Setup in 2 Minutes)
Stop copy-pasting stack traces into your AI assistant. Connect Claude Code, Cursor or Lovable to your production logs over MCP and let it read real errors, traces and costs before it suggests a fix.
The usual way to debug production with an AI assistant: something breaks, you open a dashboard, copy a stack trace, paste it into the chat, and hope you copied the right one. The assistant is guessing from whatever you remembered to paste.
There is a better loop. With MCP (the Model Context Protocol) your assistant can query your production logs itself: pull the latest errors, follow a trace, check what you spent. It starts from evidence instead of a guess.
This takes about two minutes.
What you need
- A FlareLog account with a project that is receiving logs (free plan: 10,000 logs a month)
- An API key with MCP or Full scope (Project → Settings → API keys). Use a separate MCP key rather than your ingest key, so you can revoke it independently.
Connect Claude Code
claude mcp add --transport http flarelog https://mcp.flarelog.dev \
--header "Authorization: Bearer fl_your_api_key"Connect Cursor (or any client with a JSON config)
{
"mcpServers": {
"flarelog": {
"url": "https://mcp.flarelog.dev",
"headers": {
"Authorization": "Bearer fl_your_api_key"
}
}
}
}Put it in .cursor/mcp.json (or your client's equivalent). Lovable and other browser-based tools can use the same URL, which is why the server allows cross-origin requests.
What your assistant can do
FlareLog's MCP server exposes ten tools:
| Tool | What it answers |
|---|---|
get_recent_errors |
What broke in the last hour (or any window)? |
query_logs |
Logs filtered by level, source, text, URL or time range |
get_trace |
Everything that happened inside one request, end to end |
get_log_stats |
How many logs, split by level and source |
list_alerts |
Which error groups are open, and how often they occurred |
resolve_alert |
Mark an error group as resolved |
get_cost_summary |
What you spent on Workers, KV and the rest |
get_ai_summary, get_ai_calls, get_ai_cost_trend |
LLM calls, tokens, latency and spend |
Only resolve_alert changes anything; the rest are read-only.
Prompts that work
Start with the symptom, and let the assistant do the looking:
- "Checkout is returning 500s. Check the last hour of errors and tell me what's failing."
- "Find the trace for the failed request with ID
abc123and explain where it broke." - "Did anything change in error volume since the last deploy?"
- "What did our AI calls cost yesterday, and which model is the most expensive?"
A good assistant will call get_recent_errors, read the stack trace, open the file it points at, and propose a fix with the evidence next to it. That is the difference from guessing.
Practical tips
- Give it a narrow window. "Last hour" beats "everything", both for relevance and for how much text the assistant has to read.
- Keep the key scoped. An MCP-scoped key can query logs but cannot send them. Rotate it if a config file leaks.
- Redact what you log. The assistant can only see what you ship. The SDK scrubs common secret field names (
password,token,authorization), but avoid logging raw request bodies. - Ask for evidence. "Quote the error and the trace ID you based that on" keeps the answer grounded.
How this compares
Several observability vendors now offer an MCP server, including Elastic, Pydantic Logfire and DeepTracer. If your stack already lives in one of them, use theirs. FlareLog's angle is the other end: no collector to run, nothing to host, a free tier, and the same account also catches crashes and watches your cloud bill. It is built for people who want production feedback inside their editor without becoming an observability engineer.
Not on Cloudflare?
You do not need Cloudflare. The SDK runs on Node, Next.js, Vercel, the browser and more; the MCP server reads whatever it ships. See the AI debugging guide for the longer walkthrough.
Ready? Create a project, send a log, add the MCP config above, and ask your assistant what broke.
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 free →