Read-only database access for AI agents
With read-only access to TracingDB, an AI agent such as Claude Code can debug against real data instead of guessing from the
code. It can check how far an entity got through a flow, compare tenants' copies of a shared entity, or confirm a hypothesis with
a query.
The agent never sees the credentials. It runs queries through the data source you set up in Rider, and Rider keeps the password in your operating system's credential store.
How it fits together
Azure Key Vault ──(copy once)──▶ Rider data source ──(MCP)──▶ AI agent
read-only JDBC URL password in OS keychain runs SELECT queries
Prerequisites
- JetBrains Rider with the
People.RTMsolution (People.slnx) open. - The Azure CLI or access to the Azure Portal.
- Get permission on secrets in the
people-rtmKey Vault. Ask a team lead if you don't have it. - An MCP-capable agent, for example Claude Code.
Step 1: Get the connection string from Azure Key Vault
The read-only connection string is stored as a JDBC URL for Azure SQL Database, with a login that can only read.
| Setting | Value |
|---|---|
| Vault | people-rtm (https://people-rtm.vault.azure.net/) |
| Secret | ConnectionStrings--TracingDB--ReadOnly--JDBC |
This can also be done in the Azure Portal, with no CLI needed. Go to Key vaults → people-rtm → Secrets → ConnectionStrings--TracingDB--ReadOnly--JDBC, open the current version, click Show Secret Value and copy it.
With the Azure CLI, copy it straight to the clipboard, so it's never printed:
az login
az keyvault secret show \
--vault-name people-rtm \
--name ConnectionStrings--TracingDB--ReadOnly--JDBC \
--query value -o tsv | pbcopy
On Windows replace pbcopy with clip, and on Linux with xclip -selection clipboard.
Never paste the connection string into an AI chat, a file in a repository, or an exported shell variable. Rider is the only place it belongs.
Step 2: Add a read-only data source in Rider
- Open the Database tool window (View → Tool Windows → Database).
- Click + → Data Source from URL, paste the JDBC URL and select the Azure SQL Database driver. If Rider offers to download missing driver files, accept.
- Name the data source
TracingDB (Read only). Agents look for this exact name. - On the General tab, check that the user and password were read from the URL, and set Save to Forever. The password goes to the OS credential store (Keychain on macOS, Credential Manager on Windows).
- On the Options tab, tick Read-only. The login already can't write; this adds a second guard in Rider itself.
- Click Test Connection, then OK.
Step 3: Connect the agent to Rider over MCP
Rider has a built-in MCP server. It lets agents list your data sources and run queries on them with Rider's stored credentials.
- In Rider, open Settings → Tools → MCP Server and tick Enable MCP Server. The page shows the port it listens on.
- Connect your agent:
-
Claude Code: click Auto-Configure next to Claude Code, or register the server by hand:
claude mcp add --transport http rider http://127.0.0.1:<port>/streamPeople.RTMalso ships an.mcp.jsonwith ariderentry, and Claude Code asks you to approve it the first time. The port in that file may not match yours. If it doesn't, register your own server as above rather than editing the shared file. -
Other MCP clients: point them at
http://127.0.0.1:<port>/stream.
-
- Keep Rider open with
People.slnxloaded while the agent works. The MCP server runs inside Rider.
Verify the setup
Ask the agent to list its database connections. It should find TracingDB (Read only), via the list_database_connections
tool, and be able to run a simple query against it, via execute_sql_query.
Good to know
- Queries see every tenant. Filter by
OwnerIdwhen a question is about one tenant. - Results appear in the conversation. Ask for the columns you need (IDs, codes, OmniIds, dates) rather than
SELECT *on tables that hold personal data. - Rider returns at most 10 rows per query to the agent. For anything bigger, aggregate (
COUNT,STRING_AGG) or page. - Purchase orders live in the
FreightUnitstable, markedIsFreightUnit = 0.
Troubleshooting
| Symptom | Fix |
|---|---|
| The agent finds no connections | Rider is closed, has a different solution open, or the MCP server is disabled. |
| The agent can't reach the MCP server | The port changed. Copy the current one from Settings → Tools → MCP Server and register the server again. |
az keyvault secret show is forbidden | You're missing Get permission on the vault's secrets. Ask a team lead for access. |
| Rider asks for the password every time | Set Save to Forever on the data source's General tab. |