Supports configuration through .env files for storing SQL Server connection details and other environment-specific settings.
Built on Node.js 20+ runtime, required for running the MCP server.
Implemented using TypeScript 5.0+, providing type safety for the MCP server codebase.
Uses Zod for comprehensive input validation of SQL queries and parameters.
MCP SQL Server
A Model Context Protocol (MCP) server that enables AI agents to interact with Microsoft SQL Server databases through secure, intelligent database operations. This server provides comprehensive CRUD capabilities, schema introspection, stored procedure execution, transaction management, and bulk operations for production SQL Server environments.
🌟 Features
Core Database Operations
- CRUD Operations: Complete SELECT, INSERT, UPDATE, DELETE functionality
- Custom Queries: Safe execution of custom SELECT statements with security restrictions
- Schema Introspection: Database, table, column, index, and foreign key exploration
- Connection Management: Robust connection pooling with automatic reconnection
Advanced Operations (v1.1.0)
- Stored Procedures: Execute stored procedures with parameters, multiple result sets, and output parameters
- Transaction Management: BEGIN/COMMIT/ROLLBACK operations with isolation levels and savepoints
- Bulk Operations: High-performance bulk insert, batch update/delete, and data import (CSV/JSON)
Security & Safety
- Parameterized Queries: Full SQL injection prevention
- Query Restrictions: DDL operations blocked in custom queries
- Input Validation: Comprehensive Zod-based validation
- Connection Validation: Health checks and timeout controls
🚀 Quick Start
Prerequisites
- Node.js 20+
- TypeScript 5.0+
- Microsoft SQL Server (2016+)
- Claude Desktop or MCP-compatible client
Installation
Option 1: NPX (Recommended)
Option 2: Global Installation
Option 3: From Source
Configuration
Create a .env
file with your SQL Server configuration:
Claude Desktop Integration
Add to your Claude Desktop MCP settings (claude_desktop_config.json
):
Option 1: Using NPX (Recommended)
Option 2: Global Installation
Option 3: From Source
Note: For options 2 and 3, create a .env
file in the appropriate directory with your SQL Server configuration.
🛠 Available Tools
Core Database Operations (10 tools)
sql_test_connection
- Database connectivity testingsql_select
- Advanced SELECT queries with filtering and joinssql_insert
- Safe record insertionsql_update
- Conditional record updatessql_delete
- Safe record deletionsql_query
- Custom SELECT statement executionsql_get_tables
- Database table listingsql_get_columns
- Table column informationsql_get_table_structure
- Complete table structure analysissql_get_schemas
- Database schema exploration
Stored Procedures (3 tools)
sql_execute_stored_procedure
- Execute stored procedures with parameterssql_get_stored_procedures
- List all stored proceduressql_get_stored_procedure_info
- Get detailed stored procedure information
Transaction Management (5 tools)
sql_begin_transaction
- Start database transactions with isolation levelssql_commit_transaction
- Commit active transactionssql_rollback_transaction
- Rollback transactions or to savepointssql_create_savepoint
- Create transaction savepointssql_get_transaction_status
- Check current transaction status
Bulk Operations (4 tools)
sql_bulk_insert
- High-performance bulk insert operationssql_batch_update
- Batch update multiple recordssql_batch_delete
- Batch delete multiple recordssql_import_data
- Import data from CSV/JSON formats
Total: 22 tools available
📚 Usage Examples
Basic Query
Stored Procedure Execution
Bulk Insert
Transaction Management
🗺️ Roadmap
- v1.1.0 (Current): Enhanced database operations with stored procedures, transactions, and bulk operations
- v1.2.0 (Q3 2025): Data Analysis & Insights - 15 new analytics and export tools
- v1.3.0 (Q4 2025): Advanced Query Builder - Natural language processing and query templates
- v1.4.0 (Q1 2026): Enterprise Features - Multi-database support and security auditing
- v2.0.0 (Mid-2026): AI-Enhanced Features - Full AI assistant capabilities
See ROADMAP.md for detailed feature plans.
🔧 Development
Scripts
npm run build
- Build TypeScript to JavaScriptnpm run dev
- Run in development modenpm start
- Start the compiled servernpm test
- Run testsnpm run lint
- Lint TypeScript filesnpm run typecheck
- Type check without emitting
Project Structure
🛡️ Security
- All queries use parameterized inputs to prevent SQL injection
- DDL operations are blocked in custom queries
- Connection validation and timeout controls
- Comprehensive input validation using Zod schemas
- Production-ready error handling and logging
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
See ROADMAP.md for priority areas and upcoming features.
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
🏢 About
Developed and maintained by Bilims.
For support, feature requests, or bug reports, please open an issue.
⚡ Ready to supercharge your SQL Server operations with AI? Get started today!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol (MCP) server that enables AI agents to interact with Microsoft SQL Server databases through secure, intelligent database operations. This server provides comprehensive CRUD capabilities, schema introspection, stored procedure execution, transaction management, and bulk opera
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 -39PythonMIT 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 -1185PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables AI assistants to interact with MySQL databases by executing SQL queries and checking database connectivity.Last updated -TypeScriptMIT License
- AsecurityFlicenseAqualityAn all-in-one Model Context Protocol (MCP) server that connects your coding AI to numerous databases, data warehouses, data pipelines, and cloud services, streamlining development workflow through seamless integrations.Last updated -2Python