Engineering

Give Claude Code or Cursor the full context of a bug with MCP

Connect Claude Code or Cursor to your bug captures over MCP, so the agent reads the console, network requests, user actions, and backend trace, not a summary.

By the Laneshot team · · 9 min read

An AI coding agent fixes a bug about as well as the context you give it. Paste "checkout is broken on Safari" and it guesses. Give it the console error, the failing request with its response body, the clicks that led there, and the server-side exception, and it can go straight to the code that failed.

The Model Context Protocol (MCP) is how you hand that context over without copying and pasting. You connect a bug tool's MCP server to Claude Code or Cursor once. After that, you paste a link to a bug, and the agent fetches the parts it needs.

This guide covers what an agent needs from a bug report, how to connect Laneshot's MCP server in Claude Code and Cursor, the tools the agent gets, prompts that work, and safety.

What MCP is

MCP is an open protocol that lets AI applications call tools and read data from other systems through one standard interface. A product runs an MCP server; a client such as Claude Code or Cursor connects to it, and the model calls the server's tools when they're useful.

For debugging, that changes who gathers the evidence. Instead of you deciding which log lines to paste, the agent asks for the console errors, then the failed requests, then the backend spans, as its investigation needs them. That's what MCP bug context means in practice: the agent works from the same raw evidence a developer would, not from a summary of it.

Why a pasted description isn't enough

A bug description is a summary written by a person. It's the right place for intent, such as "I expected the order to go through". But it loses the details an agent needs to find the code:

ContextWhat it gives the agentWhat a summary says instead
Console errorsThe exact message and stack trace, pointing at a file and function"There was an error"
Network requestsMethod, URL, status code, and request and response bodies"The payment failed"
User actionsThe order of clicks, form changes, and navigations, which can become a test"I tried to pay"
EnvironmentBrowser and version, viewport, language, and time zone"On my laptop"
App metadataThe release, feature flags, and signed-in userUsually nothing
Backend traceThe server span that failed, its exception, and the logs around itNothing: the reporter never sees it

Without these, an agent does what a developer does with a vague ticket: it reads the code, forms a theory, and fixes the most plausible thing. Sometimes that's a different bug, and the original one ships again.

With them, the agent can quote the error, find the handler for the failing request, and check its theory against what the server actually did.

There's also the follow-up problem. A developer can message the reporter to ask which browser they used. An agent running in your terminal can't. Whatever it needs has to be reachable from the link you give it. For what a complete human-written report contains, see how to write a bug report.

Connect Laneshot's MCP server

Laneshot captures bugs in the browser with the video, console, network requests, user actions, and environment attached, and runs an MCP server that exposes all of it. The hosted endpoint is:

https://app.laneshot.com/api/mcp

It uses the Streamable HTTP transport and authenticates with a personal API token.

Create a token

  1. Open Account settings from the menu at the bottom of the sidebar.
  2. Under Browsers and API tokens, name the token after where it will be used, such as "Claude Code on my laptop". If you belong to several organizations, choose the one the agent should work in.
  3. Select Create token, then copy the token, or the ready-made claude mcp add command. The token starts with lsh_ and is shown once.

Claude Code

Run this in a terminal, with your token in place of lsh_…:

claude mcp add --transport http laneshot https://app.laneshot.com/api/mcp \
  --header "Authorization: Bearer lsh_…"

Cursor

Add the server to ~/.cursor/mcp.json, or to .cursor/mcp.json inside a repository:

{
  "mcpServers": {
    "laneshot": {
      "url": "https://app.laneshot.com/api/mcp",
      "headers": { "Authorization": "Bearer lsh_…" }
    }
  }
}

VS Code, Codex, and other clients that support Streamable HTTP work too. The MCP server docs have the configuration for each. Claude on the web and desktop can't send a custom header from a custom connector, so add the public endpoint, https://app.laneshot.com/api/mcp/public, instead. It needs no token and reads only traces shared through a public link.

What the agent can do

The server has two groups of tools. Capture tools read one capture, from a trace link or ID. Account tools work on your projects and cards, with your permissions.

