mcp-database-tools
mcp-database-tools
为 AI 代理提供 SQL 和数据库工具的 MCP 服务器。所有分析均在 SQL 文本上执行——无需实际数据库连接。
工具
sql_format
格式化并美化 SQL 查询,提供正确的缩进、大写关键字和对齐的列。支持 MySQL、PostgreSQL 和 SQLite 语法。
sql_explain
接收 SQL 查询并用通俗易懂的语言逐步解释其功能。识别查询类型、表、列、条件,并提供优化建议。
schema_analyze
解析 CREATE TABLE 语句以提取表、列、类型、约束、外键和索引。生成 Mermaid 格式的 ER 图。
query_build
根据自然语言描述构建 SQL 查询。支持常见模式,如按日期过滤、聚合、连接、排序和分页。
migration_generate
比较两个模式(旧版与新版 CREATE TABLE 语句)并生成 ALTER TABLE 迁移语句。同时生成 up(正向)和 down(回滚)迁移。
Related MCP server: DB MCP Server
安装
npm install
npm run build使用方法
与 Claude Desktop 配合使用
添加到你的 Claude Desktop 配置(claude_desktop_config.json)中:
{
"mcpServers": {
"database-tools": {
"command": "node",
"args": ["path/to/mcp-database-tools/dist/index.js"]
}
}
}独立使用
npm start开发
npm run build # Compile TypeScript
npm start # Run the server许可证
MIT
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 gradedqualityAmaintenanceEnables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.1,1183,147Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables executing SQL queries, schema introspection, and data management for PostgreSQL and MySQL databases via natural language, supporting local, SSH, and AWS RDS connections.92MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.1MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI tools to understand a database, inspect schema, and run safe SELECT queries with SQL guardrails, plus optional codebase reading.
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
JSON/YAML, regex, diff, JWT, SQL dialects — the keyless millisecond ops an agent needs mid-task.
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/rog0x/mcp-database-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server