Examples

Connect an MCP client and query your data

Attach Claude Code (or any MCP client) to the tenant MCP endpoint and run read-only SQL against a dataset you own.

Goal

Connect an external MCP client to your Redgold datasets and run a read-only query, without writing any integration code.

Prerequisites

  • An sk-rg- key in REDGOLD_API_KEY (see Create an API key).
  • An MCP client that speaks streamable HTTP (Claude Code is used below).
  • At least one dataset owned by your account.
The tenant MCP endpoint is a preview surface. Confirm availability for your account before wiring it into an automation.

Steps

Add the server to Claude Code, sending the key as a bearer header:

claude mcp add --transport http redgold https://api.redgold.ai/api/mcp \
  --header "Authorization: Bearer $REDGOLD_API_KEY"

Or add it to .mcp.json directly:

{
  "mcpServers": {
    "redgold": {
      "type": "http",
      "url": "https://api.redgold.ai/api/mcp",
      "headers": { "Authorization": "Bearer sk-rg-..." }
    }
  }
}

Every tool call is scoped server-side to the account behind the key. List your datasets with list_storage_datasets, inspect columns with query_schema, then run read-only SQL with query_data. In the tenant profile query_data requires a dataset argument — it never falls back to "the first loaded dataset", so a query can only touch data you own:

{
  "jsonrpc": "2.0", "id": 2, "method": "tools/call",
  "params": {
    "name": "query_data",
    "arguments": { "dataset": "tenant/acme/prices", "sql": "SELECT symbol, close FROM prices ORDER BY ts DESC LIMIT 5" }
  }
}

Expected output

The result comes back as MCP text content:

{ "jsonrpc": "2.0", "id": 2, "result": { "content": [ { "type": "text", "text": "<query result rows>" } ] } }

When it breaks

  • A JSON-RPC error unauthenticated: no verified caller — the key did not resolve to an account. Confirm the Authorization: Bearer header carries a valid sk-rg- key.
  • Error: dataset '...' is not owned by the caller — the dataset argument names a dataset outside your namespace. Use one from list_storage_datasets.

Source

MCP server.

Copyright © 2026