universal-db-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MODE | No | Startup mode: 'stdio' or 'http'. Defaults to 'stdio'. | |
| API_KEYS | No | Comma-separated list of API keys for REST API authentication. | |
| HTTP_PORT | No | Port for HTTP mode. Defaults to 3000. | |
| DB_ALLOWED_FILE_PATHS | No | Comma-separated list of allowed file paths for CSV import/export. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| execute_queryB | 执行 SQL 查询或数据库命令。支持 SELECT、JOIN、聚合等查询操作。如果启用了写入模式,也可以执行 INSERT、UPDATE、DELETE 等操作。 |
| get_schemaA | 获取数据库结构信息,包括所有 Schema 中用户可访问的表名、列名、数据类型、主键、索引等元数据。在执行查询前调用此工具可以帮助理解数据库结构。结果会被缓存以提高性能。 |
| get_table_infoA | 获取指定表的详细信息,包括列定义、索引、预估行数等。用于深入了解某个表的结构。 |
| clear_cacheA | 清除 Schema 缓存。当数据库结构发生变化(如新增表、修改列)时,可以调用此工具清除缓存。 |
| get_enum_valuesA | 获取指定列的所有唯一值。用于了解 status、type、category 等枚举类型列的所有可能值,帮助生成准确的 WHERE 条件。例如:获取 orders.status 列的所有状态值(pending, shipped, delivered 等)。 |
| get_sample_dataA | 获取表的示例数据(已自动脱敏)。用于了解数据格式,如日期格式(2024-01-01 vs 20240101)、ID格式(UUID vs 自增)、金额精度等。敏感数据(手机号、邮箱、身份证等)会自动脱敏保护隐私。 |
| get_active_profileA | v5.0.0 (重命名自 get_connection_status):返回当前激活的 profile 名 + 完整 profile 元数据 + 连接状态 + schema 缓存。未激活时返回 null + 提示信息。 |
| get_metricsB | Get server observability metrics. category=summary|slow_queries|all. Returns JSON. |
| explain_queryB | Get EXPLAIN plan for a SQL query. Returns plan + raw output + duration. |
| lint_sqlA | Lint a SQL query. Returns issues array (error/warning/info). Advisory, never blocks. |
| get_query_historyB | Get recent query history. Filters: db, kind, since, until, onlyErrors, limit (default 50). v2.19: profileName (string | null) + groupBy='profile' (aggregates). |
| save_templateB | Save a parameterized SQL template. Reusable across team. Use ${param} placeholders. v2.19: optional profile_name. |
| list_templatesA | List saved templates. Optional tag filter. v2.19: profileName (null=global, name=local, omit=all). |
| get_templateB | Get one template by id. |
| delete_templateC | Delete a template by id. |
| execute_templateA | Execute a saved template with params. Returns query result + increments use_count. |
| create_profileA | 新建 profile 到 profiles.db(INSERT-only)。已存在同名 profile 抛 UNIQUE 约束错误,改用 update_profile。SQLite 类型不要传 config.filePath。[group: profiles] |
| update_profileA | 修改已存在的 profile(UPDATE-only)。profile 不存在抛错。use_count/created_at/created_by/id 不变。SQLite 类型不要传 config.filePath。[group: profiles] |
| list_profilesB | 列出 profile。支持 role/tag/enabled 过滤。[group: profiles] |
| use_profileA | 切换活跃连接到已存 profile。v4.0 修复后实际断开旧 adapter 并用 profile.config 新建连接(之前只设 activeProfile 字段但不切 adapter — Bug #4)。返回的 connection 字段反映新连接状态。 |
| get_global_schemaA | 合并所有启用 profile 的 schema (并行)。[group: profiles] |
| execute_scriptA | 执行多语句 SQL 脚本或 PL/SQL 块(最多 1000 条)。需要 permissions 包含 script。返回 lastResult 显示最后一条的 affectedRows,其他语句请用 SELECT 验证副作用。 |
| execute_sql_fileC | 执行 .sql 文件(最多 1000 条语句)。需要 permissions 包含 script + DB_ALLOWED_FILE_PATHS。⚠️ 路径必须在 DB_ALLOWED_FILE_PATHS 白名单内。 |
| execute_batchA | 批量执行同一条 SQL 的多个参数集(最多 1000 行)。需要 permissions 包含 batch。返回 affectedRowsPerStatement 数组,推荐用 SELECT 验证副作用以保证数据写入正确(v4.0 G8 流程改进)。 |
| generate_sample_dataC | 根据表结构自动生成并插入样例数据。需要 insert+batch 权限。完整 inputSchema 同上(Permission 控制由 CallToolRequest 强制执行)。 |
| export_profilesC | 导出 profiles 为 YAML/JSON。 |
| import_profilesC | 从 YAML/JSON 导入 profiles。 |
| get_profileC | 获取指定 profile 的配置。 |
| delete_profileA | 删除指定 profile。[group: profiles] ⚠️ v5.0.0: 破坏性操作,默认走 preview 路径(返回子目录内容摘要),需要 confirm=true 才真正删除 profiles.db 行 + ~/.universal-db-mcp// 子目录。 |
| enable_profileD | 启用 profile。 |
| disable_profileC | 禁用 profile。 |
| disconnect_profileC | 断开指定 profile 的连接。 |
| compare_profile_schemasA | 比较两个 profile 的 schema 差异。⚠️ 大库输出可能 >1MB;用 maxTablesPerProfile 限制避免截断。 |
| export_backupC | 导出 DB 到文件。 |
| audit_logC | 查询审计日志。 |
| get_pii_configB | 获取 PII 脱敏配置。 |
| set_pii_configC | 设置 PII 脱敏规则。 |
| export_table_csvA | 导出单表 (或自定义 SQL) 到 CSV 文件。table 与 sql 二选一;省略 outputPath 时默认写到 /sql/<表名>.csv。profileName 可选 — 省略时使用当前活跃连接。[group: data-governance] |
| import_csvB | 从 CSV 文件导入数据到已存在的表 (APPEND 模式)。需 write 权限。profileName 可选 — 省略时使用当前活跃连接。[group: data-governance] |
| explain_query_with_adviceC | EXPLAIN + 索引建议。⚠️ 不支持 ${} 模板占位符(会被作为 SQL 字面量传给 EXPLAIN → 语法错)。用字面量值或 ? + params 数组。 |
| compare_query_plansA | 比较两个保存的执行计划。⚠️ 需先对相同 queryHash 跑 ≥2 次 explain_query_with_advice({persist:true})。否则返回 "need at least 2 entries with the same queryHash"。 |
| list_query_plansC | 列出已保存的执行计划。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/joyous-coder/universal-db-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server