Readyset Docs

Claude Code

Add RDST to Claude Code so it can find slow queries, run analyze, deploy caches, and read audit snapshots for you.

Run rdst claude to register RDST's MCP tools with Claude Code. The tools can find queries, analyze SQL, deploy caches, and read audit snapshots.

The integration registers your installed RDST binary. It doesn't expose the RDST Agent Inbox or nightly reports. Audit tools read one-off audit snapshots.

Add RDST to Claude Code

Make sure RDST is installed and rdst version works.

Register RDST with Claude Code:

rdst claude

This updates Claude Code's local config so it knows how to call your installed rdst binary. Everything stays on your machine.

Restart Claude Code (or open a new session). The RDST tools will appear in the tool list.

When the RDST desktop app or rdst web is running, rdst claude registers that app's local MCP endpoint over HTTP instead, with its bearer token. Those tools add, test and monitor databases and read the Inbox, actions and reports from the running app. Its address and token change when the app restarts, so run rdst claude again after a restart. See Connect with Claude Code or any coding agent. The rest of this page covers the CLI's own tools, registered when no app is running.

To remove the integration later:

rdst claude remove

What Claude Code can do with RDST

Once registered, Claude Code has tool access to the core RDST workflows:

ToolWhat Claude can do
rdst_configure_list / rdst_configure_addInspect or add database targets
rdst_test_connectionVerify a target is reachable
rdst_topFind the slowest queries (real-time or historical)
rdst_query_list / rdst_query_add / rdst_query_deleteManage saved queries
rdst_analyzeAnalyze a query by hash, name, or inline SQL
rdst_schemaInspect the semantic layer
rdst_auditRun a single-target audit
rdst_audit_list / rdst_audit_showBrowse past audit snapshots
rdst_fleet_list / rdst_fleet_statusList and check the fleet
rdst_fleet_auditRun a fleet-wide audit
rdst_fleet_snapshots / rdst_fleet_diffBrowse and compare fleet snapshots
rdst_cache_deploy / rdst_cache_add / rdst_cache_show / rdst_cache_deleteDeploy Readyset and manage caches
rdst_agent_list / rdst_agent_create / rdst_agent_askManage data agents
rdst_helpLook up RDST documentation

Review Claude Code's configured tool permissions before using database or cache-management tools.

Typical patterns

Investigate a slow endpoint

Our /orders/recent endpoint has gotten slow over the last week. Find the top queries on the prod-orders target, identify the ones that look like they correspond to that endpoint, and tell me which ones RDST thinks should go through a Readyset cache.

Claude will call rdst_top, filter the output, follow up with rdst_analyze on the top candidates, and summarize the results.

Review an audit snapshot

Look at the most recent audit snapshot for prod-orders. Which recommended indexes would have the biggest impact if I shipped them today?

Claude calls rdst_audit_list to find the latest, then rdst_audit_show to read the stored recommendations.

Deploy a cache

I ran rdst audit on prod-orders earlier. Walk through the top Readyset candidate: analyze it in depth, deploy Readyset, add the cache, and run a cache-compare to show me the impact.

Claude can read the audit, analyze the query, deploy Readyset, and add the cache. The benchmark uses a separate temporary sandbox. Configure permissions for deployment and cache changes before running them.

Generate SQL from a product question

What does our status = 3 mean for orders? Check the semantic layer via rdst_schema: my guess is "shipped".

rdst_ask isn't exposed as an MCP tool. Use rdst_schema to inspect schema context, then review generated SQL with rdst_analyze. For interactive clarification, use rdst ask.

MCP tools vs a dedicated data agent

With rdst claude, Claude Code can configure database targets and analyze queries. It can also run audits and manage caches.

For giving a different audience (a teammate, a non-engineer, an external client) scoped, guarded access, use a data agent with rdst agent mcp --name <agent> instead. That exposes a single, policy-checked interface rather than the whole toolset.

Security considerations

  • Everything runs locally. RDST inherits your shell environment and uses the same configured targets, password environment variables, and LLM API key you would use from the CLI. No data crosses the network except your normal database connection and LLM API calls.
  • Claude Code requires your approval before each tool call by default. Review your Claude Code tool permissions if you want to tighten or loosen this.
  • Tool calls return the same structured analysis output the CLI produces, never raw row data.
  • Configure approval rules for actions that deploy Readyset, add caches, or modify guards.

Troubleshooting

SymptomLikely causeFix
RDST tools don't appearClaude Code wasn't restarted after rdst claudeQuit and relaunch Claude Code
Tools appear but do nothingrdst binary on PATH differs between your shell and Claude CodeRe-run rdst claude from the same shell you launch Claude Code from
Tools fail with Authentication failedPassword env var isn't set in Claude Code's shellSet the env var in your shell profile, then relaunch Claude Code
Tools fail with LLM timeoutANTHROPIC_API_KEY missing in Claude Code's environmentCheck the saved AI provider, account sign-in, and key in Claude Code's environment
rdst claude reports success but tools still missingMultiple Claude installations; config was written to the wrong oneRe-run rdst claude from inside the terminal session you launch Claude Code from

See also