Metabase
OfficialExposes Metabase's data exploration and visualization capabilities through MCP tools, allowing AI clients to search tables and metrics, construct and execute queries, and generate interactive visualizations from Metabase data.
Metabase MCP Server
Metabase includes a built-in Model Context Protocol (MCP) server that lets AI clients connect directly to a Metabase instance. It uses the Streamable HTTP transport and builds on Metabase's Agent API to expose tools for searching, exploring, querying, and visualizing data — all scoped to the connecting user's permissions.
Endpoint
The MCP server is available at:
https://{your-metabase.example.com}/api/mcpConnecting a client
Point any MCP-compatible client at the /api/mcp endpoint. For example, with Claude Code:
claude mcp add metabase https://{your-metabase.example.com}/api/mcp --transport streamable-httpFor Claude Desktop, create a custom connector using the same URL.
For Cursor, open Settings > MCP and add a new server with the type set to streamable-http and the URL:
https://{your-metabase.example.com}/api/mcpAuthentication
MCP clients authenticate via OAuth 2.0. Metabase runs its own embedded OAuth server — no external provider is needed.
The flow for a first-time connection:
The client discovers Metabase's OAuth endpoints.
The client registers itself with Metabase.
The user is redirected to Metabase to log in and approve the connection.
The client receives an access token scoped to the user's Metabase permissions.
Browser-based sessions (cookie auth) are also supported and receive unrestricted scopes.
Scopes
Access tokens are scoped to limit what tools a client can use:
Scope | Grants access to |
|
|
|
|
|
|
|
|
|
|
|
|
Wildcard patterns (e.g. agent:*) match any scope with that prefix.
OAuth protected resource metadata is available at:
/.well-known/oauth-protected-resource/api/mcpBy default our consent screen grants access to all scopes without the opportunity to customize.
Available tools
The MCP server exposes these tools, dynamically generated from the Agent API endpoint metadata:
Tool | Description |
| Search for tables and metrics using keyword or natural language search. |
| Get details about a table including its fields, related tables, and metrics. |
| Get sample values and statistics for a field in a table. |
| Get details about a metric including its queryable dimensions. |
| Get sample values and statistics for a field in a metric. |
| Construct a query against a table or metric. Accepts the user's original |
| Execute a previously constructed query and return results with column metadata. |
| Query a table or metric directly. Supports pagination via continuation tokens. |
Query results are limited to 200 rows per request. When more rows are available, the response includes a
continuation_token that can be passed back to fetch the next page.
Resources
The server exposes MCP resources so clients can fetch supplementary content by URI without inflating tool descriptions.
Resource URI | Description |
| Program syntax for |
Supported JSON-RPC methods
Method | Description |
| Initialize the MCP connection. Returns server capabilities and a session ID. |
| Client notification that initialization is complete. |
| List available tools (filtered by the token's scopes). |
| Call a tool with arguments. |
| List available resources (filtered by the token's scopes). |
| Read a resource by URI. Requires an initialized session. |
| Keepalive ping. |
Requests can be sent individually or as a JSON-RPC batch. The server responds with JSON or SSE depending on the
Accept header.
Architecture
The implementation lives in these files:
api.clj— The HTTP handler. Parses JSON-RPC requests, validates authentication and session headers, enforces origin checks (DNS rebinding protection), and dispatches to the appropriate method. Supports both JSON and SSE response formats.tools.clj— Tool dispatch and manifest generation. Builds the tool list from Agent API endpoint metadata, checks scopes, and routes tool calls through synthetic Agent API requests.resources.clj— MCP resource registry and handlers. Holds documentation resources (like theconstruct_queryreference) keyed by URI, with scope-based access control onresources/listandresources/read.scope.clj— Scope matching logic. Supports exact matches, wildcard patterns, and the::unrestrictedsentinel for session-based auth.
Request flow
MCP client
→ POST /api/mcp (JSON-RPC)
→ Origin + session validation
→ Auth: OAuth bearer token or browser session
→ Scope check against requested tool
→ Synthetic request to Agent API endpoint
→ Response materialized as MCP content
→ JSON or SSE back to clientFurther reading
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/metabase/metabase'
If you have feedback or need assistance with the MCP directory API, please join our Discord server