Metabase — Claude Code MCP server: what it does, how to install
Connects AI assistants directly to a Metabase instance to search catalog items, execute SQL queries, and build charts under user permissions.
Open on GitHubWhat Metabase does
Metabase runs an internal MCP server over the Streamable HTTP transport at /api/metabase-mcp. It exposes the platform's Agent API so clients can browse collections, inspect metadata catalogs, run saved questions, and visualize query results.
Authentication relies on an embedded OAuth 2.0 server without external identity providers. Standard session cookies and API keys fail with HTTP 401 because MCP routes ignore them entirely. Access tokens enforce strict scopes: agent:content:read and agent:query:run form the default baseline, while running raw queries via execute_sql or editing dashboards requires explicit user approval.
On Enterprise installations with ai_controls, administrators can toggle individual MCP tool permissions for specific user groups inside the admin interface.
What it helps with
- run analytical SQL queries using execute_sql
- search collections and saved questions across Metabase
- render charts and visual data summaries with visualize_query
- create or modify dashboards via dashboard_write
Example prompts for the agent
- Search Metabase for existing questions about monthly churn and run them.
- Run a SQL query against the orders database and render a visual chart.
- Check the schema using catalog://metabase/fields for the customer table.
How to install Metabase
1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
claude mcp add --transport http mcp https://{metabase_host}/api/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
codex mcp add mcp --url https://{metabase_host}/api/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"mcpServers": {
"mcp": {
"url": "https://{metabase_host}/api/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"servers": {
"mcp": {
"type": "http",
"url": "https://{metabase_host}/api/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
gemini mcp add -t http mcp https://{metabase_host}/api/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Metabase
How to install Metabase in Claude Code?
Run claude mcp add --transport http mcp https://{metabase_host}/api/mcp in your terminal. Replace {metabase_host} with your actual Metabase host URL.
What does the Metabase MCP server do?
It lets AI clients discover data collections, run queries, and build dashboards. The agent operates strictly within the permissions assigned to the connected user account.
Can I authenticate using Metabase API keys?
No, the MCP endpoint rejects API keys and session cookies with a 401 challenge. Authentication requires an OAuth 2.0 access token issued by Metabase.