This MCP server integrates your Metabase analytics platform with AI assistants like Claude, allowing them to interact directly with your data through a structured interface. It acts as a bridge between conversational AI and your analytics data, providing access to dashboards, saved questions, and custom queries.
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
For development with automatic rebuilding when changes are detected:
npm run watch
You can also run the server as a containerized application:
# Build the Docker image
docker build -t metabase-mcp-server .
# Run the container with environment variables
docker run -e METABASE_URL=https://your-metabase.com \
-e METABASE_API_KEY=your_api_key \
metabase-mcp-server
The server supports two authentication methods for connecting to your Metabase instance:
# Required
METABASE_URL=https://your-metabase-instance.com
[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.
To use this server with Claude Desktop, you'll need to edit the Claude configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the server configuration as follows:
{
"mcpServers": {
"metabase-mcp-server": {
"command": "/absolute/path/to/metabase-mcp-server/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"
}
}
}
}
You can also use the Smithery hosted version via npx with JSON configuration:
For API Key Authentication:
{
"mcpServers": {
"metabase-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@hyeongjun-dev/metabase-mcp-server",
"--config",
"{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}"
]
}
}
}
For Username and Password Authentication:
{
"mcpServers": {
"metabase-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@hyeongjun-dev/metabase-mcp-server",
"--config",
"{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"\",\"metabasePassword\":\"your_password\",\"metabaseUserEmail\":\"[email protected]\"}"
]
}
}
}
Once configured, Claude can access the following tools to interact with your Metabase data:
Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:
npm run inspector
This will provide a browser-based interface for monitoring requests and responses between Claude and your Metabase instance.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.