This MCP server enables integration with Metabase, allowing AI assistants to access and interact with Metabase dashboards, questions/cards, and databases. It provides structured data access and tools for executing queries against your Metabase instance.
Before using the server, you need to set up authentication using environment variables. There are two authentication methods available:
# Required environment variables
export METABASE_URL=https://your-metabase-instance.com
export METABASE_API_KEY=your_metabase_api_key
# Required environment variables
export METABASE_URL=https://your-metabase-instance.com
export METABASE_USERNAME=your_username
export METABASE_PASSWORD=your_password
The server first checks for METABASE_API_KEY
. If present, it uses API key authentication. Otherwise, it falls back to username/password authentication. You must provide credentials for at least one method.
To use with Claude Desktop, add the server configuration to the appropriate file based on your operating system:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"metabase-server": {
"command": "/path/to/metabase-server/build/index.js",
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
// Or alternatively:
// "METABASE_USERNAME": "your_username",
// "METABASE_PASSWORD": "your_password"
}
}
}
}
You can also set these environment variables in your system instead of in the config file.
For automatic installation with Claude Desktop using Smithery:
npx -y @smithery/cli install @imlewc/metabase-server --client claude
The Metabase MCP server provides several tools and resources for interacting with your Metabase instance.
You can access Metabase resources using metabase://
URIs. The server supports:
All resources are returned with JSON content type for structured data access.
Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:
npm run inspector
This will provide a URL to access debugging tools in your browser, where you can send requests to the server and view responses.
Set the required environment variables:
export METABASE_URL=https://your-metabase-instance.com
export METABASE_API_KEY=your_metabase_api_key
Start the server and use an MCP client or the MCP Inspector to call a tool:
{"name": "list_dashboards"}
Verify that the tool call returns the expected data.
Ensure METABASE_API_KEY
is unset, then set:
export METABASE_URL=https://your-metabase-instance.com
export METABASE_USERNAME=your_username
export METABASE_PASSWORD=your_password
Start the server and call a tool using an MCP client or the Inspector.
Check that the authentication succeeds and the tool returns data.
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.