Skip to main content

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.RTM solution (People.slnx) open.
  • The Azure CLI or access to the Azure Portal.
  • Get permission on secrets in the people-rtm Key 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.

SettingValue
Vaultpeople-rtm (https://people-rtm.vault.azure.net/)
SecretConnectionStrings--TracingDB--ReadOnly--JDBC
note

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.

warning

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​

  1. Open the Database tool window (View → Tool Windows → Database).
  2. 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.
  3. Name the data source TracingDB (Read only). Agents look for this exact name.
  4. 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).
  5. On the Options tab, tick Read-only. The login already can't write; this adds a second guard in Rider itself.
  6. 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.

  1. In Rider, open Settings → Tools → MCP Server and tick Enable MCP Server. The page shows the port it listens on.
  2. 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>/stream

      People.RTM also ships an .mcp.json with a rider entry, 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.

  3. Keep Rider open with People.slnx loaded 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 OwnerId when 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 FreightUnits table, marked IsFreightUnit = 0.

Troubleshooting​

SymptomFix
The agent finds no connectionsRider is closed, has a different solution open, or the MCP server is disabled.
The agent can't reach the MCP serverThe port changed. Copy the current one from Settings → Tools → MCP Server and register the server again.
az keyvault secret show is forbiddenYou're missing Get permission on the vault's secrets. Ask a team lead for access.
Rider asks for the password every timeSet Save to Forever on the data source's General tab.