home / mcp / metabase mcp server
Metabase MCP server provides integration with the Metabase API, enabling LLM with MCP capabilites to directly interact with your analytics data, this server acts as a bridge between your analytics platform and conversational AI.
Configuration
View docs{
"mcpServers": {
"cpr43-metabase-mcp": {
"url": "https://placeholder-hosted-mcp.example.com/mcp",
"headers": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_api_key",
"METABASE_PASSWORD": "your_password",
"METABASE_USER_EMAIL": "[email protected]"
}
}
}
}This MCP (Model Context Protocol) server bridges Metabase analytics data with conversational AI, letting you access dashboards, cards, databases, and more through natural language-enabled assistants. It supports both API-key and user/password authentication, returns structured JSON for AI consumption, and includes robust logging and error handling to help you build interactive analytics conversations.
You connect your AI assistant to Metabase through the MCP server and use it to browse, query, and manage analytics resources. You can retrieve dashboards, cards, databases, and tables, run saved questions or custom SQL, and organize content into collections and dashboards. Choose an authentication method that fits your security model: API keys for production or username/password for development. When you configure the client, point it to the MCP server using the provided runtime commands, and supply the required credentials via the chosen method.
Deployment channels include a Smithery-based runtime and a local, shell-driven workflow. If you are using Claude Desktop or a similar AI assistant, you can start the MCP server through the runtime command shown in the configuration examples and provide the necessary configuration payload via the --config parameter. This yields a live MCP endpoint that your assistant can call to list resources, execute cards and queries, and manage dashboards.
Prerequisites: have Node.js installed on your machine (version 14 or newer is recommended) and npm available in your environment.
1. Install the MCP server dependencies in your project.
2. Start the MCP server using the provided runtime command. If you are using the Smithery-based flow showcased for Claude Desktop integration, you will run a command that invokes npx with the MCP server package and passes a JSON configuration payload.
Concrete commands you can use as a starting point (adjust to your actual repository and configuration):
# Install dependencies
npm install
# Start the server via Smithery-based flow (example)
npx -y @smithery/cli@latest run YOUR_GITHUB_USERNAME/metabase-mcp-server --config "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}"The MCP server supports two authentication methods. Use API key authentication for production deployments to minimize credential handling. If you choose username and password authentication, supply the Metabase user email and password accordingly.
Environment variables can be set directly in your environment or via a .env file. Ensure credentials are kept secure and avoid hardcoding sensitive values in code or config files.
If you encounter connection issues, verify that the Metabase URL is reachable from the MCP server host and that the authentication method (API key or user credentials) is correctly supplied. Check the server logs for authentication errors and API access messages to diagnose issues quickly.
Retrieve all dashboards available in your Metabase instance.
Get all saved questions/cards stored in Metabase.
View all connected database sources.
List all collections in Metabase.
List all tables in a specific database.
Get all fields/columns in a specific table.
Run a saved card and retrieve its results with optional parameters.
Execute a custom SQL query against any connected database.
Extract all cards from a specific dashboard.
Create a new dashboard with specified name and parameters.
Update an existing dashboard's name, description, or parameters.
Delete a dashboard.
Add or update cards in a dashboard with position and optional tab.
Create a new card/question with a SQL query.
Update visualization settings for a card.
Create a new collection to organize dashboards and cards.