
MSSQL MCP Server
A Model Context Protocol server that enables LLMs like Claude to interact with Microsoft SQL Server databases through natural language, supporting queries, data manipulation, and table management.
Tools
insert_data
Inserts data into an MSSQL Database table. Supports both single record insertion and multiple record insertion using standard SQL INSERT with VALUES clause. FORMAT EXAMPLES: Single Record Insert: { "tableName": "Users", "data": { "name": "John Doe", "email": "john@example.com", "age": 30, "isActive": true, "createdDate": "2023-01-15" } } Multiple Records Insert: { "tableName": "Users", "data": [ { "name": "John Doe", "email": "john@example.com", "age": 30, "isActive": true, "createdDate": "2023-01-15" }, { "name": "Jane Smith", "email": "jane@example.com", "age": 25, "isActive": false, "createdDate": "2023-01-16" } ] } GENERATED SQL FORMAT: - Single: INSERT INTO table (col1, col2) VALUES (@param1, @param2) - Multiple: INSERT INTO table (col1, col2) VALUES (@param1, @param2), (@param3, @param4), ... IMPORTANT RULES: - For single record: Use a single object for the 'data' field - For multiple records: Use an array of objects for the 'data' field - All objects in array must have identical column names - Column names must match the actual database table columns exactly - Values should match the expected data types (string, number, boolean, date) - Use proper date format for date columns (YYYY-MM-DD or ISO format)
read_data
Executes a SELECT query on an MSSQL Database table. The query must start with SELECT and cannot contain any destructive SQL operations for security reasons.
describe_table
Describes the schema (columns and types) of a specified MSSQL Database table.
update_data
Updates data in an MSSQL Database table using a WHERE clause. The WHERE clause must be provided for security.
create_table
Creates a new table in the MSSQL Database with the specified columns.
create_index
Creates an index on a specified column or columns in an MSSQL Database table
drop_table
Drops a table from the MSSQL Database.
list_table
Lists tables in an MSSQL Database, or list tables in specific schemas
README
MSSQL MCP Server
A Model Context Protocol (MCP) server that enables LLMs like Claude to interact with Microsoft SQL Server databases through natural language.
Features
- 🔍 Query your SQL Server database using natural language
- 📊 Read, insert, update, and delete data
- 🏗️ Create and manage tables and indexes
- 🔒 Secure connection handling with optional read-only mode
- ⚡ Direct TypeScript execution with tsx - no build step required
Quick Start
Option 1: Use directly from GitHub with npx (Recommended)
No installation needed! Just configure Claude Desktop:
Windows
Add to %APPDATA%\Claude\claude_desktop_config.json
:
{
"mcpServers": {
"mssql": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "npx", "-y", "github:EvilPhatBoi/McpSqlServer"],
"env": {
"SERVER_NAME": "your-server.database.windows.net",
"DATABASE_NAME": "your-database",
"SQL_USERNAME": "your-username",
"SQL_PASSWORD": "your-password",
"TRUST_SERVER_CERTIFICATE": "false",
"CONNECTION_TIMEOUT": "30",
"READONLY": "false"
}
}
}
}
macOS/Linux
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"mssql": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:EvilPhatBoi/McpSqlServer"],
"env": {
"SERVER_NAME": "your-server.database.windows.net",
"DATABASE_NAME": "your-database",
"SQL_USERNAME": "your-username",
"SQL_PASSWORD": "your-password",
"TRUST_SERVER_CERTIFICATE": "false",
"CONNECTION_TIMEOUT": "30",
"READONLY": "false"
}
}
}
}
Option 2: Clone and run locally
- Clone the repository:
git clone https://github.com/EvilPhatBoi/McpSqlServer.git
cd McpSqlServer
- Install dependencies:
npm install
- Create
.env
file:
cp .env.example .env
# Edit .env with your database credentials
- Configure Claude Desktop to point to your local installation:
{
"mcpServers": {
"mssql": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "C:/path/to/McpSqlServer/src/index.ts"],
"env": {
"SERVER_NAME": "your-server.database.windows.net",
"DATABASE_NAME": "your-database",
"SQL_USERNAME": "your-username",
"SQL_PASSWORD": "your-password"
}
}
}
}
Environment Variables
Variable | Description | Default |
---|---|---|
SERVER_NAME |
SQL Server hostname | Required |
DATABASE_NAME |
Database name | Required |
SQL_USERNAME |
SQL username | Required |
SQL_PASSWORD |
SQL password | Required |
TRUST_SERVER_CERTIFICATE |
Trust self-signed certificates | false |
CONNECTION_TIMEOUT |
Connection timeout in seconds | 30 |
READONLY |
Enable read-only mode | false |
Usage Examples
Once configured, you can interact with your database using natural language in Claude:
- "Show me all customers from New York"
- "Create a table called products with columns for id, name, and price"
- "Update the price of product with id 5 to 29.99"
- "List all tables in the database"
- "Describe the structure of the orders table"
Development
Running locally with tsx:
npm run start # Run the server
npm run dev # Run with watch mode
Type checking:
npm run typecheck
Security Notes
- Never commit
.env
files with real credentials - Use read-only mode (
READONLY=true
) in production for safety - The server requires WHERE clauses for updates to prevent accidental mass updates
- Consider using environment-specific credentials
Troubleshooting
Connection issues
- Ensure your SQL Server allows remote connections
- Check firewall rules for SQL Server port (usually 1433)
- Verify credentials and server name
Authentication errors
- This server uses SQL authentication, not Windows authentication
- Ensure SQL authentication is enabled on your server
- Check that the SQL user has appropriate permissions
License
MIT
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。