SQL Server
Exemplo de uso do MCP do SQL Server (via dotnet tool) com um server de banco de dados containerizado e com consulta a dados de regiões do Brasil. Inclui Docker Compose para criação do ambiente de testes.
What is SQL Server?
SQL Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to exemplo de uso do mcp do sql server (via dotnet tool) com um server de banco de dados containerizado e com consulta a dados de regiões do brasil. inclui docker compose para criação do ambiente de test...
Exemplo de uso do MCP do SQL Server (via dotnet tool) com um server de banco de dados containerizado e com consulta a dados de regiões do Brasil. Inclui Docker Compose para criação do ambiente de testes.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Exemplo de uso do MCP do SQL Server (via dotnet tool) com um
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx sqlserver-mcp-dotnet-tool-scriptsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use SQL Server
This MCP server connects Claude and other AI agents to a Microsoft SQL Server database through the official mcpsqlserver dotnet global tool. A Docker Compose file spins up a containerized SQL Server instance pre-loaded with Brazilian geographic region data for quick testing, making it a practical reference for integrating any SQL Server database with LLM workflows.
Prerequisites
- .NET 8 SDK installed (dotnet --version should show 8.x)
- Docker and Docker Compose installed for the test environment
- A SQL Server instance accessible via a connection string (local, Docker, or Azure SQL)
- Claude Desktop or VS Code with MCP extension
Install the mcpsqlserver dotnet global tool
Install the MCP SQL Server tool globally via the dotnet CLI. This makes the mcpsqlserver binary available system-wide.
dotnet tool install --global mcpsqlserver-preview-202508d --version 1.0.0
# Verify installation
dotnet tool list -gStart the containerized test database
The repository includes a Docker Compose file that launches a SQL Server container pre-populated with geographic data. This is optional — skip if you have your own SQL Server.
git clone https://github.com/renatogroffe/sqlserver-mcp-dotnet-tool-scripts.git
cd sqlserver-mcp-dotnet-tool-scripts/src
docker-compose up -d
# Verify the container is running
docker ps | grep sqlserverConfigure the MCP server in mcp.json
Create or edit your MCP client configuration. The CONNECTION_STRING environment variable holds all database credentials. Replace the example values with your actual server, database, user, and password.
{
"servers": {
"mcp-sqlserver-dotnet-tool": {
"type": "stdio",
"command": "mcpsqlserver",
"args": [],
"env": {
"CONNECTION_STRING": "Server=localhost;Database=BaseDadosGeograficos;User Id=sa;Password=SqlServer2025!;TrustServerCertificate=True;"
}
}
}
}Configure Claude Desktop
For Claude Desktop, add the server block to claude_desktop_config.json with the same connection string pattern.
{
"mcpServers": {
"sqlserver": {
"command": "mcpsqlserver",
"args": [],
"env": {
"CONNECTION_STRING": "Server=localhost,1433;Database=MyDb;User Id=myuser;Password=mypassword;TrustServerCertificate=True;"
}
}
}
}Restart Claude Desktop and verify
Restart Claude Desktop to load the new MCP server. Ask Claude a simple question about your database to confirm connectivity.
SQL Server Examples
Client configuration
Full claude_desktop_config.json entry using the installed mcpsqlserver global tool pointing at a local SQL Server.
{
"mcpServers": {
"sqlserver": {
"command": "mcpsqlserver",
"args": [],
"env": {
"CONNECTION_STRING": "Server=localhost,1433;Database=BaseDadosGeograficos;User Id=sa;Password=SqlServer2025!;TrustServerCertificate=True;"
}
}
}
}Prompts to try
Natural-language prompts for querying and managing SQL Server databases.
- "List all tables in the current database"
- "Show me the top 10 rows from the Regioes table with all columns"
- "How many records are in each table? Give me a summary"
- "Write and run a query that groups sales by region and calculates total revenue for each"
- "Describe the schema of the Municipios table including column types and constraints"Troubleshooting SQL Server
mcpsqlserver command not found after installing the dotnet tool
The dotnet tools directory is not on your PATH. Add it: on Linux/macOS add export PATH="$PATH:$HOME/.dotnet/tools" to your shell profile. On Windows it is usually %USERPROFILE%\.dotnet\tools — add it to the system PATH environment variable.
SQL Server connection refused or timeout when using Docker
The SQL Server container can take 30-60 seconds to initialize. Wait and retry. Check with: docker logs <container_id>. Also confirm the port mapping in docker-compose.yml matches the port in your connection string (default 1433).
TrustServerCertificate must be set to avoid SSL errors
For local or Docker SQL Server instances without a valid TLS certificate, always include TrustServerCertificate=True in the connection string. Do not use this in production — configure a real certificate instead.
Frequently Asked Questions about SQL Server
What is SQL Server?
SQL Server is a Model Context Protocol (MCP) server that exemplo de uso do mcp do sql server (via dotnet tool) com um server de banco de dados containerizado e com consulta a dados de regiões do brasil. inclui docker compose para criação do ambiente de testes. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install SQL Server?
Follow the installation instructions on the SQL Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with SQL Server?
SQL Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is SQL Server free to use?
Yes, SQL Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
SQL Server Alternatives — Similar Databases Servers
Looking for alternatives to SQL Server? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up SQL Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use SQL Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.