Microsoft SQL MCP server
AI 클라이언트가 SQL Server 스키마를 탐색하고 읽기 전용 SELECT 쿼리를 안전하게 실행할 수 있도록 지원합니다.
다른 이름 bilims/mcp-sqlserver, @bilims/mcp-sqlserver
- 스타
- 47
- Tools
- 8
- 다운로드, 30일
- 4,376
- 최신 버전
- —
- 마지막 커밋
- 2026년 3월 31일
- 라이선스
- MIT
Microsoft SQL MCP란?
Microsoft SQL은(는) MCP server입니다. AI 클라이언트가 SQL Server 스키마를 탐색하고 읽기 전용 SELECT 쿼리를 안전하게 실행할 수 있도록 지원합니다. 8개 도구를 제공합니다. 예: list_databases, list_tables, list_views.
프로젝트 README에서 생성된 요약
Microsoft SQL MCP server 정보
이 server는 AI 클라이언트에서 Microsoft SQL Server 스키마를 탐색하고 읽기 전용 쿼리를 실행할 수 있게 해줍니다. 개발자와 데이터 분석가는 Claude Desktop 또는 Claude Code CLI와 같은 도구를 통해 자연어로 Azure SQL Database, 온프레미스 SQL Server 또는 로컬 SQL Server Express 인스턴스와 상호작용할 수 있습니다. 이 server는 호스트, 사용자, 비밀번호, 데이터베이스 이름과 같은 환경 변수를 통해 데이터베이스에 연결됩니다.
보안을 최우선으로 고려하여, 실수로 데이터가 수정되는 것을 방지하기 위해 작업을 읽기 전용 SELECT 문으로 제한합니다. SQL 인젝션에 대한 내장 보호 기능을 포함하며, INSERT 또는 DELETE와 같은 위험한 키워드를 차단하기 위해 블랙리스트를 사용합니다. 사용자는 list_tables, describe_table, get_foreign_keys와 같은 도구를 사용하여 데이터베이스 구조를 파악할 수 있습니다. 데이터 검색을 위한 execute_query 도구는 복잡한 쿼리 실행 시 안정성을 보장하기 위해 구성 가능한 행 제한 및 타임아웃 기능을 갖춘 안전한 탐색을 지원합니다.
활용 사례
- 1데이터베이스 구조 탐색AI에게 특정 데이터베이스 스키마 내의 모든 테이블과 컬럼 정의를 식별하도록 요청합니다.
- 2테이블 관계 분석외래 키를 통해 서로 다른 테이블이 어떻게 연결되어 있는지 요약 정보를 요청합니다.
- 3샘플 데이터 조회자연어를 사용하여 검토를 위해 특정 테이블에서 제한된 수의 레코드를 가져옵니다.
- 4테이블 크기 감사데이터베이스에서 가장 많은 공간을 차지하거나 가장 많은 행을 포함하는 테이블을 식별합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Microsoft SQL MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 Microsoft SQL MCP 설치
$ claude mcp add mcp-sqlserver -- npx -y @bilims/mcp-sqlserverCursor에 Microsoft SQL MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-sqlserver": {
"command": "npx",
"args": [
"-y",
"@bilims/mcp-sqlserver"
]
}
}
}VS Code에 Microsoft SQL MCP 설치
.vscode/mcp.json
{
"servers": {
"mcp-sqlserver": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@bilims/mcp-sqlserver"
]
}
}
}VS Code CLI에 Microsoft SQL MCP 설치
$ code --add-mcp '{"name":"mcp-sqlserver","type":"stdio","command":"npx","args":["-y","@bilims/mcp-sqlserver"]}'Claude Desktop에 Microsoft SQL MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"mcp-sqlserver": {
"command": "npx",
"args": [
"-y",
"@bilims/mcp-sqlserver"
]
}
}
}Codex에 Microsoft SQL MCP 설치
$ codex mcp add mcp-sqlserver -- npx -y @bilims/mcp-sqlserverCodex config.toml에 Microsoft SQL MCP 설치
~/.codex/config.toml
[mcp_servers.mcp-sqlserver] command = "npx" args = ["-y", "@bilims/mcp-sqlserver"]
Gemini CLI에 Microsoft SQL MCP 설치
$ gemini mcp add -s user mcp-sqlserver npx -- -y @bilims/mcp-sqlserverGemini settings.json에 Microsoft SQL MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"mcp-sqlserver": {
"command": "npx",
"args": [
"-y",
"@bilims/mcp-sqlserver"
]
}
}
}Microsoft SQL MCP 도구 8
README에서 감지됨list_databaseslist_tableslist_viewsdescribe_tableget_foreign_keysget_table_statsexecute_queryget_server_info
| list_databases | — | |
| list_tables | — | |
| list_views | — | |
| describe_table | — | |
| get_foreign_keys | — | |
| get_table_stats | — | |
| execute_query | — | |
| get_server_info | — |
구성
SQLSERVER_DATABASESQLSERVER_ENCRYPTSQLSERVER_HOSTSQLSERVER_PASSWORDSQLSERVER_TRUST_CERTSQLSERVER_USER
| 이름 | 설명 | 유형 |
|---|---|---|
| SQLSERVER_DATABASE | — | |
| SQLSERVER_ENCRYPT | — | |
| SQLSERVER_HOST | — | |
| SQLSERVER_PASSWORD | — | |
| SQLSERVER_TRUST_CERT | — | |
| SQLSERVER_USER | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능bilims/mcp-sqlserver is public and reachablegithub.com/bilims/mcp-sqlserver ↗통과
- 패키지가 이 저장소를 소스로 명시@bilims/mcp-sqlserver names bilims/mcp-sqlserver as sourcenpmjs.com/package/@bilims/mcp-sqlserver ↗통과
- 빌드 출처(Sigstore 증명)No build attestation published for this release검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-03-31github.com/bilims/mcp-sqlserver ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from @bilims/mcp-sqlserver통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음8 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기MCP SQL Server
A read-only Model Context Protocol (MCP) server for Microsoft SQL Server that enables AI agents to safely explore and query SQL Server databases.
Quick Start
Step 1: Install the Package
# Global installation (recommended)
npm install -g @bilims/mcp-sqlserver
# Verify installation
mcp-sqlserver --version
Step 2: Configure Your SQL Server Connection
Choose your SQL Server type and follow the configuration:
Azure SQL Database
export SQLSERVER_HOST="your-server.database.windows.net"
export SQLSERVER_USER="your-username"
export SQLSERVER_PASSWORD="your-password"
export SQLSERVER_DATABASE="your-database"
export SQLSERVER_ENCRYPT="true"
export SQLSERVER_TRUST_CERT="false"
On-Premises SQL Server
export SQLSERVER_HOST="your-sql-server.company.com"
export SQLSERVER_USER="your-username"
export SQLSERVER_PASSWORD="your-password"
export SQLSERVER_DATABASE="your-database"
export SQLSERVER_ENCRYPT="true"
export SQLSERVER_TRUST_CERT="true" # For self-signed certificates
Local SQL Server Express
export SQLSERVER_HOST="localhost\\SQLEXPRESS"
export SQLSERVER_USER="sa"
export SQLSERVER_PASSWORD="your-password"
export SQLSERVER_DATABASE="master"
export SQLSERVER_ENCRYPT="false"
export SQLSERVER_TRUST_CERT="true"
Step 3: Test the Connection
# Test your configuration
mcp-sqlserver --help
# Quick connection test (press Ctrl+C to exit)
mcp-sqlserver
Step 4: Add to Claude Desktop
-
Find your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the MCP server configuration:
{
"mcpServers": {
"sqlserver": {
"command": "mcp-sqlserver",
"env": {
"SQLSERVER_HOST": "your-server.database.windows.net",
"SQLSERVER_USER": "your-username",
"SQLSERVER_PASSWORD": "your-password",
"SQLSERVER_DATABASE": "your-database",
"SQLSERVER_ENCRYPT": "true",
"SQLSERVER_TRUST_CERT": "false"
}
}
}
}
- Restart Claude Desktop
Step 5: Start Exploring!
Try these commands in Claude Desktop:
"Test the SQL Server connection""List all databases on the server""Show me the tables in [database name]""Describe the structure of the Users table""Show me foreign key relationships"
Features
- 🔒 Read-only operations: Only SELECT queries allowed, with comprehensive security validation
- 🗄️ Schema discovery: Explore databases, tables, views, relationships, and metadata
- 📊 Data exploration: Execute safe queries with built-in limits and timeouts
- 🔐 Enterprise-ready: Encrypted connections with certificate trust for production environments
- 🛡️ Security-first: Query validation, SQL injection protection, and access controls
Available Tools
Schema Discovery
list_databases- List all databases on the SQL Server instancelist_tables- List tables in a database or schemalist_views- List views in a database or schemadescribe_table- Get detailed table schema including columns, data types, and constraints
Relationship Analysis
get_foreign_keys- Get foreign key relationships for tablesget_table_stats- Get table statistics including row counts and size information
Data Exploration
execute_query- Execute read-only SELECT queries with safety validationget_server_info- Get SQL Server version, edition, and configuration details
Common Commands for Claude Desktop
Once your MCP server is configured, try these natural language commands:
Getting Started Commands
"Test the SQL Server connection"
"Show me server information"
"List all databases on this server"
"What tables are in the [database name] database?"
Database Exploration
"Describe the structure of the Users table"
"Show me foreign key relationships in this database"
"What are the largest tables by row count?"
"Give me a sample of data from the Orders table"
Advanced Analysis
"Help me understand the relationship between Orders and Customers"
"Show me all lookup tables in this database"
"What columns contain date/time information?"
"Find tables that might contain user authentication data"
Custom Queries
"Run this query: SELECT TOP 10 * FROM Products WHERE Price > 100"
"Show me all customers created in the last 30 days"
"What are the different product categories in the database?"
Installation
npm install
npm run build
Configuration
The server is configured using environment variables:
Required
SQLSERVER_USER- SQL Server usernameSQLSERVER_PASSWORD- SQL Server password
Optional
SQLSERVER_HOST- Server hostname (default: localhost)SQLSERVER_DATABASE- Default database nameSQLSERVER_PORT- Port number (default: 1433)SQLSERVER_ENCRYPT- Enable encryption (default: true)SQLSERVER_TRUST_CERT- Trust server certificate (default: true)SQLSERVER_CONNECTION_TIMEOUT- Connection timeout in ms (default: 30000)SQLSERVER_REQUEST_TIMEOUT- Request timeout in ms (default: 60000)SQLSERVER_MAX_ROWS- Maximum rows per query (default: 1000)
Usage
Environment Variables
export SQLSERVER_HOST="your-server.database.windows.net"
export SQLSERVER_USER="your-username"
export SQLSERVER_PASSWORD="your-password"
export SQLSERVER_DATABASE="your-database"
export SQLSERVER_ENCRYPT="true"
export SQLSERVER_TRUST_CERT="true"
Running the Server
npm start
Installation Options
Option 1: Global Installation (Recommended)
npm install -g @bilims/mcp-sqlserver
Option 2: Local Installation
npm install @bilims/mcp-sqlserver
npx mcp-sqlserver
Option 3: Run with npx (No Installation)
npx @bilims/mcp-sqlserver
Integration Examples
Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"sqlserver": {
"command": "mcp-sqlserver",
"env": {
"SQLSERVER_HOST": "your-server.database.windows.net",
"SQLSERVER_USER": "your-username",
"SQLSERVER_PASSWORD": "your-password",
"SQLSERVER_DATABASE": "your-database"
}
}
}
}
Claude Code CLI
# Set environment variables
export SQLSERVER_HOST="your-server"
export SQLSERVER_USER="your-username"
export SQLSERVER_PASSWORD="your-password"
# Use with Claude Code
claude mcp add sqlserver mcp-sqlserver
VSCode with MCP Extension
Install the MCP extension for VSCode and add the server configuration.
Security Features
Query Validation
- Only SELECT, WITH, SHOW, DESCRIBE, and EXPLAIN statements allowed
- Comprehensive blacklist of dangerous keywords (INSERT, UPDATE, DELETE, DROP, etc.)
- SQL injection pattern detection
- Automatic query sanitization
Connection Security
- TLS/SSL encryption enabled by default
- Server certificate trust options for enterprise environments
- Connection pooling with timeout controls
- Configurable request timeouts
Result Limits
- Maximum row limits per query (configurable)
- Automatic TOP clause injection for SELECT queries
- Query execution time tracking
- Memory usage protection
Example Queries
Once connected, you can use the tools through your MCP client:
// List all databases
await callTool("list_databases", {});
// List tables in a specific schema
await callTool("list_tables", { schema: "dbo" });
// Get table schema details
await callTool("describe_table", {
table_name: "Users",
schema: "dbo"
});
// Execute a read-only query
await callTool("execute_query", {
query: "SELECT TOP 10 * FROM Users WHERE active = 1",
limit: 10
});
// Get foreign key relationships
await callTool("get_foreign_keys", {
table_name: "Orders"
});
Development
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Run linting
npm run lint
# Run tests
npm test
Troubleshooting
Connection Issues
- Verify server hostname and port
- Check if encryption/certificate settings match your SQL Server configuration
- Ensure user has appropriate read permissions
- Test connection using SQL Server Management Studio first
Permission Issues
The user account needs at minimum:
CONNECTpermission to the databaseSELECTpermission on tables/views you want to query- Access to system views for metadata queries
Common SQL Server Configurations
Azure SQL Database
export SQLSERVER_HOST="your-server.database.windows.net"
export SQLSERVER_ENCRYPT="true"
export SQLSERVER_TRUST_CERT="false"
On-premises SQL Server with self-signed certificates
export SQLSERVER_HOST="sql-server.company.com"
export SQLSERVER_ENCRYPT="true"
export SQLSERVER_TRUST_CERT="true"
License
MIT
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues and questions:
- Check the troubleshooting section above
- Review SQL Server connection documentation
- Ensure MCP client compatibility
Built with the Model Context Protocol SDK for seamless AI integration.
Microsoft SQL MCP 질문
Microsoft SQL MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add mcp-sqlserver -- npx -y @bilims/mcp-sqlserver를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
Microsoft SQL MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
Microsoft SQL MCP는 어떤 도구를 제공하나요?
8개 도구를 제공합니다. 예: list_databases, list_tables, list_views, describe_table, get_foreign_keys.
이 MCP server가 SQL Server의 데이터를 수정하거나 삭제할 수 있나요?
아니요, 읽기 전용으로 작동합니다. SELECT, WITH, SHOW, DESCRIBE, EXPLAIN 문만 허용되며 위험한 키워드는 블랙리스트로 차단됩니다.
SQL Server 연결은 어떻게 설정하나요?
SQLSERVER_HOST, SQLSERVER_USER, SQLSERVER_PASSWORD, SQLSERVER_DATABASE 및 암호화 옵션과 같은 환경 변수를 설정하십시오.
스키마 탐색을 위해 어떤 도구를 제공하나요?
list_databases, list_tables, list_views, describe_table을 비롯하여 관계 및 쿼리 도구를 제공합니다.
Azure SQL Database와도 작동하나요?
네, Azure 설정의 경우 암호화를 활성화하고 인증서 신뢰를 비활성화하면 사용 가능합니다.
쿼리 결과로 최대 몇 개의 행을 반환할 수 있나요?
쿼리당 반환되는 행의 수는 SQLSERVER_MAX_ROWS로 제한되며 기본값은 1000입니다.