Microsoft SQL Server MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Microsoft SQL Server MCP Servershow me the top 10 customers by total purchase amount"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Microsoft SQL Server MCP Server
Un servidor personalizado para MCP (Model Context Protocol) que permite conectar tu asistente de IA (Claude, Windsurf, Cursor) con tu base de datos Microsoft SQL Server.
Características
Consultas Naturales: Pregunta cosas como "¿Cuántos usuarios hay?" y el servidor ejecutará el SQL por ti.
Solo Lectura (Seguro): Diseñado para inspección y análisis.
Optimizado: Mantiene una conexión persistente para respuestas instantáneas.
Compatible: Funciona con Windsurf y Cursor.
Related MCP server: SQL Server MCP
Requisitos
Python 3.11 o superior.
Driver ODBC para SQL Server 17 (o superior) instalado en Windows.
Acceso a una base de datos SQL Server.
Instalación
Clona este repositorio.
Crea un entorno virtual e instala las dependencias:
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -e .Configuración
Debes configurar las credenciales de tu base de datos en las variables de entorno dentro de la configuración de tu editor.
1. Windsurf
Edita tu archivo de configuración de MCP en Windsurf (Generalmente en %APPDATA%\Windsurf\Config\mcp_config.json o accesible desde el menú de configuración de MCP).
Añade lo siguiente:
{
"mcpServers": {
"sqlServer": {
"command": "C:\\Ruta\\A\\Tu\\Repo\\venv\\Scripts\\python.exe",
"args": ["-m", "mssql_mcp_server"],
"env": {
"MSSQL_SERVER": "TU_IP_O_HOST",
"MSSQL_DATABASE": "NOMBRE_BASE_DE_DATOS",
"MSSQL_USER": "TU_USUARIO",
"MSSQL_PASSWORD": "TU_CONTRASEÑA",
"MSSQL_ENCRYPT": "true",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"PYTHONPATH": "C:\\Ruta\\A\\Tu\\Repo\\src"
}
}
}
}IMPORTANTE: Reemplaza
C:\\Ruta\\A\\Tu\\Repocon la ruta absoluta donde clonaste este proyecto. Asegúrate de usar doble barra invertida\\en Windows.
2. Antigravity (Gemini)
Edita el archivo de configuración de MCP en Antigravity para añadir el servidor.
Localiza el archivo de configuración en:
C:\Users\<TU_USUARIO>\.gemini\antigravity\mcp_config.jsonAñade la configuración del servidor dentro del objeto
mcpServers. Si el archivo ya tiene otros servidores (comoperplexity-ask), añadesqlServercomo una nueva clave.
{
"mcpServers": {
"sqlServer": {
"command": "C:\\Ruta\\A\\Tu\\Repo\\venv\\Scripts\\python.exe",
"args": ["-m", "mssql_mcp_server"],
"env": {
"MSSQL_SERVER": "TU_IP_O_HOST",
"MSSQL_DATABASE": "NOMBRE_BASE_DE_DATOS",
"MSSQL_USER": "TU_USUARIO",
"MSSQL_PASSWORD": "TU_CONTRASEÑA",
"MSSQL_ENCRYPT": "true",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"PYTHONPATH": "C:\\Ruta\\A\\Tu\\Repo\\src"
}
}
}
}NOTA: Asegúrate de que las rutas al ejecutable de Python y al repositorio sean correctas y absolutas.
Desarrollo y Pruebas
Para probar la conexión sin el asistente, usa el script incluido:
# Configura las variables en la sesión temporalmente
$env:MSSQL_SERVER="tu_ip"
$env:MSSQL_DATABASE="tu_db"
# ... resto de variables ...
# Ejecuta el test
python test_connection.pyThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceProvides read-only access to Microsoft SQL Server databases using Windows Authentication, enabling AI assistants to safely explore schemas and query data with built-in security controls.Last updatedMIT
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Microsoft SQL Server databases through query execution, schema discovery, CRUD operations, stored procedures, and data export with built-in safety controls.Last updated28Apache 2.0
- Alicense-qualityDmaintenanceEnables AI assistants to securely interact with Microsoft SQL Server databases to query data, inspect schemas, and retrieve metadata with read-only operations by default and optional write capabilities.Last updated1MIT
- Flicense-qualityCmaintenanceEnables AI assistants to analyze and query SQL Server databases, including schema discovery, health checks, and data retrieval.Last updated
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NicolasPirello/Microsoft-SQL-Server-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server