MCP
Dinobase exposes an MCP (Model Context Protocol) server that gives AI agents direct access to your business data through tool calls.
Prerequisites
Section titled “Prerequisites”Before connecting an MCP client, set up Dinobase with your data:
pip install dinobasedinobase initdinobase add stripe --api-key sk_test_...dinobase syncSee Getting Started for a full walkthrough, Connecting Sources for the 100+ supported sources, and Cloud Storage Backend for team/remote setups.
Starting the server
Section titled “Starting the server”dinobase serveThe server uses stdio transport and exposes seven tools: query, list_sources, describe, confirm, confirm_batch, cancel, and refresh.
With background sync
Section titled “With background sync”Keep data fresh while the server runs:
dinobase serve --sync --sync-interval 30mSee Syncing & Scheduling for more sync options.
Installing into your client
Section titled “Installing into your client”The dinobase install command writes the MCP config directly to the right file for your client:
dinobase install claude-code # runs: claude mcp add dinobase -- dinobase servedinobase install claude-desktop # writes to Claude Desktop config filedinobase install cursor # writes .cursor/mcp.json in current directorySafe to run multiple times — it merges the dinobase entry rather than overwriting the whole file.
Client setup guides
Section titled “Client setup guides”- Claude Code — CLI (recommended) or MCP
- Claude Desktop — MCP via
claude_desktop_config.json - Cursor — MCP via
.cursor/mcp.json
Any MCP client
Section titled “Any MCP client”Any client that supports the MCP stdio transport can connect using the same server entry:
{ "command": "dinobase", "args": ["serve"]}If dinobase isn’t on your PATH, use the full Python path:
{ "command": "/path/to/python", "args": ["-m", "dinobase.mcp.server"]}How agents use the tools
Section titled “How agents use the tools”When the MCP server starts, it provides dynamic instructions based on what data is loaded. The agent sees something like:
You have access to a Dinobase database -- business data synced frommultiple sources into a single SQL database (DuckDB dialect).
Connected sources: stripe: customers, subscriptions, charges, invoices (12,450 rows total) hubspot: contacts, companies, deals (8,320 rows total)
How to work with this database:1. Use list_sources to see what data is available2. Use describe on a table to see columns, types, annotations, and sample data3. Use query to run SQL (DuckDB dialect, reference tables as schema.table)Typical agent workflow
Section titled “Typical agent workflow”- Agent calls
list_sourcesto see what’s available - Agent calls
describeon relevant tables to understand columns and types - Agent writes and executes SQL via
query - For mutations (UPDATE/INSERT),
queryreturns a preview — agent callsconfirmto execute
This is the same workflow whether the agent uses MCP or CLI — the data and query engine are identical.
MCP tools reference
Section titled “MCP tools reference”See the full MCP Tools reference for parameter details.
CLI vs MCP
Section titled “CLI vs MCP”Both interfaces use the same query engine and data. The difference:
| MCP | CLI | |
|---|---|---|
| Transport | stdio tool calls | bash commands |
| Best for | Claude Desktop, Cursor | Claude Code, Aider |
| Token efficiency | Standard | 27% fewer tokens |
| Output format | JSON (always) | JSON or --pretty |
For shell-capable agents, the CLI is more token-efficient. For tool-calling agents, MCP is the natural fit.
Next steps
Section titled “Next steps”- Getting Started — Full setup walkthrough
- Connecting Sources — Add your business data
- Querying Data — SQL patterns and cross-source joins
- Syncing & Scheduling — Keep data fresh
- Schema Annotations — Add context for AI agents
- MCP Tools Reference — Detailed tool schemas