biz-db-mcp
Provides database operations for MySQL, including listing databases, describing tables, running read-only queries, executing protected single-statement DML writes, and exporting query results to Parquet for Sandbox Dataset uploads.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@biz-db-mcpshow me the schema for the orders table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
biz-db-mcp
一个面向 Agent 的 MySQL MCP Server,支持多数据库、只读查询、受保护的 DML 写入,以及批量导出到 Sandbox Dataset。
设计边界
默认只读:
BIZDB_WRITE_ENABLED默认关闭,单个数据库还必须显式allow_writes: true。query与export只允许单条SELECT/WITH ... SELECT;execute只允许单条INSERT、UPDATE、DELETE或REPLACE。UPDATE/DELETE默认必须带WHERE,写入在事务中执行,并受最大影响行数限制。export使用服务端游标分批写 Parquet,再上传 Sandbox;身份从进程环境注入,模型不能指定目标 session。SQL 审计只记录 SHA-256 和长度,不记录原始 SQL、参数或密码。
Related MCP server: MySQL ReadOnly MCP Server
目录结构
biz_db_mcp/
config.py # 环境变量、多数据库、写入和 DBPM 配置
db.py # MySQL 连接、查询、写入
dbpm.py # DBPM 外部桥接命令适配器
sql_guard.py # SELECT/DML 语句边界
export.py # 流式 Parquet 导出
sandbox_client.py # Dataset 上传
audit.py # 结构化审计日志
server.py # MCP 工具注册
tests/ # 单元测试配置
单库兼容配置:BIZDB_MYSQL_DSN=mysql://user:password@host:3306/database。
多库使用 BIZDB_DATABASES_JSON,格式可以是映射或 connections 数组:
{"connections":[
{"id":"primary","dsn":"mysql://user:password@db-a/app"},
{"id":"reporting","dsn":"mysql://user:password@db-b/reporting","allow_writes":false}
]}BIZDB_DEFAULT_DATABASE 选择默认库。写入还需要 BIZDB_WRITE_ENABLED=true,并在目标库配置 allow_writes: true;可用 BIZDB_WRITE_MAX_AFFECTED_ROWS 和 BIZDB_WRITE_REQUIRE_WHERE 调整保护阈值。
工具包括 list_databases、describe_table、query、execute 和 export。execute 是单语句、事务提交的 DML 接口,不提供 DDL、事务控制或任意多语句执行。
DBPM(可选)
UPspec 中的 DBPM 是密码管理系统,不是 MCP 请求认证。Python 项目不内置私有 Java SDK;启用 BIZDB_DBPM_ENABLED=true 后,必须配置 BIZDB_DBPM_COMMAND、BIZDB_DBPM_SERVERS、BIZDB_DBPM_APP_NAME、BIZDB_DBPM_APP_KEY 和 BIZDB_DBPM_APP_IP。
桥接命令从 stdin 读取 JSON(包含 database、username、servers 等字段),只在 stdout 输出密码,非零退出码表示失败。DBPM 私钥通过 DBPM_APP_KEY 环境变量传给桥接进程,不出现在命令行参数中。数据库条目可用 dbpm_database/dbpm_user 覆盖 DBPM 查询键。
开发与运行
python3 -m pip install -e '.[dev]'
python3 -m pytest
biz-db-mcpSandbox 上传仍需配置 BIZDB_SANDBOX_BASE_URL、BIZDB_SANDBOX_API_TOKEN;导出身份需配置 BIZDB_SESSION_ID、BIZDB_ORG_ID、BIZDB_USER_ID。生产环境应使用 DBPM,不要把真实密码提交到配置、日志或测试夹具中。
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
- Flicense-quality-maintenanceEnables direct interaction with MySQL databases through SQL queries, table exploration, and schema inspection with support for prepared statements and connection pooling.Last updated
- AlicenseAqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access, featuring SQL injection protection, connection pooling, and automatic query limits for secure database exploration.Last updated450MIT
- Alicense-qualityDmaintenanceEnables Claude Desktop to interact with MySQL databases through secure query execution, schema discovery, and multi-database support with configurable read/write permissions and built-in SQL injection protection.Last updated77MIT
- Alicense-qualityCmaintenanceEnables AI assistants to securely connect to and manage MySQL databases with support for multiple database connections, complete CRUD operations, schema inspection, and dynamic connection management through natural language.Last updated3980MIT
Related MCP Connectors
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Connect AI agents to bank accounts, transactions, balances, and investments.
Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.
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/nusduck/biz-db-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server