数据库访问服务
可用工具 (4 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
db_tables 2 个参数
该工具无需必填参数,直接调用即可
db_describe_table 3 个参数 需填 1 项
必填参数:table
db_execute 5 个参数 需填 1 项
必填参数:sql
db_explain 4 个参数 需填 1 项
必填参数:sql
服务介绍
数据库访问服务
MCP Database Server 是一个为AI助手和基于LLM的工具提供安全数据库访问的服务,支持SQLite、PostgreSQL、MySQL和MariaDB,具有查询验证、审计日志和安全控制功能。
工具列表
本MCP服务封装下列工具,可让模型通过标准化接口调用以下功能:
| 工具名称 | 描述 |
|---|---|
| db_tables | List all tables in the database, optionally filtered by schema. Returns qualified table names. |
| db_describe_table | Get column information for a specific table including column names, data types, and nullability. |
| db_execute | Execute a SQL statement. Supports SELECT (read), INSERT/UPDATE/DELETE (write if enabled), and DDL (if enabled). Use named parameters with :param syntax. |
| db_explain | Get query execution plan and performance information using EXPLAIN. Helps analyze query performance and optimization opportunities. |
检查服务
工具在线测试: https://mcp.xiaobenyang.com/inspector/1777316659322883
服务配置
How to get XBY-APIKEY ?
Visit XiaoBenYang website https://xiaobenyang.com, register and get the APIKEY.
SSE
{
"mcpServers": {
"数据库访问服务": {
"headers": {
"XBY-APIKEY": "<YOUR_XBY_APIKEY>"
},
"type": "sse",
"url": "https://mcp.xiaobenyang.com/1777316659322883/sse"
}
}
}
STREAMABLE HTTP
{
"mcpServers": {
"数据库访问服务": {
"headers": {
"XBY-APIKEY": "<YOUR_XBY_APIKEY>"
},
"type": "streamable_http",
"url": "https://mcp.xiaobenyang.com/1777316659322883/mcp"
}
}
}
STDIO
{
"mcpServers": {
"数据库访问服务": {
"command": "npx",
"args": [
"-y",
"xiaobenyang-mcp"
],
"env": {
"XBY_APIKEY": "<YOUR_XBY_APIKEY>",
"mcpId": "1777316659322883",
"LOG_LEVEL": "info"
},
"transport": "stdio"
}
}
}