Replay MCP
Tools Reference
Complete reference for all Replay MCP tools available to AI agents.
This page documents every tool available through the Replay MCP server. Tools are grouped by category, with typical investigation workflows for each.
Agents discover these tools automatically when connected to the MCP server. You don't need to memorize them — but understanding what's available helps you give better prompts and understand what your agent is doing during an investigation.
Source Code & Console
These tools help agents orient themselves within a recording — browsing files, reading code, viewing output, and seeing what the app looked like visually.
| Tool | Purpose |
|---|---|
| ListSources | List all source files in the recording. Supports glob filtering to narrow results. |
| ReadSource | Read source code centered on a specific line, annotated with which statements actually executed during the recording. |
| SearchSources | Regex search across all source files, with results annotated to show which matches are in code that actually ran. |
| ConsoleMessages | View all console log, warn, and error messages from the recording. |
| Screenshot | List all available screenshot timestamps, or fetch a screenshot at a specific moment showing visual state, mouse position, and recent mouse movements. |
Typical workflow
An agent investigating a bug will often start here: check ConsoleMessages for errors or unexpected output, use SearchSources to find relevant code, then ReadSource to examine it in detail. Screenshot helps correlate code behavior with what the user actually saw on screen. ListSources is useful when the agent needs to discover what files exist in the recording (source paths in recordings can differ from local paths due to source maps and build tools).
Code Inspection
These tools let agents inspect application state at specific moments during execution — examining variables, evaluating expressions, and understanding call paths.
| Tool | Purpose |
|---|---|
| DescribePoint | Describe application state at a specific execution point — variables in scope, code context, and optionally the full dependency chain showing how execution reached that point. |
| Evaluate | Evaluate any JavaScript expression at a specific execution point. Like running code in the DevTools console, but at any moment in the recording. |
| GetStack | Get the call stack at an execution point — see which functions called which to reach that moment. |
| Logpoint | Set a virtual breakpoint at a source location and evaluate an expression at every hit. Returns up to 20 results, letting the agent observe how a value changes across multiple executions of the same code. |
| InspectElement | Get size, layout, DOM ancestry, and render information for a DOM element, identified by CSS selector or element reference. |
Typical workflow
After finding suspicious code with SearchSources, an agent will use Logpoint to see how values change at that location across the recording. When a specific hit looks wrong, it uses DescribePoint to understand the full context, Evaluate to test hypotheses ("what would this expression return here?"), and GetStack to see how execution arrived there. InspectElement is useful for layout or rendering bugs where the agent needs to understand DOM structure.
Error Analysis
Quick ways to find what went wrong.
| Tool | Purpose |
|---|---|
| UncaughtException | Find all uncaught JavaScript exceptions in the recording, with stack traces and execution points. |
| ReactException | Find exceptions that caused React to unmount — error boundary triggers, fatal render errors, and similar React-specific crashes. |
Typical workflow
These are often the first tools an agent reaches for when debugging a crash or error. UncaughtException catches any unhandled errors. ReactException specifically finds errors that broke the React component tree. Both return execution points that the agent can then investigate further with Code Inspection tools.
ReactException only works with recordings of React applications.
Network & Storage
Inspect external communication and client-side data persistence.
| Tool | Purpose |
|---|---|
| NetworkRequest | List all HTTP requests, or get detailed information about a specific request including headers, body, status, and timing. Supports filtering by URL substring and time range. |
| LocalStorage | View all localStorage read and write operations that occurred during the recording. |
Typical workflow
When investigating data-related bugs, an agent checks NetworkRequest to see if API calls returned unexpected data, failed, or were slow. Filtering by URL helps focus on specific endpoints. LocalStorage reveals client-side state persistence issues — stale cached values, missing keys, or unexpected overwrites.
React Analysis
A deep set of tools for understanding React application behavior — from component tree structure down to individual fiber render causes. This is one of Replay MCP's most powerful feature areas.
| Tool | Purpose |
|---|---|
| ReactComponentTree | View the React component hierarchy at any point in the recording. Can focus on a specific component to see its ancestors and descendants. |
| GetPointComponent | Identify which React component was being rendered at a specific execution point. |
| DescribeComponent | Get the full render history of a named component — every time it rendered, what props it had, and what triggered each render. |
| ReactRenders | Multi-mode render analysis tool (see detailed breakdown below). |
| DescribeReactRender | Trace a specific render trigger back through the dependency chain to find the root cause, with component render counts. |
ReactRenders: deep render analysis
ReactRenders is the most feature-rich tool in the MCP server. It supports multiple analysis modes that let agents progressively drill into render behavior:
- Summary mode — a recording-wide overview of render activity. How many commits, which components rendered most, overall render patterns. This is the starting point for any React performance investigation.
- Commits mode — a paginated list of every React commit (batch of renders). Shows what changed in each commit and when it happened.
- Commit detail — drill into a single commit to see exactly which components rendered and why.
- Waste ranking — components ranked by wasted renders (renders that produced no visible DOM changes). This directly identifies performance optimization opportunities.
- Component mode — view a single component's render history across all commits. Shows how a specific component behaved over the entire recording.
- Commit fibers — list all fiber instances of a component within a specific commit. Useful when a component renders multiple times in one commit.
- Fiber cause — the deepest drill level. Shows exactly why a specific fiber instance re-rendered — which prop changed, which state update fired, which context value shifted.
A typical React performance investigation flows: summary → waste ranking → pick a component → component mode → pick a commit → commit fibers → fiber cause to find the root trigger.
All modes support time and execution point range filtering, so agents can focus on specific parts of the recording.
Typical workflow
For debugging React issues, agents start with ReactComponentTree to understand the app structure, then use ReactRenders in summary mode to get the big picture. For render bugs, DescribeComponent shows a specific component's full history. For performance work, the waste-rank → fiber-cause drill-down path in ReactRenders is the most direct route to finding unnecessary re-renders. DescribeReactRender traces a specific render trigger back to its origin — useful when the cause of a re-render isn't obvious.
All React tools require the recording to contain a React application. The agent will receive an error if it tries to use these on a non-React recording.
Test Analysis
Tools for investigating Playwright test recordings.
| Tool | Purpose |
|---|---|
| PlaywrightSteps | List all steps from a Playwright test with timestamps, stack traces, and error information. Optionally drill into a specific step to see the inspector protocol commands that were executed. |
Typical workflow
When debugging a failed Playwright test, the agent uses PlaywrightSteps to find which step failed and what error occurred. It can then drill into that step's protocol commands, use Screenshot to see the visual state at the failure, and switch to Code Inspection tools to understand why the expected element or condition wasn't met.
PlaywrightSteps only works with recordings created from Playwright test runs.
Performance Profiling
Tools for understanding where execution time is spent.
| Tool | Purpose |
|---|---|
| ProfileStatements | Profile JavaScript statement execution between two points. Produces a flat profile and call tree showing statement hit counts per function — which code paths ran the most. |
| ProfileGraph | Profile dependency graph entries (React fiber renders, effect calls) between two points. Groups results by source and ranks by execution amount — shows what React work dominated execution. |
| ExecutionDelay | Analyze per-function execution delays in a source file. Computes how long each function took based on source length and breakpoint timing. |
| ProfileSampling | Low-level native engine stack sampling. This profiles the Replay runtime itself, not the recorded application — primarily useful for internal debugging of replay performance. |
Typical workflow
For JavaScript performance issues, ProfileStatements identifies hot code paths — functions that executed the most statements. ProfileGraph is specifically valuable for React apps, showing which renders and effects consumed the most execution. ExecutionDelay gives a per-function view within a specific file. These tools accept optional begin/end execution points to focus on a specific time range rather than the entire recording.
Utility
| Tool | Purpose |
|---|---|
| GetPointLink | Generate a shareable app.replay.io URL for a specific execution point. Useful for creating links that others can open in Replay DevTools to see the exact moment the agent is investigating. |