Docs Β· the agent sidecar
Set up TinyPivot in a minute.
One command adds TinyPivot to every AI agent on your machine. From then on, ask a data question and your agent answers with checked numbers, a chart, and the SQL behind it. Use any data your agent can reach, from spreadsheets to Snowflake; the model sees results, not your raw rows.
Quick start
npx @smallwebco/tinypivot-mcp@latest initDetects Claude Code, Claude Desktop, Cursor, Antigravity, OpenCode, Codex and pi.
- Run the command above.
- Restart your harness so it picks up the new MCP server.
- Ask:
Open TinyPivot and show me sample revenue by region.
Then try it on one of your own files.
Setup by harness
Prefer to edit config files yourself? Pick your harness.
Claude Code, OpenCode, pi, Codex
Chart and pivot cards in the terminal. The first data step opens TinyPivot Studio in your browser.
# Wire every harness it finds:
npx @smallwebco/tinypivot-mcp@latest init
# Or add it to Claude Code by hand:
claude mcp add tinypivot -- npx -y @smallwebco/tinypivot-mcp@latestClaude Desktop
Inline interactive charts and pivots in the chat. Restart Claude Desktop after saving.
{
"mcpServers": {
"tinypivot": {
"command": "npx",
"args": [
"-y",
"@smallwebco/tinypivot-mcp@latest"
]
}
}
}Cursor
Agents can open CSVs, JSON logs or SQL exports as charts and pivots.
{
"mcpServers": {
"tinypivot": {
"command": "npx",
"args": [
"-y",
"@smallwebco/tinypivot-mcp@latest"
]
}
}
}Antigravity
Side pane, sidebar view and inline widgets in chat.
{
"mcpServers": {
"tinypivot": {
"command": "npx",
"args": [
"-y",
"@smallwebco/tinypivot-mcp@latest"
],
"env": {
"TINYPIVOT_LICENSE_KEY": "optional-pro-key"
}
}
}
}Antigravity CLI
Terminal chart and pivot cards in agy. It keeps its own server list, separate from the IDE.
npx @smallwebco/tinypivot-mcp@latest init --targets=antigravity-cli
# Or add it by hand:
agy mcp add tinypivot -- npx -y @smallwebco/tinypivot-mcp@latestDirect warehouses
Read-only SQL that runs in Snowflake, BigQuery, Databricks, ClickHouse, MySQL or Postgres (included in Free), so totals cover every row. init --connect reuses the sign-ins your warehouse tools already keep (gcloud, the Snowflake and Databricks CLIs, ~/.my.cnf, clickhouse client) and saves only a pointer to them, never a password.
# Find warehouse sign-ins on this machine and switch them on:
npx @smallwebco/tinypivot-mcp@latest init --connect
# Or choose which ones:
npx @smallwebco/tinypivot-mcp@latest init --connect=bigquery,snowflakeDirect Postgres
Read-only connector with SQL validation and a table allowlist (included in Free). Any other source works by handing TinyPivot an export or rows from its own MCP server.
{
"mcpServers": {
"tinypivot": {
"command": "npx",
"args": [
"-y",
"@smallwebco/tinypivot-mcp@latest"
],
"env": {
"DATABASE_URL": "postgresql://readonly:pass@localhost:5432/analytics",
"TINYPIVOT_ALLOWED_TABLES": "orders,customers,products"
}
}
}
}Prompts to try
Why not just paste the data into chat?
Pasting works for a few rows. For real files and questions that matter, you want the numbers computed exactly, checked, and kept on your machine.
- Works where you work
- Terminal agents (Claude Code, pi, OpenCode, Codex CLI), editors (Cursor, Antigravity) and chat apps that show MCP views. Chat artifacts do not exist in a terminal.
- Raw rows stay on your machine
- load_file and query read local files with DuckDB. The model gets the schema, a profile and the result: in our Claude Code recording, about 540 tokens for a 44,714-row file.
- Exact numbers
- Sums, averages, medians and shares come from the TinyPivot engine, not from the model doing arithmetic.
- Exploring costs no tokens
- Dragging pivot fields, filtering, switching charts and running your own SQL happen in the Studio on your machine, not in another prompt. Pro adds drill-through to the rows behind a cell and formatted .xlsx export.
- Every step reproducible
- Each step keeps its reason and its exact SQL. Rerun it, edit it, or reopen any pull from the last 30 days without querying again.
- Answers checked against the data
- Each number in the agent's answer is looked up in the data the question used, and Check this answer reruns every step. See Checking answers below.
- Charts that follow good practice
- TinyPivot tells the agent when a chart has too many colours, slices too close to compare, missing months or too many bars, so it can fix the chart before you see it.
TinyPivot Studio
In a terminal agent, the first TinyPivot step opens the Studio at http://127.0.0.1:47317. A Studio tab left open from an earlier session reconnects instead. Need headless mode for CI, SSH, or benchmarks? Pass --no-studio (or set TINYPIVOT_NO_STUDIO=1) to disable the Studio server completely (zero ports bound, zero browser popups), or pass --no-open (TINYPIVOT_OPEN_STUDIO=0 / TINYPIVOT_NO_OPEN=1) to keep the Studio URL available without auto-opening a tab.
- Questions. Each question you ask, with every step that answered it: the source, the SQL, the rows, the chart and the agent's answer. Each step carries the agent's reason (the
whyit passes on every data tool); Rows and Chart show the data as it was right after that step. - SQL workbench. Edit a step's SQL, or start from the SQL behind any loaded table, with completion for tables, columns and DuckDB functions. It runs read-only with DuckDB on your machine, and the result becomes your own step, keeping the step's chart when its fields still exist. SQL is laid out by SQLFluff when it is installed (
uv tool install sqlfluff), and by a built-in formatter otherwise. - Messages. Write what to check or change, drop in files or images, and attach the current view. In pi, in OpenCode (with the plugin
initinstalls) and in Claude Code started with--dangerously-load-development-channels server:tinypivot, the message starts a turn at once and the answer comes back to the Studio. In other agents the message box says how to ask from the terminal instead. - Dashboard filters. Ask for a dashboard you can filter by some columns, and a filter bar appears above the grid, pivot and chart.
- History. Every table the agent pulled, kept on your machine for 30 days, reopened without running the query again.
- Your layout. The theme you pick applies to the Studio, the charts and the terminal cards, and is remembered. Drag the bar between the questions and the chart to resize them. Stop shuts the Studio down; it also stops after two idle minutes with no page open.
The Studio answers only this machine, on its own address, and accepts changes only from its own page.
Checking answers
The agent writes the answer; TinyPivot checks it. Every check runs in DuckDB and the Studio on your machine, so it costs no tokens, and the agent cannot write or skip it.
- Numbers in the answer. Each figure the agent quotes ($17.12M, 35.5%, +$7.93M) is looked up in the data the question used, at the precision the agent wrote it: 1.20M covers 1,195,000 to 1,205,000. A figure counts as found when it is a value, a total, a group total or a share of what the chart or pivot shows, or a gap or change between periods in a small summary table. Found figures are underlined in green; figures the data does not hold are marked.
- Check this answer. Reruns every step of the question. A file load checks that the file is the one the agent read (same size and modification time); a SQL step runs its query again and compares the result, row by row regardless of order, with what the agent got.
- Left alone on purpose. Years, dates, links, code, and small counts like "4 regions" are not checked. A growth rate the data cannot show directly is marked unchecked rather than wrong.
Separately, every query is checked for the quiet mistakes that return a believable but wrong number: joins that double-count, averages of percentages, half-finished periods, rows silently dropped by missing values, and extreme outliers. Free runs the basic checks; Pro adds the deep ones. See how much that changes accuracy β
Tools
open_tinypivotOpen the Studio- Opens the Chart / Pivot / Data view. With no arguments it loads sample data.
load_fileLocal files & Excel- Loads a CSV, TSV, JSON, JSONL or Excel (.xlsx, optional sheet) file, including exports from BigQuery, Snowflake, MySQL, DuckDB or Databricks. Rows stay out of context and loaded .xlsx sheets can be queried immediately with DuckDB SQL.
load_dataRows from other tools- Takes JSON rows from Stripe, GitHub, an API or another SQL MCP server and renders a chart and pivot.
configure_pivotExact pivots- Sums, averages, medians and totals computed by TinyPivot, not by the model.
configure_chartChart types- Bar, stacked bar, line, area, pie, donut, scatter, bubble, heatmap and radar, plus maps of countries, US states or sales regions, bullet (actual against target), slope, treemap, sunburst and radial charts. Ask for a dashboard and it adds filter controls above every view.
querySQL over files- Read-only DuckDB SQL (single sql or queries[] batching up to 6 SELECTs) over CSV, Parquet and JSON files and loaded datasets. Named queries persist as DuckDB views across turns while keeping raw rows out of context.
profileDataset, folder or warehouse- Profiles a loaded dataset, scans a local folder (dirPath), or profiles a connected warehouse in 1 call (0-scan schemas + BM25 query search on Free; 1-pass deep trap probes for join fan-out, NULLs, mixed currencies and partial months on Pro).
analyze1-call Data Science- Deterministic statistical shelf on datasetId, filePath, or direct warehouse + table (SQL-pushed sufficient statistics): explain_change and ab_test on Free; SRM + Holm-Bonferroni, controlled regression, right-censored cohorts, and seasonal anomalies on Pro.
historyEvery pull, kept- Lists earlier pulls and reopens any of them without re-querying. Saved locally for 30 days.
query_bigqueryBigQuery- Read-only GoogleSQL run in BigQuery: dry-run checked, capped by bytes scanned, optionally limited to listed datasets.
query_snowflakeSnowflake- Read-only SQL run in Snowflake after its query plan is checked for writes, capped by bytes scanned and a 60-second timeout.
query_databricksDatabricks- Read-only Databricks SQL, refused if its EXPLAIN plan holds any write step, with a 60-second timeout.
query_clickhouseClickHouse- Read-only SQL with ClickHouse enforcing readonly mode, a read cap and a time limit on every query.
query_mysqlMySQL & MariaDB- One SELECT inside a server-enforced read-only transaction with a statement time limit.
query_postgresPostgres- Read-only, validated SQL against an allowlisted Postgres database.
Token savings, measured & modelled.
Measured in Claude Code on a 44,714-row dataset, TinyPivot cost 15% less than writing Python (10% less on the small file) with every figure verified, while pasting rows cost ~2Γ more and got 1 of 3 right. Across 5 models and 18 analysis tasks, TinyPivot Pro took accuracy from 91% to 100%, answered the hardest statistics questions 2.1Γ faster, and its memory cut repeat schema tokens by 47%. See the full results β
| Setup | 1,290 rows | 44,714 rows | Right |
|---|---|---|---|
| Read the rows | 10.7Β’ | too big | 1/3 |
| Agent writes Python | 6.0Β’ | 6.6Β’ | 3/3 |
| TinyPivot | 5.4Β’ | 5.6Β’ | 3/3 |
| Tokens | Pasting | TinyPivot |
|---|---|---|
| 2,000 rows pasted into context | 60,000 | |
| 5 follow-ups re-read them (cached) | 30,000 | |
| 5 tables rewritten by the model | 3,000 | |
| 6 TinyPivot replies, re-read (cached) | 4,125 | |
| chart cards reprinted by the model | 2,400 | |
| Total | 93,000 | 6,525 |
Move the sliders below to model what you avoid sending when raw rows stay in local DuckDB instead of entering context:
- Tokens saved / analysis
- 109k
- Saved / month Β· Claude Sonnet 5.5
- $19
- Analyses / month
- 87
Monthly savings by modelβ Pro $12.42/mo ($149/yr)
Does Pro pay for itself? Β· Claude Sonnet 5.5
Assumes ~5 tokens per cell, cached re-reads billed at 10% of input price, and ~600 output tokens per rewritten table. With TinyPivot, every question is a tool call whose reply adds ~550 tokens (measured on a 2,000-row, 6-column file), and in a terminal the model reprints the card, ~400 output tokens per answer. If you already aggregate down to a handful of rows in SQL before the model sees them, there is little or nothing to save.
When to upgrade to Pro
Free has no row or time limit, so use it on your real work first. Upgrade when:
- The answer will be acted on. Proβs deep checks catch double-counting joins, half-finished periods, dropped missing values and outliers before the agent answers.
- You need real statistics. Trustworthy A/B tests, regressions that control for other factors, cohort retention and seasonal anomalies, each in one step.
- You come back to the same data. Pro remembers your data between sessions, cutting repeat schema tokens by 47%.
- You share the results or dig deeper. Formatted Excel and white-label HTML exports, drill-through to the rows behind any cell, and 1-call deep warehouse trap profiling.
Privacy
Rows, column names, SQL and file paths never leave your machine. The MCP server sends a small anonymous usage ping (tool name, row-count bucket, harness name, OS and a random local ID). Turn it off with TINYPIVOT_TELEMETRY=0 or DO_NOT_TRACK=1.