logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MCP_DataExplorer_Bridge

Facilitate robust interaction with Metabase infrastructure, enabling AI agents to inspect data structures, map inter-table connections, and trigger defined Metabase operations via a protected application programming interface.

Author

MCP_DataExplorer_Bridge logo

sazboxai

No License

Quick Info

GitHub GitHub Stars 6
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

metabasemcp_metabasedatabasesmetabase databasessazboxai mcp_metabaseexecution metabase

Metabase Service Interface (MCP)

A Model Control Protocol (MCP) component engineered to allow sophisticated language models secure access to Metabase data resources and functional execution paths.

![Metabase Interaction Module Diagram]

Abstract

This Metabase MCP component establishes a crucial communication conduit between AI constructs and the Metabase environment, empowering models to:

  • Enumerate and survey accessible data repositories within Metabase.
  • Fetch granular metadata detailing schemas, constituent tables, and attribute specifications.
  • Generate graphical representations illustrating the linkages among database entities.
  • Catalogue and invoke pre-configured Metabase operational workflows (actions).
  • Orchestrate data manipulations against Metabase stores via a secure gateway.

This implementation adheres strictly to the [Model Control Protocol (MCP)] standard, ensuring interoperability with any AI assistant equipped with MCP tooling support.

Core Capabilities

  • Repository Traversal: Access and survey all registered data sources and their internal compositions.
  • Information Extraction: Retrieve precise specifications regarding tables, attributes, and relational mapping.
  • Connectivity Mapping: Produce visual models demonstrating data element dependencies.
  • Workflow Command: List, detail, and trigger defined operational procedures within Metabase.
  • Credential Shielding: Ensure API tokens are cryptographically protected against unauthorized disclosure.
  • Diagnostic Console: Offer a browser-based portal for functional validation and debugging routines.
  • Containerization: Simplify deployment procedures through standardized Docker and Docker Compose configurations.

Prerequisites for Operation

  • An active Metabase deployment (version 0.46.0 or newer is advised).
  • A valid Metabase access token possessing requisite operational privileges.
  • Docker runtime environment (for packaged deployment).
  • Python version 3.10 or later (for native environment setup).

Deployment Guide

Containerized Method (Preferred)

  1. Obtain the source code repository: bash git clone https://github.com/yourusername/metabase-mcp.git cd metabase-mcp

  2. Initiate and launch the Docker instance in detached mode: bash docker-compose up -d

  3. Interface with the setup panel via: http://localhost:5001

Local Installation Method

  1. Obtain the source code repository: bash git clone https://github.com/yourusername/metabase-mcp.git cd metabase-mcp

  2. Install requisite dependencies: bash pip install -r requirements.txt

  3. Execute the configuration utility: bash python -m src.server.web_interface

  4. Access the setup console at: http://localhost:5000

Initial Configuration

  1. Access the dedicated web utility through a standard browser.
  2. Input the Metabase endpoint URL (e.g., http://localhost:3000).
  3. Supply the authorized Metabase API token.
  4. Confirm settings persistence and initiate a connectivity check.

Acquiring an API Token from Metabase

  1. Authenticate to the Metabase instance with administrative credentials.
  2. Navigate to Configuration -> Administrative Settings -> API Access Tokens.
  3. Generate a novel access token, specifying appropriate scope.
  4. Copy the resulting token for insertion into the MCP server configuration.

Operational Usage

Launching the MCP Service

Once configuration is finalized, initiate the MCP data processing engine:

bash

Docker execution command

docker run -p 5001:5000 metabase-mcp

Native execution command

python -m src.server.mcp_server

Available Agent Toolset

The MCP component exposes the following functions for AI agent invocation:

  1. list_databases: Retrieves a roster of all data sources known to Metabase.
  2. get_database_metadata: Fetches comprehensive structural data for a nominated data source.
  3. db_overview: Provides a summary list of all tabular entities within a specified repository.
  4. table_detail: Returns in-depth characteristics for an identified table.
  5. visualize_database_relationships: Crafts a schematic depiction of data linkage structures.
  6. run_database_query: Submits and executes custom SQL code against a database.
  7. list_actions: Enumerates all executable workflows defined in Metabase.
  8. get_action_details: Retrieves parameters and context for a specific workflow.
  9. execute_action: Triggers a Metabase workflow, supplying necessary input parameters.

Tool Validation via Web Utility

The integrated utility offers sandboxed environments to test each exposed function:

  1. Database Listing: Review the catalog of accessible data sources.
  2. Schema Fetch: Examine fine-grained structure information for a selected database.
  3. Repository Summary: See a concise tabulation of tables.
  4. Entity Specification: Retrieve detailed record definitions.
  5. Relationship Visualization: Render the data dependency map.
  6. Query Execution: Submit and validate SQL commands.
  7. Workflow Inventory: View the complete set of callable routines.
  8. Routine Specification: Inspect the input requirements for an action.
  9. Workflow Invocation: Practice triggering an action with sample data.

Security Posture

  • Authentication credentials are pseudonymized via encryption at persistent storage.
  • The utility interface is architected never to expose plaintext API credentials.
  • Secure communication (HTTPS) is enforced when a secure endpoint is specified for Metabase.
  • Production deployments necessitate placement behind a hardened network proxy layer.

Development Roadmap

Structural Layout

metabase-mcp/ ├── src/ │ ├── api/ # Interface logic for Metabase API interaction │ ├── config/ # Parameter management modules │ ├── server/ # MCP hosting and web interface components │ └── tools/ # Logic implementation for exposed agent functions ├── templates/ # HTML/CSS assets for the user interface ├── docker-compose.yml # Orchestration definition file ├── Dockerfile # Container image build instructions ├── requirements.txt # Python package manifest └── README.md # Comprehensive documentation

Incorporating Novel Functionality

To integrate a new agent tool:

  1. Code the function logic within the src/tools/ directory.
  2. Register the new function handler in src/server/mcp_server.py.
  3. Update templates/config.html to include a testing interface (optional).
  4. Add an endpoint mapping in src/server/web_interface.py (if a test harness is required).

Issue Resolution

Frequently Encountered Difficulties

  • Linkage Failure: Confirm endpoint URL accuracy and network accessibility to the target Metabase server.
  • Authorization Malfunction: Validate that the API key possesses adequate permissions for the requested operation.
  • Container Communication Errors: Review the Docker network setup for potential routing blockages.

Diagnostic Logging

Consult system output for detailed error tracing:

bash

Docker instance logs retrieval

docker logs metabase-mcp

Local execution logs

Output streams directly to the executing terminal

Collaboration

We welcome external contributions! Please submit proposed enhancements via a standard Pull Request.

See Also

`