Debug JavaScript applications using Replay’s time-travel MCP server. Inspect runtime recordings to trace errors, read source code with execution data, evaluate variables, analyze network requests and browser storage, investigate React component renders and state changes, diagnose Playwright test failures, and profile performance.
Codex is OpenAI's coding agent for the terminal. It reads MCP servers from its config and signs in to remote ones with OAuth.
This guide connects Replay MCP to Codex through MewCP, so Codex can use Replay MCP's 33 tools, like ConsoleMessages, Annotations and DescribePoint, without your Replay MCP credentials ever reaching the app.
Your Replay MCP API key is stored encrypted and injected only at call time. Your agent never holds it, so it can never leak it, log it or paste it into a prompt.
More apps
TinyFish MCP for running AI-driven browser automation tasks, deep web research, persistent browser login profiles, remote CDP browser sessions, and agentic wallet payments.
Connect to external APIs, webhooks and internet services through standard HTTP requests. Build integrations with virtually any platform that exposes a web-based interface.
Neon MCP Server lets AI agents manage Neon Postgres databases directly, including creating and branching databases, running SQL queries, managing schemas, inspecting database structure, and working with projects and branches.
Manage deployments, projects, domains and application infrastructure on Vercel. Automate releases, monitor environments and operate modern web applications.
Other clients
Replay MCP works the same way in every client below. Pick yours for its own guide.
Free to start.
Scope access to the exact Replay MCP tools and accounts you allow, work and personal side by side. Anything outside that scope is refused at call time, even when the model asks for it.
Each call is logged: what ran, on which account, and whether it worked. Failures come back structured, so the agent knows whether to retry instead of guessing.
Every app sits behind one secure MCP URL, and there is no server for you to deploy or keep running. Add an integration in the dashboard and it is live on the next call, with no config to change and no new credentials to wire up. Tools load only when a task needs them, so your agent stays fast and focused however many apps you connect.
Run this and approve access in the browser window.
Start a new chat and ask: "List the tools you can use from MewCP." You should see your connected apps.
Show console API messages (console.log, console.warn, console.error, etc.). For runtime exceptions, use UncaughtException and ReactException. mode 'summary' (default): message counts and the last errors/warnings. 'messages': paginated list (filters: level, filterByText, showNodeModules). 'message-detail' with a point reference from 'summary' or 'messages': one message in full, with stack trace.
Inspect the annotations in a recording. Annotations are timestamped records attached by the runtime and integrations (e.g. Cypress, Playwright, React DevTools, network, localStorage). Call with no arguments to list all annotation kinds in the recording with their counts. Pass a 'kind' to return the annotation data for that kind (paginated, optionally filtered by text). For WebSocket traffic (DOMWebSocket annotations), use the WebSocketMessages tool instead.
Describes the application state at a code execution point. Shows the containing function with executed/not-executed annotations, variable values, and timestamps. Use dependencyChain=true to trace the full causal chain back to the origin event. Get execution points from other tools (ConsoleMessages, ReactRenders, ReduxActions, Logpoint, etc.).
Evaluates a JavaScript expression in the replayed page. Modes: - single-point (default): evaluates at `point` and shows the value like a debugger console, with object previews. Defaults to frame scope, so local variables are visible at code execution points. Use for ad-hoc value inspection beyond what DescribePoint shows. - multi-point: evaluates the same expression at up to 50 `points` in one call, running them in parallel. Much faster than calling Evaluate at each point. Defaults to global scope. Results come back as text: strings as-is, anything else as JSON.stringify output, so return plain data. Each result can be up to 1,000,000 characters; results past 400,000 characters in total are marked not returned, so call again with those points. A failure at one point does not affect the others. Large JSON results are shown as an outline; pass `path` to read part of them at every point without evaluating again. Points with identical results are shown together. To get a value as JSON data rather than a preview, use multi-point mode even for one point, with scope: "frame" if the expression reads local variables. The expression must be a single synchronous expression. Wrap statements in an immediately invoked function, e.g. `(() => { const el = document.querySelector('h1'); return el && el.textContent; })()`. Do not use async functions or promises; replay cannot inspect their eventual results. In single-point mode, string results are returned up to maxStringLength characters (default 100000); longer strings end with a truncation notice giving the stringOffset to read the next part. Strings longer than about 8,000 characters are read by evaluating the expression a second time, so use a side-effect-free expression to get the full text. In multi-point mode, `preloads` load a library before the expression runs at each point. Each preload's value is available to the expression as a const with the preload's name. For example, a preload named axe whose expression evaluates the axe-core bundle and returns window.axe lets the expression run axe's rules synchronously and return a summary (axe.run() is async and cannot be awaited). Examples: - { "point": "<point>", "expression": "props.items.length" } - { "mode": "multi-point", "points": ["<p1>", "<p2>", "<p3>"], "expression": "document.title" } - { "mode": "multi-point", "points": ["<p1>", "<p2>"], "expression": "(() => ({ url: location.href, buttons: document.querySelectorAll('button').length }))()" }
Gets the call stack at a code execution point. Use to understand execution context. Pair with DescribePoint for full state.
Gets the React component being rendered at a code execution point.
Get size, layout, ancestry and render point information for a DOM element. Find relevant code before inspecting elements. Only use this tool sparingly — expensive, requires full DOM layout computation. Prefer ReactComponentTree for component structure.
Describe all the accesses made to localStorage. Start with mode 'summary' (default) for a grouped overview: keys with access counts, final values, and timing. Use 'operations' to browse the full chronological access list with pagination. Use keyFilter to narrow by key name (substring match). For large apps, consider filtering by key pattern in results.
Evaluates an expression at breakpoint hits for a given path and line number. Returns up to 20 hits with their expression evaluation results. Use beginPoint/endPoint to narrow the range. Use column to target a specific statement on the line. Find source paths with ListSources or SearchSources first.
Analyze network requests. mode 'summary' (default): counts; failed, no-response and slowest requests with request IDs; status/domain/type/method distributions. 'requests': paginated table (filters: outcome, urlFilter, startTime, endTime). 'detail' with requestId: request/response headers, bodies, event timeline, backend function analysis. 'inFlight' with a point (an error, a render, a click): which HTTP requests had not finished and which WebSocket messages had or had not arrived at the point, for ordering and race bugs.
Inspect the WebSocket connections in a recording and the messages sent and received on them. Default mode 'connections' lists each connection with its URL, status (open, open until the recording ended, still connecting, never connected, failed to connect, dropped, closed by client, closed) and message counts. Mode 'connection' lists the messages on a connection (paginated, filterable by direction and text); sent messages include a point reference for the send() call. Mode 'message' shows the contents of one message by messageId. JSON messages too large to show whole are shown as an outline of keys, types and sizes; pass path (e.g. 'result.items.3') to see one part. Unknown connectionId or messageId values are rejected with the list of valid IDs.
The mounted React component tree at 'point'. A component is one component function, identified by source location; a minified bundle gives many components the same name. Instances are named Fiber:N; ReactRenders takes N as fiberId. Render timing, waste and causes are in ReactRenders.
Analyze React renders. mode 'summary' (default): commit count, component render time, wasted renders, the costliest commits with commitIndex. 'commits': paginated table in time order. 'commit' with commitIndex: one commit's phases, triggers, components, DOM mutations. 'trigger-detail' with commitIndex: the dependency chain (click, network, dispatch) of each trigger. 'waste-rank': components by wasted renders. 'component' with componentName: one component across all commits. 'fiber' with fiberId: all renders of one fiber instance (includeProps=true adds prop values). 'commit-fibers' and 'fiber-cause': fiber-level causation.
Show all user interactions (clicks and key presses) in the recording. Start with mode 'summary' (default): interaction counts by type, time range, first 10 steps (step: one click or a run of consecutive key presses) with target element and Point. Mode 'interactions': paginated chronological list, one row per interaction, with Handler point. Point: for Evaluate or InspectElement. Handler point: for DescribePoint.
Analyze Redux actions in a recording. Currently covers Redux/RTK dispatches via source-level instrumentation. Start with mode 'summary' to see action type frequency and correlation stats. Use 'actions' to browse dispatches chronologically (filterable by actionType substring). Use 'action-detail' with actionIndex for full correlation data: timing breakdown, selector stats, component render timings, and dispatch origin location. Use 'impact' with actionIndex for a render impact report with optimization recommendations. Use 'state-shape' to see a lightweight key/type listing of the state tree (~200–400 tokens). RECOMMENDED: use state-shape FIRST to understand the state structure, then drill in. Use 'action-state' with actionIndex to see actual state values at a dispatch point. STRONGLY RECOMMENDED: use the 'path' param (e.g. path='auth.user') to drill into specific subtrees instead of dumping the entire state tree. Call RecordingOverview first for broader context about the recording.
Analyze Zustand stores in a recording. Start with mode 'summary' to see all stores and their setState call counts. Use 'store-events' with a storeId to browse setState calls chronologically. Use 'store-state' with storeId and eventIndex to inspect the state at a specific setState call (shows the updater identity, incoming changes, merged result, and previous state). Call RecordingOverview first for broader context about the recording.
Analyze TanStack Query (React Query) cache events in a recording. Start with mode 'summary' for an overview of all queries with lifecycle stats. Use 'query-events' with queryHash to see the event timeline for a specific query. Use 'query-timeline' for a chronological view across ALL queries. Use 'query-state' with queryHash + eventIndex to inspect cached data at a specific event point. Observer-internal events are filtered by default; use eventType filter to include them. Call RecordingOverview first for broader context about the recording.
Describe exceptions that caused React to unmount the app, and error boundary catches. The result starts with an unmount status and an error boundary catch count. With no unmount throw site and no catch, a React error in the console is reported with the thrown stack. For non-React uncaught exceptions, use UncaughtException.
Describe uncaught exceptions and unhandled promise rejections (runtime errors not caught by try/catch): up to 5 distinct errors in time order. Each entry gives the throw site and the first non-library caller; when every frame is library code, the error text and the thrown stack instead; when the recording has no matching throw (e.g. script syntax errors), just the error text. For React unmounts and error boundary catches, use ReactException.
Run all deterministic React performance checks: heavy commits (≥16ms), render loops, expensive state updates, and more. Returns summary counts, an index of findings by priority (title, time, id) and the top finding in full. findingId shows one finding in full: user-visible impact, timing, affected components, commitIndex for ReactRenders, page URL, suggested action.
List the sources in the recording.
Read up to 50 lines of code centered around the given line and see what statements executed.
Search the sources in the recording and see which statements executed. By default, library code (node_modules, CDNs, vendor bundles) is skipped; set `includeGenerated: true` to search it. Note: Playwright test runner code runs in Node outside the browser recording and won't appear here. Use PlaywrightSteps(mode: test-source) for Playwright test source.
Computes execution delays for functions based on their source length and the delay before the first breakpoint in each function executes. Each breakpoint is attributed to the innermost function covering it, and each function's weight is computed as its source length minus the sum of its children's lengths.
Generates an app.replay.io link for users to inspect a given execution point.
Lists all screenshot timestamps in the recording, or fetches a screenshot at a given timestamp. Call without timestamp to list all available timestamps. Call with timestamp to get a screenshot URL with mouse position, movements, and time since last click. Set base64=true for raw image data. RecordingOverview suggests a key screenshot timestamp — call that first.
Show all steps taken by Playwright in the recording. Start with mode 'summary' for a test overview with pass/fail status and duration. Use 'steps' with testIndex to see the step list for a specific test (get indices from 'summary'). Use 'step-detail' with stepNumber for inspector protocol commands of a single step (get step numbers from 'steps'). Use 'test-source' with testIndex to read the test source code. For failed tests, use failedOnly=true in 'steps' mode to focus on failures. Call RecordingOverview first for broader context.
Profiles JS statement execution between two points in a recording. Fetches all breakpoint hits between the points, breaks them down by function, resolves function names, and computes a flat profile and call tree showing statement hits per function and its callees.
Profiles the native C++ replay engine using stack sampling between two execution points. Runs the replay engine from the begin point to the end point while collecting periodic stack samples, then analyzes the samples to produce a flat profile of where time is spent in native code.
Profiles dependency graph entry execution between two points in a recording. Enumerates all dependency graph entries including React fiber renders and effect calls, computes the execution associated with each by progress counter differences, traces each entry back to its source via the dependency chain, and groups results by source ordered by execution amount.
Causal graph of the recording's runtime events, as one bounded graph of the region between two vertices. `{}` = the whole recording; `{ to }` = everything which led to a vertex (what caused it, and `path`: why it was late); `{ from }` = everything a vertex led to; `{ from, to }` = what happened between them. A ref is `{ id }` (any vertex id of a result) or `{ point }` (an execution point, a point reference of an earlier result, or `end`: the vertex created there, else the one executing there). Result: `vertices` = the ends and their neighbours, the path's slowest hops and the most important other vertices; `groups` = every other vertex of the region, each in one group; each node's `causes` = its in-edges. To look inside a group, pass its `open` as the next call's params. Field meanings, rules and constants: `{ help: true }`.
Overview of a recording: test results, errors, environment, network activity, React render performance, and suggested next steps with tool names. Call RecordingOverview first. The first call on a cold recording may take 3-4 minutes: set a longer timeout. Subsequent calls are fast.
Starts processing a recording if needed and reports its status. Call this before other tools on a recording that may not be loaded yet. Returns state 'ready' when other tools will respond quickly, 'processing' with phase, progress counts, and an estimated time remaining (eta, may be null) while it is still loading, or 'crashed'/'failed' with an error when the recording cannot be analyzed. Safe to call repeatedly; call again while the state is 'processing'. msSinceLastProgress only indicates a stall in the 'starting' and 'scanning' phases; in 'analyzing' there are no progress updates while the instrument engine runs, so treat eta.exceeded as the sign that something is wrong. The eta is recomputed on every call and can go up, for example when the instrument engine starts; reset any deadline when phase or instrumentEngine.state changes. A crashed or failed server is shut down after a few minutes, and the next call starts a fresh one with a new startedAt; retry at most once since crashes often repeat. When a server replaced an earlier one for the same recording, previousRun says how the earlier one ended; previousRun.unexpected means it died without reporting a crash. That can be the recording (for example running out of memory) or the infrastructure (for example a node reclaimed without warning), so keep waiting on the new server and treat it as a crash only if the next server for the recording also ends unexpectedly. Requests with the x-replay-refuse-after-crash header never start a new server after a crash or unexpected end: they get state 'crashed' with previousRun instead.