- Home
- MCP servers
- MCP SQL Server
MCP SQL Server
- typescript
7
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"ryudg-mcp-sql": {
"command": "node",
"args": [
"/full/path/to/mcp-mysql/build/index.js"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_TYPE": "mssql",
"DB_USER": "your_username",
"NODE_ENV": "development",
"DB_SERVER": "localhost",
"LOG_LEVEL": "info",
"DB_ENCRYPT": "false",
"DB_DATABASE": "your_database",
"DB_PASSWORD": "your_password",
"DB_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}You can connect your AI assistants to MSSQL databases through this MCP server to inspect schemas, run safe queries, and monitor performance with enterprise-grade security. It bridges your database with MCP-compatible tools so you can work with data efficiently and securely.
How to use
You interact with the MCP SQL Server through an MCP client like Claude Desktop or Cursor. You can explore database structures, run parameterized queries, manage batches, and observe real-time performance metrics. Use natural language prompts to describe what you want to do, and the MCP server translates those requests into safe SQL operations against your MSSQL database.
How to install
Prerequisites ensure your environment can host the MCP server and connect to MSSQL.
# Prerequisites
- Node.js 18.0.0+
- Microsoft SQL Server (MSSQL)
- An MCP-compatible AI assistant (e.g., Claude Desktop, Cursor)
Install the MCP SQL server package globally so you can run it from anywhere.
# Install globally via NPM
npm install -g @donggyunryu/mcp-sql
Prepare your database connection settings in a configuration file. You can start with these example settings, adjusting them to your environment.
# .env example
DB_TYPE=mssql # Current only MSSQL supported
DB_HOST=localhost
DB_PORT=1433
DB_DATABASE=your_database
DB_USER=your_username
DB_PASSWORD=your_password
DB_ENCRYPT=false
DB_TRUST_SERVER_CERTIFICATE=true
Test that the server can reach your database after configuring. Use the provided test command to verify connectivity.
# Test your database connection
npm run test:db
# or
npx @donggyunryu/mcp-sql test:db
Configuration for MCP clients
{
"mcpServers": {
"mcp_sql": {
"command": "node",
"args": ["/full/path/to/mcp-mysql/build/index.js"],
"env": {
"DB_TYPE": "mssql",
"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"
}
}
}
}
Available tools
list_tables
List all tables in the connected database, optionally filtered by a pattern.
describe_table
Provide detailed metadata for a specific table, including columns and data types.
get_schema
Return the complete database schema, including tables, columns, and relationships.
get_schema_statistics
Return statistics about the database schema, such as table counts and index usage.
execute_query
Safely execute a SQL query with bound parameters and return results.
start_batch_processing
Process multiple SQL statements in a single batch and manage transactions.
get_connection_pool_status
Display the current status of the database connection pool.
get_query_stats
Retrieve execution statistics for queries over a specified period.
start_performance_monitoring
Begin continuous monitoring of performance metrics at a defined interval.
generate_performance_report
Create a performance analysis report for a given time range.
clear_caches
Initialize or refresh cached query results and metadata.