by Metabase
Query tables and metrics
Runs a query against a table or saved metric through the semantic layer and returns the results.
Description
The API returns at most 200 rows per request, with a `continuation_token` to pass back for the next page.
query-metrics.md
Query tables and metrics
Runs a query against a table or saved metric through the semantic layer and returns the results.
The API returns at most 200 rows per request, with a continuation_token to pass back for the next page.
Set up
Use the first option your agent supports.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "metabase": { "url": "https://{your-metabase-url}/api/metabase-mcp" } } }
Call the MCP tool query.
Server URL: https://{your-metabase-url}/api/metabase-mcp
API (official)
- Base URL: https://{your-metabase-url}
- Endpoint:
POST /api/agent/v1/query - Auth: send the header
X-API-Key: $METABASE_API_KEY - Docs: https://www.metabase.com/docs/latest/ai/agent-api
Before doing anything else, make one read-only call to confirm access.
Rules
- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
Built from these files in the repository
The layout and the rules come from lib/catalog/render-markdown.ts, the set-up wording from lib/catalog/render-access.ts.