Metabase MCP Server
Enables AI assistants to interact with Metabase's analytics platform, managing dashboards, cards, databases, and tables via the Model Context Protocol.
README
Readme: Metabase MCP Server
A comprehensive Model Context Protocol (MCP) server for Metabase integration, providing AI assistants with full access to Metabase's analytics platform.
๐ Quick Start
# Install and run with npx
export METABASE_URL=https://your-metabase-instance.com
export METABASE_API_KEY=your_metabase_api_key
npx @cognitionai/metabase-mcp-server
โจ Features
๐ฏ 81+ Tools Available - Complete Metabase API Coverage
- ๐ Dashboard Management (23 tools) - Full CRUD operations, card management, public sharing, embedding
- ๐ Card/Question Management (21 tools) - Query execution, parameter handling, pivot queries, public links
- ๐๏ธ Database Management (13 tools) - Connection management, schema sync, query execution
- ๐ Table Management (16 tools) - Metadata operations, field management, data operations
- ๐ Additional Tools (9 tools) - Collections, search, users, activity tracking, playground links
๐ฆ Installation
๐ก Recommended: Node.js 20.19.0+ and npm 8.0.0+ for optimal compatibility
Method 1: NPX (Recommended)
npx @cognitionai/metabase-mcp-server
Method 2: Global Installation
npm install -g @cognitionai/metabase-mcp-server
metabase-mcp-server
Method 3: Docker
docker run -it --rm \
-e METABASE_URL=https://your-metabase-instance.com \
-e METABASE_API_KEY=your_metabase_api_key \
ghcr.io/CognitionAI/metabase-mcp-server
โ๏ธ Configuration
Environment Variables
API Key Authentication (Preferred):
export METABASE_URL=https://your-metabase-instance.com
export METABASE_API_KEY=your_metabase_api_key
Username/Password Authentication (Fallback):
export METABASE_URL=https://your-metabase-instance.com
export METABASE_USERNAME=your_username
export METABASE_PASSWORD=your_password
Optional Arguments
The server supports command-line arguments to customize tool loading:
--essential(default): Load only essential tools--all: Load all 80+ available tools--write: Load only write/modification tools--read: Load only read-only tools
# Using published package (recommended)
# Default behavior (essential tools only)
npx @cognitionai/metabase-mcp-server
# Load all tools
npx @cognitionai/metabase-mcp-server --all
# Load only write tools
npx @cognitionai/metabase-mcp-server --write
# Load only read-only tools
npx @cognitionai/metabase-mcp-server --read
# Using local development build
npm run build
node dist/server.js # Default (essential tools)
node dist/server.js --all # All tools
node dist/server.js --write # Write tools only
node dist/server.js --read # Read-only tools only
๐ Integration Examples
Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Using published package:
{
"mcpServers": {
"metabase": {
"command": "npx",
"args": ["@cognitionai/metabase-mcp-server"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
Using local development build:
{
"mcpServers": {
"metabase": {
"command": "node",
"args": ["/path/to/metabase-mcp-server/dist/server.js"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
With custom flags:
{
"mcpServers": {
"metabase-all": {
"command": "npx",
"args": ["@cognitionai/metabase-mcp-server", "--all"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
Windsurf IDE
Add to your Windsurf MCP config (~/.windsurf/mcp_config.json):
Using published package:
{
"mcpServers": {
"metabase": {
"command": "npx",
"args": ["@cognitionai/metabase-mcp-server"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
Using local development build:
{
"mcpServers": {
"metabase": {
"command": "node",
"args": ["/path/to/metabase-mcp-server/dist/server.js"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
With custom flags:
{
"mcpServers": {
"metabase-read": {
"command": "npx",
"args": ["@cognitionai/metabase-mcp-server", "--read"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
},
"metabase-write": {
"command": "npx",
"args": ["@cognitionai/metabase-mcp-server", "--write"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_metabase_api_key"
}
}
}
}
๐ ๏ธ Available Tools
<details> <summary><strong>๐ Dashboard Management (23 tools)</strong></summary>
Core Operations
list_dashboards- List all dashboardsget_dashboard- Get dashboard by IDcreate_dashboard- Create new dashboardupdate_dashboard- Update existing dashboarddelete_dashboard- Delete dashboardcopy_dashboard- Copy dashboard
Card Management
get_dashboard_cards- Get all cards in dashboardadd_card_to_dashboard- Add card to dashboardremove_card_from_dashboard- Remove card from dashboardupdate_dashboard_card- Update card position/settingsexecute_dashboard_card- Execute specific dashboard card
Public Sharing & Embedding
create_public_link- Create public dashboard linkdelete_public_link- Delete public dashboard linklist_public_dashboards- List public dashboardslist_embeddable_dashboards- List embeddable dashboards
Parameters & Queries
get_dashboard_param_values- Get parameter valuessearch_dashboard_param_values- Search parameter valuesget_dashboard_param_remapping- Get parameter remappingexecute_dashboard_query- Execute dashboard queries
Advanced Features
get_dashboard_related- Get related contentget_dashboard_query_metadata- Get query metadataupdate_dashboard_cards- Bulk update cardssave_dashboard- Save dashboard changesget_dashboard_items- Get dashboard items
</details>
<details> <summary><strong>๐ Card/Question Management (21 tools)</strong></summary>
Core Operations
list_cards- List all cards/questionsget_card- Get card by IDcreate_card- Create new cardupdate_card- Update existing carddelete_card- Delete cardcopy_card- Copy card
Query Execution
execute_card- Execute card queryexecute_card_query_with_format- Execute with specific formatexecute_pivot_card_query- Execute pivot queryget_card_query_metadata- Get query metadata
Card Management
move_cards- Move cards between collectionsmove_cards_to_collection- Bulk move to collectionget_card_dashboards- Get dashboards containing cardget_card_series- Get card series data
Parameters & Values
get_card_param_values- Get parameter valuessearch_card_param_values- Search parameter valuesget_card_param_remapping- Get parameter remapping
Public Sharing
create_card_public_link- Create public card linkdelete_card_public_link- Delete public card linkget_public_cards- List public cardsget_embeddable_cards- List embeddable cards
</details>
<details> <summary><strong>๐๏ธ Database Management (13 tools)</strong></summary>
Core Operations
list_databases- List all databasesget_database- Get database detailscreate_database- Create database connectionupdate_database- Update database settingsdelete_database- Delete database connection
Schema & Metadata
get_database_schema_tables- Get database tablesget_database_schemas- Get database schemasget_database_metadata- Get complete metadatasync_database_schema- Sync schema metadata
Query Operations
execute_query- Execute SQL queriesexecute_query_export- Execute and export results
Maintenance
get_database_usage_info- Get usage statisticsrescan_database_field_values- Rescan field values
</details>
<details> <summary><strong>๐ Table Management (16 tools)</strong></summary>
Core Operations
list_tables- List tables with filteringget_table- Get table detailsupdate_table- Update table configurationupdate_tables- Bulk update tables
Data Operations
get_table_data- Retrieve table dataappend_csv_to_table- Append CSV datareplace_table_csv- Replace with CSV data
Schema & Relationships
get_table_query_metadata- Get query metadataget_table_fks- Get foreign key relationshipsget_table_related- Get related tablessync_table_schema- Sync table schema
Field Management
reorder_table_fields- Reorder field displayrescan_table_field_values- Rescan field valuesdiscard_table_field_values- Discard cached values
Card Integration
get_card_table_fks- Get card table foreign keysget_card_table_query_metadata- Get card table metadata
</details>
<details> <summary><strong>๐ Additional Tools (9 tools)</strong></summary>
Collections
list_collections- List all collectionscreate_collection- Create new collectionupdate_collection- Update collectiondelete_collection- Delete collectionget_collection_items- Get collection items
Search & Discovery
search_content- Search across all content
Activity & Analytics
get_recent_views- Get recent activityget_popular_items- Get popular content
Playground Links
get_metabase_playground_link- Generate interactive playground links
</details>
๐งช Development
Setup
git clone https://github.com/CognitionAI/metabase-mcp-server.git
cd metabase-mcp-server
npm install
Build
npm run build
Development Mode
npm run watch
Debugging
Use the MCP Inspector for debugging:
npm run inspector
๐ Testing Authentication
API Key Authentication
- Set
METABASE_URLandMETABASE_API_KEY - Start server and verify "Using Metabase API Key" in logs
- Test with
list_dashboardstool
Username/Password Authentication
- Unset
METABASE_API_KEY - Set
METABASE_URL,METABASE_USERNAME,METABASE_PASSWORD - Start server and verify "Using username/password" in logs
- Test with
list_dashboardstool
๐ Troubleshooting
Common Issues
Authentication Errors:
- Verify your Metabase URL is accessible
- Check API key validity in Metabase admin settings
- Ensure username/password credentials are correct
Connection Issues:
- Confirm Metabase instance is running
- Check network connectivity
- Verify SSL certificates if using HTTPS
Tool Execution Errors:
- Check Metabase permissions for your user/API key
- Verify the requested resource exists
- Review server logs for detailed error messages
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Contributing
Contributions are welcome! Please visit our GitHub repository to:
- ๐ Report bugs
- ๐ก Request features
- ๐ง Submit pull requests
- ๐ Improve documentation
Development Guidelines
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Ensure all tests pass
- Submit a pull request
๐ Support
- ๐ Documentation
- ๐ Issue Tracker
Built with โค๏ธ for the world
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.