
Metabase
STDIOMCP server connecting AI assistants with Metabase analytics platform for data access.
MCP server connecting AI assistants with Metabase analytics platform for data access.
A Model Context Protocol server that integrates AI assistants with Metabase analytics platform.
This 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.
metabase://
URIsThe server exposes the following tools for AI assistants:
list_cards
: Get all saved questions/cards in Metabaselist_databases
: View all connected database sourceslist_collections
: List all collections in Metabaselist_tables
: List all tables in a specific databaseget_table_fields
: Get all fields/columns in a specific tableexecute_card
: Run saved questions and retrieve results with optional parametersexecute_query
: Execute custom SQL queries against any connected databasecreate_card
: Create a new question/card with SQL query, optionally adding it to a collection.create_collection
: Create a new collection to organize dashboards and questionsThe server supports two authentication methods:
# Required METABASE_URL=https://your-metabase-instance.com METABASE_USER_EMAIL=[email protected] METABASE_PASSWORD=your_password # Optional LOG_LEVEL=info # Options: debug, info, warn, error, fatal
# Required METABASE_URL=https://your-metabase-instance.com METABASE_API_KEY=your_api_key # Optional LOG_LEVEL=info # Options: debug, info, warn, error, fatal
You can set these environment variables directly or use a .env
file with dotenv.
# Install dependencies npm install # Build the project npm run build # Start the server npm start # For development with auto-rebuild npm run watch
To use with Claude Desktop, add this server configuration:
MacOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: Edit %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "metabase-mcp": { "command": "/absolute/path/to/metabase-mcp/build/index.js", "env": { "METABASE_URL": "https://your-metabase-instance.com", "METABASE_USER_EMAIL": "[email protected]", "METABASE_PASSWORD": "your_password" // Or alternatively, use API key authentication // "METABASE_API_KEY": "your_api_key" } } } }
Alternatively, you can use the Smithery hosted version via npx with JSON configuration:
{ "mcpServers": { "metabase-mcp": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "@cheukyin175/metabase-mcp", "--config", "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}" ] } } }
{ "mcpServers": { "metabase-mcp": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "@cheukyin175/metabase-mcp", "--config", "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"\",\"metabasePassword\":\"your_password\",\"metabaseUserEmail\":\"[email protected]\"}" ] } } }
A Docker image is available for containerized deployment:
# Build the Docker image docker build -t metabase-mcp .
This server communicates via stdio (standard input/output) by default. This is suitable for AI assistants or tools that can execute a command and interact with its process (e.g., like the Claude Desktop integration described elsewhere).
# Run the container with environment variables for stdio-based interaction docker run --rm -i \ -e METABASE_URL=https://your-metabase.com \ -e METABASE_API_KEY=your_api_key \ metabase-mcp
(The --rm -i
flags are typical for interactive stdio command execution)
The default server is stdio-based. For use with tools expecting an HTTP endpoint (like n8n's HTTP Request node, custom web UIs, or certain configurations of tools like Cursor), the Metabase MCP server application itself would need to be adapted to include an HTTP transport (e.g., to listen for MCP JSON-RPC requests on a port like 4321, which is EXPOSE
d in the Dockerfile).
Assuming such an HTTP-enabled version of the server, you could run it in production as follows:
Create an environment file (e.g., metabase.env
) with your credentials:
METABASE_URL=https://your-metabase.com METABASE_API_KEY=your_api_key LOG_LEVEL=info # If using password auth (less recommended for production): # [email protected] # METABASE_PASSWORD=your_password
Run the Docker container:
docker run -d \ -p 4321:4321 \ --env-file ./metabase.env \ --restart unless-stopped \ --name metabase-mcp-production \ metabase-mcp
If the server inside the container were serving HTTP on port 4321, it would then be accessible at http://<docker_host_ip>:4321
.
For n8n to interact with this MCP server using its standard HTTP Request node, the MCP server must be modified to expose an HTTP endpoint (e.g., on port 4321).
If you have an HTTP-enabled version of the MCP server:
Network Setup (if n8n is also in Docker):
docker network create my-automation-net
--env-file
as shown in the production example):
docker run -d \ --network my-automation-net \ --name metabase-mcp-http-service \ --env-file ./metabase.env \ --restart unless-stopped \ metabase-mcp # This container would need to be running an HTTP server on its internal port 4321
docker run -d \ --network my-automation-net \ --name n8n-instance \ -p 5678:5678 \ -e GENERIC_TIMEZONE="YOUR_TIMEZONE" \ # ... other n8n environment variables ... n8nio/n8n
http://metabase-mcp-http-service:4321
.If n8n is on the host (or elsewhere with network access):
-p 4321:4321
) as shown in the "Production Docker Deployment" example.http://<docker_host_ip>:4321
.If you encounter any issues with the Docker build, check the following:
docker logs metabase-mcp # Or your container name, e.g., metabase-mcp-production
This MCP server communicates via stdio by default. To use it with Cursor, you would typically configure Cursor to execute the server as a command, similar to the Claude Desktop integration. Cursor would need to manage the server process and communicate with it via stdio.
Ensure your project is built: npm run build
(This creates build/index.js
).
Get the absolute path to the executable: /absolute/path/to/metabase-mcp-server/build/index.js
.
Configure Cursor (Conceptual JSON): If Cursor uses a JSON configuration file for command-based MCP servers, it might look like this (refer to Cursor's documentation for the exact format and file location):
{ "mcpServers": { // This top-level key might vary for Cursor "metabase-mcp-cursor": { "command": "/absolute/path/to/metabase-mcp-server/build/index.js", "env": { "METABASE_URL": "https://your-metabase-instance.com", "METABASE_API_KEY": "your_api_key" // Or METABASE_USER_EMAIL & METABASE_PASSWORD } } } }
Note: If Cursor only supports MCP servers via an HTTP URL, then the metabase-mcp-server
application would first need to be modified to include an HTTP transport, as discussed in the "Production Docker Deployment & Potential HTTP Access" section. You would then run it (e.g., in Docker with port mapping) and provide the http://localhost:4321
(or similar) URL to Cursor.
Contributions are welcome! Please feel free to submit a Pull Request.