{"id":26937310,"url":"https://github.com/FreePeak/db-mcp-server","last_synced_at":"2025-04-02T13:15:10.422Z","repository":{"id":282957717,"uuid":"950227197","full_name":"FreePeak/db-mcp-server","owner":"FreePeak","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T04:26:49.000Z","size":294703,"stargazers_count":61,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T04:29:27.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreePeak.png","metadata":{"files":{"readme":"README-old.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"linhdmn","thanks_dev":null,"custom":null}},"created_at":"2025-03-17T20:40:28.000Z","updated_at":"2025-04-01T04:26:52.000Z","dependencies_parsed_at":"2025-04-01T04:37:38.450Z","dependency_job_id":null,"html_url":"https://github.com/FreePeak/db-mcp-server","commit_stats":null,"previous_names":["freepeak/db-mcp-server"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreePeak%2Fdb-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreePeak%2Fdb-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreePeak%2Fdb-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreePeak%2Fdb-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreePeak","download_url":"https://codeload.github.com/FreePeak/db-mcp-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819771,"owners_count":20839095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T13:15:07.705Z","updated_at":"2025-04-02T13:15:10.411Z","avatar_url":"https://github.com/FreePeak.png","language":"Go","funding_links":["https://buymeacoffee.com/linhdmn","https://www.buymeacoffee.com/linhdmn","https://img.buymeacoffee.com/button-api/?text=Support"],"categories":["Databases","Database \u0026 Messaging MCP Servers","📚 Projects (1974 total)","MCP 服务器精选列表","MCP Servers \u0026 Integrations","پیاده‌سازی‌های سرور","⚙️ DevOps","Table of Contents","MCP Servers","Cloud Services","Uncategorized"],"sub_categories":["Multi-Database Tools","MCP Servers","🗄️ 数据库交互","Other IDEs","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","AI Services","🗄️ Databases","Uncategorized","Databases"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Multi DB MCP Server\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Go Report Card](https://goreportcard.com/badge/github.com/FreePeak/db-mcp-server)](https://goreportcard.com/report/github.com/FreePeak/db-mcp-server)\n[![Go Reference](https://pkg.go.dev/badge/github.com/FreePeak/db-mcp-server.svg)](https://pkg.go.dev/github.com/FreePeak/db-mcp-server)\n[![Contributors](https://img.shields.io/github/contributors/FreePeak/db-mcp-server)](https://github.com/FreePeak/db-mcp-server/graphs/contributors)\n\n\u003ch3\u003eA robust multi-database implementation of the Database Model Context Protocol (DB MCP)\u003c/h3\u003e\n\n[Features](#key-features) • [AI Benefits](#ai-integration-benefits) • [Installation](#installation) • [Usage](#usage) • [Documentation](#documentation) • [Contributing](#contributing) • [License](#license)\n\n\u003c/div\u003e\n\n---\n\n## 📋 Overview\n\nThe DB MCP Server is a high-performance implementation of the Database Model Context Protocol designed to revolutionize how AI agents interact with databases. By creating a standardized communication layer between AI models and database systems, it enables AI agents to discover, understand, and manipulate database structures with unprecedented context awareness. Currently supporting MySQL and PostgreSQL databases, with plans to expand to most widely used databases including NoSQL solutions, DB MCP Server eliminates the knowledge gap between AI agents and your data, enabling more intelligent, context-aware database operations that previously required human expertise.\n\n## ✨ Key Features\n\n- **AI-Optimized Context Protocol**: Provides rich database context to AI agents, enabling them to reason about schema, relationships, and data patterns\n- **Semantic Understanding Bridge**: Translates between natural language queries and database operations with full schema awareness\n- **Contextual Database Operations**: Allows AI agents to execute database operations with full understanding of schema, constraints, and relationships\n- **Multi-Database Support**: Currently supports MySQL and PostgreSQL with plans for expansion\n- **Dynamic Tool Registry**: Register, discover, and invoke database tools at runtime via standard protocol AI agents can understand\n- **Editor Integration**: First-class support for VS Code and Cursor extensions with AI-aware features\n- **Schema-Aware Assistance**: Provides AI models with complete database structure knowledge for better suggestions\n- **Performance Insights**: Delivers performance analytics that AI can leverage for optimization recommendations\n\n## 🧠 AI Integration Benefits\n\nThe DB MCP Server transforms how AI agents interact with databases in several key ways:\n\n### Enhanced Contextual Understanding\n- **Schema Awareness**: AI agents gain complete knowledge of database tables, columns, relationships, and constraints\n- **Semantic Relationship Mapping**: Enables AI to understand not just structure but meaning and purpose of data elements\n- **Query Context Preservation**: Maintains context between related operations for coherent multi-step reasoning\n\n### Intelligent Database Operations\n- **Natural Language to SQL**: Translates user intent into optimized database operations with full schema awareness\n- **Context-Aware Query Generation**: Creates queries that respect database structure, types, and relationships\n- **Error Prevention**: Understands database constraints before execution, preventing common errors\n- **Optimization Suggestions**: Provides AI with execution metrics for intelligent query improvement recommendations\n\n### Workflow Optimization\n- **Reduced Context Window Usage**: Efficiently provides database structure without consuming AI token context\n- **Operation Chaining**: Enables complex multi-step operations with persistent context\n- **Intelligent Defaults**: Suggests appropriate actions based on database structure and common patterns\n- **Progressive Disclosure**: Reveals database complexity progressively as needed by the AI agent\n\n## 🚀 Installation\n\n### Prerequisites\n\n- Go 1.18 or later\n- Supported databases:\n  - MySQL\n  - PostgreSQL\n  - (Additional databases in roadmap)\n- Docker (optional, for containerized deployment)\n\n### Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/FreePeak/db-mcp-server.git\ncd db-mcp-server\n\n# Copy and configure environment variables\ncp .env.example .env\n# Edit .env with your configuration\n\n# Option 1: Build and run locally with SSE transport (default)\nmake build\n./mcp-server\n\n# Option 2: Build and run with STDIO transport\nmake build\n./mcp-server -t stdio\n\n# Option 3: Using Docker\ndocker build -t db-mcp-server .\ndocker run -p 9090:9090 db-mcp-server\n\n# Option 4: Using Docker Compose (with MySQL)\ndocker-compose up -d\n```\n\n### Transport Modes\n\nThe server supports two transport modes:\n\n1. **SSE (Server-Sent Events)** - Default mode for browser and HTTP clients\n   ```bash\n   ./mcp-server -t sse\n   ```\n\n2. **STDIO (Standard Input/Output)** - For command-line tools and integrations\n   ```bash\n   ./mcp-server -t stdio\n   ```\n   \nFor STDIO mode, see the [examples directory](./examples) for usage examples.\n\n### Docker\n\n```bash\n# Build the Docker image\ndocker build -t db-mcp-server .\n\n# Run the container\ndocker run -p 9090:9090 db-mcp-server\n\n# Run with custom configuration\ndocker run -p 8080:8080 \\\n  -e SERVER_PORT=8080 \\\n  -e LOG_LEVEL=debug \\\n  -e DB_TYPE=mysql \\\n  -e DB_HOST=my-database-server \\\n  db-mcp-server\n  \n# Run with Docker Compose (includes MySQL database)\ndocker-compose up -d\n```\n\n## 🔧 Configuration\n\nDB MCP Server can be configured via environment variables or a `.env` file:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `SERVER_PORT` | Server port | `9092` |\n| `TRANSPORT_MODE` | Transport mode (stdio, sse) | `stdio` |\n| `LOG_LEVEL` | Logging level (debug, info, warn, error) | `debug` |\n| `DB_TYPE` | Database type (mysql, postgres) | `mysql` |\n| `DB_HOST` | Database host | `localhost` |\n| `DB_PORT` | Database port | `3306` |\n| `DB_USER` | Database username | `iamrevisto` |\n| `DB_PASSWORD` | Database password | `password` |\n| `DB_NAME` | Database name | `revisto` |\n| `DB_ROOT_PASSWORD` | Database root password (for container setup) | `root_password` |\n\nSee `.env.example` for more configuration options.\n\n## 📖 Usage\n\n### Integrating with Cursor Edit and AI Agents\n\nDB MCP Server creates a powerful bridge between your databases and AI assistants in Cursor Edit, enabling AI-driven database operations with full context awareness. Configure your Cursor settings in `.cursor/mcp.json`:\n\n```json\n{\n    \"mcpServers\": {\n        \"db-mcp-server\": {\n            \"url\": \"http://localhost:9090/sse\"\n        }\n    }\n}\n```\n\nTo leverage AI-powered database operations:\n\n1. Configure and start the DB MCP Server using one of the installation methods above\n2. Add the configuration to your Cursor settings\n3. Open Cursor and navigate to a SQL or code file\n4. The AI assistant now has access to your database schema, relationships, and capabilities\n5. Ask the AI to generate, explain, or optimize database queries with full schema awareness\n6. Execute AI-generated queries directly from Cursor\n\nThe MCP Server enhances AI assistant capabilities with:\n\n- Complete database schema understanding\n- Relationship-aware query generation\n- Intelligent query optimization recommendations\n- Error prevention through constraint awareness\n- Performance metrics for better suggestions\n- Context persistence across multiple operations\n\n### Example AI Interactions\n\n```\n# Ask the AI for schema information\n\"What tables are in the database and how are they related?\"\n\n# Request query generation with context\n\"Create a query to find all orders from customers in California with items over $100\"\n\n# Get optimization suggestions\n\"How can I optimize this query that's taking too long to execute?\"\n\n# Request complex data operations\n\"Help me create a transaction that updates inventory levels when an order is placed\"\n```\n\n## 📚 Documentation\n\n### DB MCP Protocol for AI Integration\n\nThe server implements the DB MCP protocol with methods specifically designed to enhance AI agent capabilities:\n\n- **initialize**: Sets up the session, transmits schema context, and returns server capabilities\n- **tools/list**: Enables AI agents to discover available database tools dynamically\n- **tools/call**: Allows AI to execute database tools with full context\n- **editor/context**: Updates the server with editor context for better AI awareness\n- **schema/explore**: Provides AI with detailed database structure information\n- **cancel**: Cancels an in-progress operation\n\nFor full protocol documentation, visit the [MCP Specification](https://github.com/microsoft/mcp) and our database-specific extensions for AI integration.\n\n### Tool System\n\nThe DB MCP Server includes a powerful AI-aware tool system that provides large language models and AI assistants with a structured way to discover and invoke database tools. Each tool has:\n\n- A unique name discoverable by AI\n- A comprehensive description that AI can understand\n- A JSON Schema for input validation and AI parameter generation\n- A structured output format that AI can parse and reason about\n- A handler function that executes the tool's logic with context awareness\n\nThis structure enables AI agents to intelligently select, parameterize, and invoke the right database operations without requiring hard-coded knowledge of your specific database schema.\n\n### Built-in Tools for AI Integration\n\nThe server includes AI-optimized database tools that provide rich context and capabilities:\n\n| Tool | Description | AI Benefits |\n|------|-------------|------------|\n| `dbQuery` | Executes read-only SQL queries with parameterized inputs | Enables AI to retrieve data with full schema knowledge |\n| `dbExecute` | Performs data modification operations (INSERT, UPDATE, DELETE) | Allows AI to safely modify data with constraint awareness |\n| `dbTransaction` | Manages SQL transactions with commit and rollback support | Supports AI in creating complex multi-step operations |\n| `dbSchema` | Auto-discovers database structure and relationships | Provides AI with complete schema context for reasoning |\n| `dbQueryBuilder` | Visual SQL query construction with syntax validation | Helps AI create syntactically correct queries |\n| `dbPerformanceAnalyzer` | Identifies slow queries and provides optimization suggestions | Enables AI to suggest performance improvements |\n| `showConnectedDatabases` | Shows information about all connected databases | Enables AI to understand available database connections and their status |\n\n### Multiple Database Support\n\nDB MCP Server supports connecting to multiple databases simultaneously, allowing AI agents to work across different database systems in a unified way. Each database connection is identified by a unique ID that can be referenced when using database tools.\n\n#### Configuring Multiple Databases\nIn your .env file\n```\n# Multi-Database Configuration\nDB_CONFIG_FILE=config/databases.json\n```\nConfigure multiple database connections in your `db-mcp-server/config/databases.json` file or environment variables:\n\n```\n# Multiple Database Configuration\n{\n  \"connections\": [\n    {\n      \"id\": \"mysql1\",\n      \"type\": \"mysql\",\n      \"host\": \"localhost\",\n      \"port\": 13306,\n      \"user\": \"user1\",\n      \"password\": \"password1\",\n      \"name\": \"db1\"\n    },\n    {\n      \"id\": \"mysql2\",\n      \"type\": \"mysql\",\n      \"host\": \"localhost\",\n      \"port\": 13307,\n      \"user\": \"user3\",\n      \"password\": \"password3\",\n      \"name\": \"db3\"\n    },\n    {\n      \"id\": \"postgres1\",\n      \"type\": \"postgres\",\n      \"host\": \"localhost\",\n      \"port\": 15432,\n      \"user\": \"user2\",\n      \"password\": \"password2\",\n      \"name\": \"db2\"\n    }\n  ]\n} \n```\n\n#### Viewing Connected Databases\n\nUse the `showConnectedDatabases` tool to see all connected databases with their status and connection information:\n\n```json\n// Get information about all connected databases\n{\n  \"name\": \"showConnectedDatabases\"\n}\n```\n\nExample response:\n\n```json\n[\n  {\n    \"id\": \"mysql1\",\n    \"type\": \"mysql\",\n    \"host\": \"localhost\",\n    \"port\": 3306,\n    \"database\": \"db1\",\n    \"status\": \"connected\",\n    \"latency\": \"1.2ms\"\n  },\n  {\n    \"id\": \"postgres1\",\n    \"type\": \"postgres\",\n    \"host\": \"localhost\",\n    \"port\": 5432,\n    \"database\": \"db2\",\n    \"status\": \"connected\",\n    \"latency\": \"0.8ms\"\n  }\n]\n```\n\n#### Specifying Database for Operations\n\nWhen using database tools, you must specify which database to use with the `database` parameter:\n\n```json\n// Query a specific database by ID\n{\n  \"name\": \"dbQuery\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"query\": \"SELECT * FROM users LIMIT 10\"\n  }\n}\n\n// Execute statement on a specific database\n{\n  \"name\": \"dbExecute\",\n  \"arguments\": {\n    \"database\": \"mysql2\",\n    \"statement\": \"UPDATE products SET stock = stock - 1 WHERE id = 5\"\n  }\n}\n\n// Get schema from a specific database\n{\n  \"name\": \"dbSchema\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"component\": \"tables\"\n  }\n}\n```\n\n\u003e **Note**: Always use `database` as the parameter name when specifying which database to use. This is required for all database operation tools.\n\nIf your configuration has only one database connection, you must still provide the database ID that matches the ID in your configuration.\n\n### Database Schema Explorer Tool\n\nThe MCP Server includes an AI-aware Database Schema Explorer tool (`dbSchema`) that provides AI models with complete database structural knowledge:\n\n```json\n// Get all tables in the database - enables AI to understand available data entities\n{\n  \"name\": \"dbSchema\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"component\": \"tables\"\n  }\n}\n\n// Get columns for a specific table - gives AI detailed field information\n{\n  \"name\": \"dbSchema\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"component\": \"columns\",\n    \"table\": \"users\"\n  }\n}\n\n// Get relationships for a specific table or all relationships - helps AI understand data connections\n{\n  \"name\": \"dbSchema\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"component\": \"relationships\",\n    \"table\": \"orders\"\n  }\n}\n\n// Get the full database schema - provides AI with comprehensive structural context\n{\n  \"name\": \"dbSchema\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"component\": \"full\"\n  }\n}\n```\n\nThe Schema Explorer supports both MySQL and PostgreSQL databases, automatically adapting to your configured database type and providing AI with the appropriate contextual information.\n\n### Visual Query Builder Tool\n\nThe MCP Server includes a powerful Visual Query Builder tool (`dbQueryBuilder`) that helps you construct SQL queries with syntax validation:\n\n```json\n// Validate a SQL query for syntax errors\n{\n  \"name\": \"dbQueryBuilder\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"validate\",\n    \"query\": \"SELECT * FROM users WHERE status = 'active'\"\n  }\n}\n\n// Build a SQL query from components\n{\n  \"name\": \"dbQueryBuilder\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"action\": \"build\",\n    \"components\": {\n      \"select\": [\"id\", \"name\", \"email\"],\n      \"from\": \"users\",\n      \"where\": [\n        {\n          \"column\": \"status\",\n          \"operator\": \"=\",\n          \"value\": \"active\"\n        }\n      ],\n      \"orderBy\": [\n        {\n          \"column\": \"name\",\n          \"direction\": \"ASC\"\n        }\n      ],\n      \"limit\": 10\n    }\n  }\n}\n\n// Analyze a SQL query for potential issues and performance\n{\n  \"name\": \"dbQueryBuilder\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"analyze\",\n    \"query\": \"SELECT u.*, o.* FROM users u JOIN orders o ON u.id = o.user_id WHERE u.status = 'active' AND o.created_at \u003e '2023-01-01'\"\n  }\n}\n```\n\nExample response from a query build operation:\n\n```json\n{\n  \"query\": \"SELECT id, name, email FROM users WHERE status = 'active' ORDER BY name ASC LIMIT 10\",\n  \"components\": {\n    \"select\": [\"id\", \"name\", \"email\"],\n    \"from\": \"users\",\n    \"where\": [{\n      \"column\": \"status\",\n      \"operator\": \"=\",\n      \"value\": \"active\"\n    }],\n    \"orderBy\": [{\n      \"column\": \"name\",\n      \"direction\": \"ASC\"\n    }],\n    \"limit\": 10\n  },\n  \"validation\": {\n    \"valid\": true,\n    \"query\": \"SELECT id, name, email FROM users WHERE status = 'active' ORDER BY name ASC LIMIT 10\"\n  }\n}\n```\n\nThe Query Builder supports:\n- SELECT statements with multiple columns\n- JOIN operations (inner, left, right, full)\n- WHERE conditions with various operators\n- GROUP BY and HAVING clauses\n- ORDER BY with sorting direction\n- LIMIT and OFFSET for pagination\n- Syntax validation and error suggestions\n- Query complexity analysis\n\n### Performance Analyzer Tool\n\nThe MCP Server includes a powerful Performance Analyzer tool (`dbPerformanceAnalyzer`) that identifies slow queries and provides optimization suggestions:\n\n```json\n// Get slow queries that exceed the configured threshold\n{\n  \"name\": \"dbPerformanceAnalyzer\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"getSlowQueries\",\n    \"limit\": 5\n  }\n}\n\n// Get metrics for all tracked queries sorted by average duration\n{\n  \"name\": \"dbPerformanceAnalyzer\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"action\": \"getMetrics\",\n    \"limit\": 10\n  }\n}\n\n// Analyze a specific query for optimization opportunities\n{\n  \"name\": \"dbPerformanceAnalyzer\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"analyzeQuery\",\n    \"query\": \"SELECT * FROM orders JOIN users ON orders.user_id = users.id WHERE orders.status = 'pending'\"\n  }\n}\n\n// Reset all collected performance metrics\n{\n  \"name\": \"dbPerformanceAnalyzer\",\n  \"arguments\": {\n    \"database\": \"postgres1\",\n    \"action\": \"reset\"\n  }\n}\n\n// Set the threshold for identifying slow queries (in milliseconds)\n{\n  \"name\": \"dbPerformanceAnalyzer\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"setThreshold\",\n    \"threshold\": 300\n  }\n}\n```\n\nExample response from a performance analysis:\n\n```json\n{\n  \"query\": \"SELECT * FROM orders JOIN users ON orders.user_id = users.id WHERE orders.status = 'pending'\",\n  \"suggestions\": [\n    \"Avoid using SELECT * - specify only the columns you need\",\n    \"Verify that ORDER BY columns are properly indexed\",\n    \"Consider adding appropriate indexes for frequently queried columns\"\n  ]\n}\n```\n\nExample response from getting slow queries:\n\n```json\n{\n  \"metrics\": [\n    {\n      \"query\": \"SELECT * FROM large_table WHERE status = ?\",\n      \"count\": 15,\n      \"totalDuration\": \"2.5s\",\n      \"minDuration\": \"120ms\",\n      \"maxDuration\": \"750ms\",\n      \"avgDuration\": \"166ms\",\n      \"lastExecuted\": \"2025-06-15T14:23:45Z\"\n    },\n    {\n      \"query\": \"SELECT order_id, SUM(amount) FROM order_items GROUP BY order_id\",\n      \"count\": 8,\n      \"totalDuration\": \"1.2s\",\n      \"minDuration\": \"110ms\",\n      \"maxDuration\": \"580ms\",\n      \"avgDuration\": \"150ms\",\n      \"lastExecuted\": \"2025-06-15T14:20:12Z\"\n    }\n  ],\n  \"count\": 2,\n  \"threshold\": \"100ms\"\n}\n```\n\nThe Performance Analyzer automatically tracks all query executions and provides:\n- Identification of slow-performing queries\n- Query execution metrics (count, min, max, average durations)\n- Pattern-based query analysis\n- Optimization suggestions\n- Performance trend monitoring\n- Configurable slow query thresholds\n\n### Database Transactions Tool\n\nFor operations that require transaction support, use the `dbTransaction` tool:\n\n```json\n// Begin a transaction\n{\n  \"name\": \"dbTransaction\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"begin\",\n    \"readOnly\": false\n  }\n}\n\n// Execute a statement within the transaction\n{\n  \"name\": \"dbTransaction\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"execute\",\n    \"transactionId\": \"tx-1684785421293\", // ID returned from the begin operation\n    \"statement\": \"INSERT INTO orders (customer_id, amount) VALUES (?, ?)\",\n    \"params\": [\"123\", \"450.00\"]\n  }\n}\n\n// Commit the transaction\n{\n  \"name\": \"dbTransaction\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"commit\",\n    \"transactionId\": \"tx-1684785421293\"\n  }\n}\n\n// Rollback the transaction (in case of errors)\n{\n  \"name\": \"dbTransaction\",\n  \"arguments\": {\n    \"database\": \"mysql1\",\n    \"action\": \"rollback\",\n    \"transactionId\": \"tx-1684785421293\"\n  }\n}\n```\n\n### Editor Integration\n\nThe server includes support for editor-specific features through the `editor/context` method, enabling tools to be aware of:\n\n- Current SQL file\n- Selected query\n- Cursor position\n- Open database connections\n- Database structure\n\n## 🗺️ Roadmap\n\nWe're committed to expanding DB MCP Server's AI integration capabilities. Here's our planned development roadmap:\n\n### Q2 2025\n- ✅ **AI-Aware Schema Explorer** - Auto-discover database structure and relationships for AI context\n- ✅ **Context-Aware Query Builder** - AI-driven SQL query construction with syntax validation\n- ✅ **Performance Analyzer with AI Insights** - Identify optimization opportunities with AI recommendations\n\n### Q3 2025\n- **AI-Powered Data Visualization** - Create charts and graphs from query results with AI suggestions\n- **AI-Driven Model Generator** - Auto-generate code models from database tables using AI patterns\n- **Multi-DB Support Expansion with Cross-DB AI Reasoning** - Add support with AI that understands:\n  - **MongoDB** - Document-oriented schema for AI reasoning\n  - **Redis** - Key-value pattern recognition for AI\n  - **SQLite** - Lightweight database understanding\n\n### Q4 2025\n- **AI-Assisted Migration Manager** - Version-controlled schema changes with AI recommendations\n- **Intelligent Access Control** - AI-aware permissions for database operations\n- **Context-Enriched Query History** - Track queries with execution metrics for AI learning\n- **Additional Database Integrations with AI Context**:\n  - **Cassandra** - Distributed schema understanding\n  - **Elasticsearch** - Search-optimized AI interactions\n  - **DynamoDB** - NoSQL reasoning capabilities\n  - **Oracle** - Enterprise schema comprehension\n\n### Future Vision\n- **Complete Database Coverage with Unified AI Context** - Support for all major databases with consistent AI interface\n- **AI-Assisted Query Optimization** - Smart recommendations using machine learning\n- **Cross-Database AI Operations** - Unified interface for heterogeneous database environments\n- **Real-Time Collaborative AI** - Multi-user AI assistance for collaborative database work\n- **AI-Powered Plugin System** - Community-driven extension marketplace with AI discovery\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how you can help:\n\n1. **Fork** the repository\n2. **Create** a feature branch: `git checkout -b new-feature`\n3. **Commit** your changes: `git commit -am 'Add new feature'` \n4. **Push** to the branch: `git push origin new-feature`\n5. **Submit** a pull request\n\nPlease make sure your code follows our coding standards and includes appropriate tests.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 📧 Support \u0026 Contact\n\n- For questions or issues, email [mnhatlinh.doan@gmail.com](mailto:mnhatlinh.doan@gmail.com)\n- Open an issue directly: [Issue Tracker](https://github.com/FreePeak/db-mcp-server/issues)\n- If DB MCP Server helps your work, please consider supporting:\n\n\u003cp align=\"\"\u003e\n\u003ca href=\"https://www.buymeacoffee.com/linhdmn\"\u003e\n\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Support DB MCP Server\u0026emoji=☕\u0026slug=linhdmn\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff\" \nalt=\"Buy Me A Coffee\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreePeak%2Fdb-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFreePeak%2Fdb-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreePeak%2Fdb-mcp-server/lists"}