- Home
- MCP servers
- Metabase
Metabase
- javascript
0
GitHub Stars
javascript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mikela92-metabase-mcp-mab": {
"command": "node",
"args": [
"/path/to/metabase-mcp-mab/src/server/index.js"
],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}You can run a Metabase MCP Server that lets LLMs interact with your Metabase instance. It exposes a structured set of tools to query cards, dashboards, databases, collections, and to execute queries, enabling powerful, scalable AI-assisted data exploration.
How to use
Install and run the server, then connect your MCP client to it. You will interact with a local or remote MCP endpoint that exposes tools for querying Metabase resources and executing predefined queries. Start by ensuring your Metabase URL and API key are provided as environment variables. Use the client to fetch cards, dashboards, databases, or run queries, and the server will translate your requests into Metabase API calls.
How to install
Prerequisites: Node.js 18 or newer and npm.
# 1) Navigate to the project directory
cd metabase-mcp-mab
# 2) Install dependencies
npm install
# 3) Verify Node.js version
node --version # Should be >= 18.0.0
Configuration and usage details
Configure the MCP server to provide the Metabase connection details and enable the tools you need. The server is started with a local command and environment variables to connect to your Metabase instance.
{
"mcpServers": {
"metabase-local": {
"command": "node",
"args": ["/path/to/metabase-mcp-mab/src/server/index.js"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}
Starting the server directly
Run the server in normal mode and then in development mode for auto-reload during iteration.
npm start
# or for development with auto-reload
npm run dev
Programmatic usage example
Create a client and perform common operations such as retrieving a card, listing cards, searching cards, and executing a card query.
import { createDefaultClient } from './src/client/cards.js';
const client = createDefaultClient();
// Get a specific card
const card = await client.getCard(17033);
console.log(card.sqlQuery);
// List all cards
const cards = await client.listCards('all');
// Search for cards
const revenueCards = await client.searchCards('revenue');
// Execute a query
const results = await client.executeCardQuery(17033, {param: 'value'});
Additional notes
This server provides a broad set of capabilities to work with Metabase programmatically. Be mindful of performance: some endpoints may return large results or take longer to execute complex queries.
Available tools
get_card
Fetch card details and the associated SQL query for a specific card ID.
list_cards
List cards with optional filtering to discover relevant items.
execute_card_query
Run a saved query associated with a card to obtain results.
execute_query_builder_card
Execute a query builder card with provided parameters.
get_generated_sql
Retrieve generated SQL for query builder cards.
get_card_with_parameters
Extract card information from a dashboard or card URL.
get_dashboard
Fetch details for a specific dashboard, including its cards.
list_dashboards
List all dashboards available in Metabase.
get_database
Get information about a Metabase database.
list_databases
List all Metabase databases.
get_database_metadata
Retrieve comprehensive schema for a database including tables and columns.
list_database_tables
List all tables within a database.
get_table_metadata
Get detailed information about a specific table.
list_collections
List all collections (folders) in Metabase.
get_collection_items
Get items contained in a collection.
execute_native_query
Execute a custom SQL query directly against the database.
get_field
Get information about a field/column.
get_field_values
Retrieve distinct values for a given field.
list_segments
List saved filter segments for re-use.
list_metrics
List saved aggregations (metrics) if available in this Metabase version.
list_activity
Get recent activity feed (may be unavailable on some versions).
get_current_user
Retrieve information about the currently authenticated user.
list_users
List all users in Metabase (admin access required).