Metabase MCP Server
元数据库 MCP 服务器
模型控制协议 (MCP) 服务器,使 AI 助手能够与 Metabase 数据库和操作进行交互。
![元数据库 MCP 服务器]
概述
Metabase MCP 服务器在 AI 助手和 Metabase 之间架起了一座桥梁,使 AI 模型能够:
列出并探索 Metabase 中配置的数据库
检索有关数据库架构、表和字段的详细元数据
可视化数据库中表之间的关系
列出并执行 Metabase 操作
通过安全 API 对 Metabase 数据执行操作
该服务器实现了[模型控制协议(MCP)]规范,使其与支持MCP工具的AI助手兼容。
Related MCP server: Metabase MCP Plus
特征
数据库探索:列出所有数据库并探索其模式
元数据检索:获取有关表、字段和关系的详细信息
关系可视化:生成数据库关系的可视化表示
操作管理:列出、查看详细信息并执行元数据库操作
安全 API 密钥处理:加密存储 API 密钥并防止泄露
Web 界面:通过用户友好的 Web 界面测试和调试功能
Docker 支持:使用 Docker 和 Docker Compose 轻松部署
先决条件
Metabase 实例(建议使用 v0.46.0 或更高版本)
具有适当权限的 Metabase API 密钥
Docker(用于容器化部署)
Python 3.10+(用于本地开发)
安装
使用 Docker(推荐)
克隆此存储库:
git clone https://github.com/yourusername/metabase-mcp.git cd metabase-mcp构建并运行 Docker 容器:
docker-compose up -d访问配置界面http://localhost:5001
手动安装
克隆此存储库:
git clone https://github.com/yourusername/metabase-mcp.git cd metabase-mcp安装依赖项:
pip install -r requirements.txt运行配置界面:
python -m src.server.web_interface访问配置界面http://localhost:5000
配置
在浏览器中打开 Web 界面
输入您的 Metabase URL(例如, http://localhost:3000 )
输入您的 Metabase API 密钥
点击“保存配置”并测试连接
获取元数据库 API 密钥
以管理员身份登录到您的 Metabase 实例
前往“设置”>“管理设置”>“API 密钥”
创建具有适当权限的新 API 密钥
复制生成的密钥以在 MCP 服务器中使用
用法
运行 MCP 服务器
配置完成后,即可运行MCP服务器:
# Using Docker
docker run -p 5001:5000 metabase-mcp
# Manually
python -m src.server.mcp_server可用工具
MCP服务器为AI助手提供以下工具:
list_databases :列出 Metabase 中配置的所有数据库
get_database_metadata :获取特定数据库的详细元数据
db_overview :获取数据库中所有表的高级概述
table_detail :获取特定表的详细信息
visualize_database_relationships :生成数据库关系的可视化表示
run_database_query :对数据库执行 SQL 查询
list_actions :列出 Metabase 中配置的所有操作
get_action_details :获取有关特定操作的详细信息
执行带有参数的 Metabase 操作
通过 Web 界面测试工具
Web 界面为每个工具提供了一个测试区域:
列出数据库:查看 Metabase 中配置的所有数据库
获取数据库元数据:查看数据库的详细架构信息
DB 概览:查看数据库中所有表的简明列表
表详细信息:查看特定表的详细信息
可视化数据库关系:生成表关系的可视化表示
运行查询:对数据库执行 SQL 查询
列出操作:查看 Metabase 中配置的所有操作
获取操作详细信息:查看有关特定操作的详细信息
执行操作:测试执行带参数的操作
安全注意事项
API 密钥以静态加密方式存储
Web 界面从不以纯文本形式显示 API 密钥
当配置了安全的 Metabase URL 时,所有 API 请求都使用 HTTPS
在生产环境中,服务器应该部署在安全代理后面
发展
项目结构
metabase-mcp/
├── src/
│ ├── api/ # Metabase API client
│ ├── config/ # Configuration management
│ ├── server/ # MCP and web servers
│ └── tools/ # Tool implementations
├── templates/ # Web interface templates
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker build configuration
├── requirements.txt # Python dependencies
└── README.md # Documentation添加新工具
要添加新工具:
在
src/tools/中实现工具功能在
src/server/mcp_server.py中注册该工具在
templates/config.html中添加测试接口(可选)在
src/server/web_interface.py中添加路由(如果添加测试接口)
故障排除
常见问题
连接失败:确保您的 Metabase URL 正确且可访问
身份验证错误:验证您的 API 密钥是否具有必要的权限
Docker 网络问题:使用 Docker 时,确保正确的网络配置
日志
检查日志以获取详细的错误信息:
# Docker logs
docker logs metabase-mcp
# Manual execution logs
# Logs are printed to the console贡献
欢迎贡献代码!欢迎提交 Pull 请求。
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.467MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to query databases, execute SQL, and manage Metabase resources like dashboards, cards, and collections through natural language.22MIT
- AlicenseAqualityDmaintenanceA MCP server for Metabase that gives AI assistants direct access to dashboards, cards, and query execution.331MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Metabase that gives AI agents full access to query, explore, and manage content in your Metabase instance.141MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
GibsonAI MCP server: manage your databases with natural language
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/sazboxai/MCP_MetaBase'
If you have feedback or need assistance with the MCP directory API, please join our Discord server