mcpdata Request an invite

Answers / Get data into your AI

How do I give an AI assistant access to millions of rows of data?

Recipe verified on Ran on the public demo (read-only)
Short answer

Put the data in a database and connect your assistant to it over MCP. The assistant then lists the tables, reads their columns, and sends queries that run over all the rows, so 10 million rows are as easy as 10: only the answer, a few rows, comes back into the chat.

Steps

  1. Connect your assistant to the public demo. It's a read-only instance with 10 million synthetic orders, so you can try this before you have your own. In Claude Code:
    claude mcp add --transport http mcpdata-demo https://demo.mcpdata.org/mcp --header "Authorization: Bearer cdb_live_PkVoldus8qcE-hqffjajNZzQwiA7rTHMoR4RLSAxsCE"

    The key is public on purpose: it can only read the demo's sample data. For Claude Desktop, Cursor and other apps, see Connect your AI.

  2. Ask your question. Give your AI this prompt:
    Using mcpdata, how many orders are in Demo.Orders, and what is the total revenue per year?
What your AI does: the tool calls it makes for this prompt, and what came back
describe_table(table_name="Demo.Orders") → 15 columns, 10,005,000 rows
query(table_name="Demo.Orders", group_by=["order_year"], agg=[{"func": "count", "column": "order_id", "alias": "orders"}, {"func": "sum", "column": "revenue", "alias": "revenue"}], sort=[{"column": "order_year", "desc": false}]) → 3 rows
What you should get · the recipe's real result from its last run
order_yearordersrevenue
20232,824,2101,513,915,248
20243,339,8531,789,833,731
20253,840,9372,060,541,940

Synthetic data: the demo's orders are generated, not real customers.

The assistant needs mcpdata connected (step 1) to run the query.

Why this works

Millions of rows don't fit in any context window, and they don't need to. With MCP the assistant gets tools (list_tables, describe_table, query), and the database does the counting and summing. Results come back capped and say when they were cut short, so the assistant knows to aggregate instead of reading raw rows.

Related questions