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 claudeThis 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 removeWhat Claude Code can do with RDST
Once registered, Claude Code has tool access to the core RDST workflows:
| Tool | What Claude can do |
|---|---|
rdst_configure_list / rdst_configure_add | Inspect or add database targets |
rdst_test_connection | Verify a target is reachable |
rdst_top | Find the slowest queries (real-time or historical) |
rdst_query_list / rdst_query_add / rdst_query_delete | Manage saved queries |
rdst_analyze | Analyze a query by hash, name, or inline SQL |
rdst_schema | Inspect the semantic layer |
rdst_audit | Run a single-target audit |
rdst_audit_list / rdst_audit_show | Browse past audit snapshots |
rdst_fleet_list / rdst_fleet_status | List and check the fleet |
rdst_fleet_audit | Run a fleet-wide audit |
rdst_fleet_snapshots / rdst_fleet_diff | Browse and compare fleet snapshots |
rdst_cache_deploy / rdst_cache_add / rdst_cache_show / rdst_cache_delete | Deploy Readyset and manage caches |
rdst_agent_list / rdst_agent_create / rdst_agent_ask | Manage data agents |
rdst_help | Look 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/recentendpoint has gotten slow over the last week. Find the top queries on theprod-orderstarget, 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 auditonprod-ordersearlier. 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 = 3mean for orders? Check the semantic layer viardst_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
| Symptom | Likely cause | Fix |
|---|---|---|
| RDST tools don't appear | Claude Code wasn't restarted after rdst claude | Quit and relaunch Claude Code |
| Tools appear but do nothing | rdst binary on PATH differs between your shell and Claude Code | Re-run rdst claude from the same shell you launch Claude Code from |
Tools fail with Authentication failed | Password env var isn't set in Claude Code's shell | Set the env var in your shell profile, then relaunch Claude Code |
Tools fail with LLM timeout | ANTHROPIC_API_KEY missing in Claude Code's environment | Check the saved AI provider, account sign-in, and key in Claude Code's environment |
rdst claude reports success but tools still missing | Multiple Claude installations; config was written to the wrong one | Re-run rdst claude from inside the terminal session you launch Claude Code from |
See also
- Data Agents: for scoped, guarded access patterns vs. full toolset exposure
- Slack integration: the Slack equivalent for non-Claude users