metabase-mcp
A TypeScript/Node.js MCP server that wraps the Metabase REST API, enabling AI agents to execute queries, explore schemas, and build dashboards through structured tool calls.
README
Metabase MCP Server
Completely vibecoded a TypeScript/Node.js MCP (Model Context Protocol) server that wraps the Metabase REST API, giving AI agents (Claude Desktop, Claude Code) full programmatic access to a Metabase v0.59.x instance. Agents can execute queries, explore schemas, and build dashboards entirely through structured tool calls — no human click-through required.
Prerequisites
- Node.js 20 LTS or later
- Docker (for running a local Metabase instance during development)
- A Metabase instance reachable over HTTP/HTTPS with an API key
Setup
-
Install dependencies:
npm install -
Build the server:
npm run buildCompiled output is written to
dist/. The entry point isdist/index.js. -
Configure environment variables (copy
.env.exampleand fill in values):cp .env.example .env -
(Optional) Start a local Metabase instance for development:
docker compose up -dMetabase is available at
http://localhost:3000once healthy (allow ~2 minutes on first boot).
Environment Variables
| Variable | Required | Description |
|---|---|---|
METABASE_URL |
Yes | Base URL of your Metabase instance, e.g. http://localhost:3000 |
METABASE_API_KEY |
Yes | API key created in Admin → Settings → Authentication → API Keys |
API Key Permissions: The API key must belong to a Metabase group with sufficient permissions for the operations you need. For full agent access (read schema, execute queries, create/edit cards and dashboards), the key's group should have access to all relevant databases and admin capabilities. A key with only basic viewer permissions will return 403 errors on write operations.
Adding to Claude Desktop
Add the following to your Claude Desktop MCP config file (typically ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"metabase": {
"command": "node",
"args": ["/absolute/path/to/metabase-mcp/dist/index.js"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}
Replace /absolute/path/to/metabase-mcp with the actual path to this project.
Adding to Claude Code
Add the same config to your Claude Code MCP settings:
{
"mcpServers": {
"metabase": {
"command": "node",
"args": ["/absolute/path/to/metabase-mcp/dist/index.js"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}
Verifying the Connection
Once added to Claude Desktop or Claude Code, ask the agent to call the server_ping tool:
"Call the server_ping tool to verify the Metabase MCP server is running."
A successful response looks like:
{"ok": true, "server": "metabase-mcp", "version": "0.1.0"}
Development
# Run tests
npm test
# Watch mode
npm run test:watch
# Lint
npm run lint
# Type check without building
npm run typecheck
# Build
npm run build
# Run server directly (requires env vars set)
npm start
Architecture
src/client.ts—MetabaseClientclass (HTTP,X-Api-Keyauth, typed errors) andMetabaseApiErrorsrc/index.ts— MCP server factory (createServer()), tool registrations, and stdio bootstrapsrc/types.ts— Hand-written TypeScript interfaces for Metabase API responses
All MCP server logging goes to stderr exclusively. stdout is reserved for the JSON-RPC protocol stream — any non-protocol bytes there would corrupt the MCP session.
Metabase Version
This server targets Metabase v0.59.x. APIs introduced after this version are not used.
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
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.