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:
| Context | What it gives the agent | What a summary says instead |
|---|---|---|
| Console errors | The exact message and stack trace, pointing at a file and function | "There was an error" |
| Network requests | Method, URL, status code, and request and response bodies | "The payment failed" |
| User actions | The order of clicks, form changes, and navigations, which can become a test | "I tried to pay" |
| Environment | Browser and version, viewport, language, and time zone | "On my laptop" |
| App metadata | The release, feature flags, and signed-in user | Usually nothing |
| Backend trace | The server span that failed, its exception, and the logs around it | Nothing: 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/mcpIt uses the Streamable HTTP transport and authenticates with a personal API token.
Create a token
- Open Account settings from the menu at the bottom of the sidebar.
- 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.
- Select Create token, then copy the token, or the ready-made
claude mcp addcommand. The token starts withlsh_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 tool | What it returns |
|---|---|
read_trace | The 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_trace | Metadata: title, description, kind, start time, duration, problem counts, and environment. |
get_console_logs | Console messages and uncaught exceptions, with stack traces. Takes errorsOnly and limit. |
get_network_requests | Requests with method, URL, status, timing, redacted headers and bodies, and backend trace IDs. Takes failedOnly, urlContains, includeAssets, and limit. |
get_user_actions | The person's clicks, navigation, and page events. |
get_transcript | The timed transcript of the voice-over, or a note when there's none. |
get_backend | Spans, errors, and logs from the project's backend connections, such as OpenTelemetry, Sentry, or Datadog. |
| Account tool | What it does |
|---|---|
list_projects | Lists the projects you can access, with their ID, key, and name. |
search_cards | Finds cards in a project by title or number. |
get_card | Returns a card, such as SHOP-12, with its description, type, priority, column, assignee, labels, dates, custom fields, linked issues, comments, and traces. |
create_card | Creates a card from a project key and a title, with optional description, type, priority, column, assignee, labels, dates, and fields. |
update_card | Changes only the fields you send, such as the column, assignee, priority, or description. |
move_card | Moves a card to another project. The old reference keeps working. |
list_issue_repositories | The GitHub repositories a project's cards can be filed in. |
create_github_issue | Files 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_traces | Your most recent captures, newest first, with their problem counts. |
list_automations | A project's automations, their trigger, and whether they're on. |
run_automation | Runs 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, thenget_console_logswitherrorsOnly, thenget_network_requestswithfailedOnly, thenget_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, andrun_automationneed permission to edit cards, andcreate_github_issueneeds 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
AuthorizationandCookie, query parameters with sensitive names, and JSON or form fields such aspasswordorcard_numberbecome[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_backendworks 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.jsonthat 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.