Query Hong Kong Data with AI Agents via MCP
Jason DeRise recently argued that data companies face a stark choice: embed into AI workflows or get bypassed. His thesis is simple — as AI agents become the primary interface for analysis, data that isn't accessible to those agents might as well not exist.
We agree. The shift isn't from dashboards to chat. It's from data-as-files to data-as-context. When an analyst asks Claude to "compare Group 1 race winners by trainer over the last two seasons," the value isn't in downloading a CSV and writing pandas code. It's in the agent querying the data directly, reasoning over it, and producing an answer in seconds.
Renavon's Hong Kong datasets — horse racing, company registries, and more — are already structured for this. Every subscriber gets isolated, query-ready databases on MotherDuck. All that was missing was a bridge between those databases and AI agents. That bridge is MCP.
What is MCP?¶
The Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools — databases, APIs, file systems — through a unified interface. Instead of copy-pasting data into a prompt, you give your agent a connection to the data. It can then explore schemas, write queries, and pull exactly what it needs.
MotherDuck maintains an open-source MCP server that exposes any MotherDuck database to MCP-compatible clients. Since Renavon datasets live on MotherDuck, this works out of the box — no custom integration needed.
Setup Guide¶
Prerequisites¶
- A Renavon subscription with an API key (sign up here)
- An MCP-compatible client: Claude Desktop, Cursor, VS Code with Copilot, or Claude Code
Step 1: Get Your Session Token¶
You need a MotherDuck session token to authenticate. You can get one from the Connect page or via the API:
curl -X POST https://renavon.com/api/v1/session-token \
-H "X-API-KEY: your_api_key_here"
The response includes your token and connection string:
{
"token": "eyJ...",
"expires_at": "2026-03-07T12:15:00Z",
"expires_in_seconds": 900,
"databases": ["renavon_hkjc_races", "renavon_hkjc_horses"],
"connection_string": "md:?motherduck_token=eyJ..."
}
Tokens expire after 15 minutes. For long sessions, you can refresh by calling the endpoint again.
Step 2: Configure Your MCP Client¶
Claude Desktop¶
Add this to your Claude Desktop config file (claude_desktop_config.json):
{
"mcpServers": {
"renavon": {
"command": "uvx",
"args": ["mcp-server-motherduck"],
"env": {
"motherduck_token": "YOUR_TOKEN_HERE"
}
}
}
}
Config file location:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
Cursor / VS Code¶
Add to your .cursor/mcp.json or VS Code MCP settings:
{
"mcpServers": {
"renavon": {
"command": "uvx",
"args": ["mcp-server-motherduck"],
"env": {
"motherduck_token": "YOUR_TOKEN_HERE"
}
}
}
}
Claude Code (CLI)¶
claude mcp add renavon -- uvx mcp-server-motherduck
Then set your token as an environment variable:
export motherduck_token="YOUR_TOKEN_HERE"
Step 3: Query Your Data¶
Once connected, your AI agent can explore and query your Renavon databases directly. No SQL knowledge required — just ask questions in plain language.
What You Can Ask¶
Here are examples of questions your AI agent can answer by querying Renavon data:
Horse Racing - "Show me all Group 1 race winners trained by John Size in the last 2 seasons" - "Which horses have the best win rate at Sha Tin over 1200m?" - "Compare the average finishing positions of horses sired by Golden Slipper winners"
Company Registry - "How many new companies were registered in Hong Kong last month?" - "Compare company registration trends by industry sector over the past 3 years"
The agent will inspect your available databases, write appropriate SQL queries, execute them, and present the results — all within the conversation.
What's Next¶
This is just the beginning. We're working on enriching the agent experience with a semantic catalog — column descriptions, data dictionaries, and relationship metadata — so agents can understand your data without you having to explain the schema.
For now, the setup above gets you from zero to querying Hong Kong data with AI in under 5 minutes. Head to the Connect page to get started.