Capture toolWhat it returns
read_traceThe whole capture as a Markdown report: description, environment, console errors, failed requests, every request, the person's actions, the transcript, and backend data when allowed. Agents should start here.
get_traceMetadata: title, description, kind, start time, duration, problem counts, and environment.
get_console_logsConsole messages and uncaught exceptions, with stack traces. Takes errorsOnly and limit.
get_network_requestsRequests with method, URL, status, timing, redacted headers and bodies, and backend trace IDs. Takes failedOnly, urlContains, includeAssets, and limit.
get_user_actionsThe person's clicks, navigation, and page events.
get_transcriptThe timed transcript of the voice-over, or a note when there's none.
get_backendSpans, errors, and logs from the project's backend connections, such as OpenTelemetry, Sentry, or Datadog.
Account toolWhat it does
list_projectsLists the projects you can access, with their ID, key, and name.
search_cardsFinds cards in a project by title or number.
get_cardReturns a card, such as SHOP-12, with its description, type, priority, column, assignee, labels, dates, custom fields, linked issues, comments, and traces.
create_cardCreates a card from a project key and a title, with optional description, type, priority, column, assignee, labels, dates, and fields.
update_cardChanges only the fields you send, such as the column, assignee, priority, or description.
move_cardMoves a card to another project. The old reference keeps working.
list_issue_repositoriesThe GitHub repositories a project's cards can be filed in.
create_github_issueFiles a card as a GitHub issue in a repository linked to its project, with the card's description and links to its captures, and links the issue back to the card.
list_tracesYour most recent captures, newest first, with their problem counts.
list_automationsA project's automations, their trigger, and whether they're on.
run_automationRuns an automation now, optionally on a card, and returns each step's outcome.

The account tools take names the way you'd say them: a column such as In progress, an assignee such as me, and labels and custom fields by name. When a name doesn't match anything, the error lists the valid ones, so the agent can correct itself.

Prompts that work

Paste a link or a card reference and say what you want. These work as written:

Use the Laneshot MCP to read https://app.laneshot.com/traces/0b1f… and find the cause of the bug.
Then look for the code that handles the failing request in this repository.
List the bugs in the To do column of SHOP that have captures, read each capture,
and group them by likely root cause.
Read SHOP-12. If the backend shows a payments error, run the "Escalate to on-call"
automation on it.
Read SHOP-12, fix the bug in this repository, then move the card to In review,
assign it to me, and append a short summary of the fix to its description.

A few habits make the results better:

  • Cause first, fix second. Ask the agent to explain what went wrong before it changes code. A good order is read_trace, then get_console_logs with errorsOnly, then get_network_requests with failedOnly, then get_backend.
  • Ask for evidence. Have it quote the error message, the endpoint, and the timestamp it relied on. If it can't, it's guessing.
  • Look before the recording started. Captures include up to two minutes of activity from before someone pressed record. A failure often happens just before.
  • Read the app metadata. When only some users hit a bug, the release or a feature flag in the report often explains why.

For a one-off without MCP, use Ask Claude at the top of a trace. It opens Claude with a prompt that links to a Markdown report of the capture, through the trace's public link. See Ask Claude.

Safety and privacy

Giving an agent access to bug captures means giving it access to data from real sessions. A few properties of the setup matter:

  • A token belongs to one person and one organization. Every call runs as you, inside the token's organization. The agent sees exactly what you can see there, and nothing from your other organizations.
  • Writes count as yours. create_card, update_card, move_card, and run_automation need permission to edit cards, and create_github_issue needs permission to create issues in the project. Their changes notify people, run automations, and update open boards, like an edit in the app.
  • Tokens can be revoked at any time from Account settings. Access also ends when you leave the organization or your account is deactivated. Only a hash of each token is stored, and the settings page shows when it was last used.
  • Masking happens before data leaves the browser. Values of headers such as Authorization and Cookie, query parameters with sensitive names, and JSON or form fields such as password or card_number become [redacted] in the browser, and again on the server. Typed text is never recorded. Masked values are never uploaded, so the agent can't see them either.
  • Backend data stays out of public links by default. Through the public endpoint, get_backend works only when the public link was created with backend data included.

Masking works on names, not on meaning. An email address in a response body is still there. Treat captures like production logs, and keep a few rules:

  • Create one token per tool and machine, named so you know which one to revoke.
  • Never commit a .cursor/mcp.json that contains a token. Use the file in your home folder, or keep the repository file out of version control.
  • Start with prompts that only read, and review what the agent wants to change before you let it move or edit cards.
  • Tell the agent that [redacted] values were removed on purpose and must not be guessed or pasted back.

Frequently asked questions

What is an MCP server for bug reports?

It's a server that lets an AI agent read bug reports through tools instead of pasted text. The agent fetches a capture's console logs, network requests, user actions, and backend trace when it needs them.

How do I add an MCP server to Claude Code?

Run claude mcp add --transport http followed by a name and the server's URL, and add --header if the server needs authentication. For Laneshot, the URL is https://app.laneshot.com/api/mcp and the header is Authorization: Bearer followed by your token.

How do I use MCP for debugging in Cursor?

Add the server under mcpServers in ~/.cursor/mcp.json, with its url and an Authorization header. Then paste a bug link into the chat and ask the agent to read it and find the cause.

Can I give Claude a bug report without setting up MCP?

Yes. In Laneshot, Ask Claude on a trace opens Claude with a prompt that links to a Markdown report of the capture. It relies on the trace's public link, so MCP is the better choice for private traces or for work inside your repository.