Skip to main content
PowerSync DevTools gives coding agents, such as Claude Code or Codex, tools to query your app’s local database, read its sync status, and run sync actions, such as reconnect or clear the local data. The tools are the same on each platform, but the way an agent connects to them depends on your platform.
These tools work with your running app. To let an agent search the PowerSync documentation, use the docs MCP server instead.

Connect a Coding Agent

Nuxt DevTools 3 does not have an MCP endpoint. To use the agent tools in a Nuxt app, use Nuxt DevTools 4.

Tools

These tools are available on the MCP endpoint and in React Native. The MCP endpoint and the Rozenite agent CLI pass the inputs in different ways. For subscribeStream and unsubscribeStream, args is { name, params?, ttl?, priority? }.
query can change data. A write to one of your schema tables goes into the upload queue, and your connector uploads it like a write from your app. action with clearData deletes the local data, including the local changes in the upload queue, and downloads the data again. info returns the current JWT. Give these tools only to agents that you trust.

MCP Endpoint

Vite, Nuxt DevTools 4, Capacitor, and Node.js serve the tools as MCP (Model Context Protocol) tools. On the web, the tools get the database from an open app tab. Keep your app open in a browser that Vite DevTools trusts, or the tools return an error. For a Capacitor app, keep the app running with live reload on a trusted simulator or emulator. For a Node.js app, set a fixed port in enablePowerSyncDiagnostics() so that the endpoint stays the same when your app restarts.

Add the Endpoint to Your Agent

The endpoint accepts only requests that have a loopback Origin header, such as http://localhost:5173. Some MCP clients do not send this header, so add it to the client configuration. For example, to add the Vite endpoint to Claude Code:
If your MCP client cannot send the header, set allowedOrigins: false. Read Origin and Authorization.
Coding agents such as Claude Code can add the server themselves. Start your dev server, open your app, and give the agent a prompt like this one:
Change the URL and the port to match your host. Some agents must restart before they can use a new MCP server.

Pass Tool Arguments

On the MCP endpoint, each tool name has the powersync_ prefix, such as powersync_query. The endpoint also has a powersync_sources tool, which returns the attached databases with their ID and SDK. The tools take positional arguments named arg0 and arg1. The last argument of most tools is the database ID. Pass null to use the first attached database, or call powersync_sources to list the IDs.

Origin and Authorization

To change how the endpoint checks requests, use the mcp setting: Set it in your host:

Test the Endpoint

Use curl to check that the endpoint works. This example counts the operations in the local oplog:
If the response is 403 Forbidden, the request has no loopback Origin header.

React Native

In React Native apps, the usePowerSyncDevTools() hook registers the tools for the Rozenite agent CLI. The tools are in the powersync/diagnostics domain, for example npx rozenite agent powersync/diagnostics status. To use the tools, set up PowerSync DevTools for React Native, and keep the app running with Metro started with WITH_ROZENITE=true. The agent runs the commands from your app’s folder.
Give your coding agent a prompt like this one:
The agent session holds the app’s only debugger connection. Step 4 releases it.
The CLI passes the inputs as named flags, such as --sql. The tools have no database ID and there is no sources tool, because the tools use the database that you pass to the hook.