GraphQL integration support is planned in the roadmap, potentially enabling AI assistants to interact with databases through GraphQL interfaces
Support for MySQL databases is planned in future releases, allowing schema inspection, query execution, and database operations
Support for PostgreSQL databases is planned in future releases, allowing schema inspection, query execution, and database operations
MCP SQL Server
A Model Context Protocol server that provides comprehensive access to SQL databases, starting with MSSQL support. This server enables AI assistants to inspect database schemas, execute queries, and perform database operations with enterprise-grade security and performance monitoring.
Current Status: MSSQL fully supported. MySQL and PostgreSQL support coming in future releases.
✨ Key Features
Database Support: Full MSSQL support (MySQL and PostgreSQL coming soon)
Schema Inspection: Comprehensive database structure analysis and metadata extraction
Query Execution: Safe SQL execution with parameterized queries and result formatting
Performance Monitoring: Real-time metrics, query statistics, and performance reports
Security First: SQL injection prevention, connection encryption, and access controls
Batch Operations: Efficient bulk query execution and transaction management
Connection Pooling: Optimized connection management with configurable pool settings
MCP Integration: Native support for Claude Desktop, Cursor, and other MCP-compatible tools
📦 Installation & Setup
Prerequisites
Node.js 18.0.0+ - Download here
Database Server: Microsoft SQL Server (MSSQL)
AI Assistant: Claude Desktop, Cursor, or any MCP-compatible tool
Note: Currently only MSSQL is supported. MySQL and PostgreSQL support will be added in future releases.
Quick Installation
Basic Configuration
Refer to
env.example
Create a .env
file with your database settings:
Test Connection
🚀 Quick Start
Local Environment
Clone the repository:
git clone https://github.com/ryudg/mcp-sql.git cd mcp-sqlInstall dependencies
npm installBuild the project
npm run buildAdd to your
mcp.json
orsetting.json
,claude_desktop_config.json
{ "mcpServers": { "mcp-sql": { "command": "node", "args": ["/full/path/to/mcp-mysql/build/index.js"], "env": { // "DB_TYPE": "mssql", # Current only MSSQL supported "DB_SERVER": "localhost", "DB_PORT": "1433", "DB_DATABASE": "your_database", "DB_USER": "your_username", "DB_PASSWORD": "your_password", "DB_ENCRYPT": "false", "DB_TRUST_SERVER_CERTIFICATE": "true", "NODE_ENV": "development", "LOG_LEVEL": "info" } } } }
Configure AI Assistant
For Claude Desktop:
Add to your claude_desktop_config.json
:
For Cursor(VSCode, Windsurf... etc IDE):
Add to your MCP settings:
Start Using
Restart your AI assistant and try:
💬 Usage Examples
Schema Exploration
Data Queries
Performance Monitoring
🛠️ Available Tools
The MCP SQL server provides the following tools for database interaction:
Schema & Discovery Tools
Tool | Description | Parameters |
| List all tables in database |
(optional): Filter pattern |
| Get detailed table structure |
: Name of table to describe |
| Get complete database schema |
: Include system tables |
| Get schema statistics information | None |
Query Execution Tools
Tool | Description | Parameters |
| Execute SQL queries safely |
: SQL statement
: Bind parameters |
| Process multiple queries in batch |
: Array of SQL statements |
Performance & Monitoring Tools
Tool | Description | Parameters |
| Get database connection pool status | None |
| Get query execution statistics |
: Time period (optional) |
| Start performance monitoring |
: Monitoring interval (ms) |
| Generate performance analysis report |
: Report period |
| Initialize cache data | None |
🛡️ Security
Connection Encryption: TLS/SSL connection support
Parameter Binding: SQL injection prevention
Access Control: Database user permission-based control
Logging: Complete query execution logging
Input Validation: Comprehensive input sanitization
Security Best Practices
Use dedicated database users with minimal required permissions
Enable SSL/TLS encryption for database connections when possible
Use connection pooling with appropriate limits
Never commit credentials to version control
Use environment variables for all sensitive configuration
🗺️ Roadmap
Upcoming Features
🔮 Multi-Database Support
MySQL adapter implementation
PostgreSQL adapter implementation
Unified database interface
⚡ Performance & Caching
Query result caching system
Advanced performance optimization
Connection pool enhancements
🧪 Testing & Quality
Comprehensive test coverage (100%)
Automated CI/CD pipeline
Performance benchmarking
🚀 Advanced Features
GraphQL integration support
Enhanced monitoring dashboard
Plugin architecture for extensibility
📊 Analytics & Insights
Advanced query analytics
Database performance insights
Usage statistics and reporting
Support & Community
📋 Issues: Report bugs or request features
💬 Discussions: Community discussions and Q&A
📖 Documentation: Comprehensive guides and API docs
📝 License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with for the AI-powered development community
MCP SQL Server v1.0.0 - Bridging AI and databases
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.Last updated -48MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.Last updated -238MIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated -7MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.Last updated -8192MIT License