claude-mcp-aws-sqlserver
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
claude-mcp-aws-sqlserver
MCP Server that gives Claude natural-language access to SQL Server running on a Windows EC2 instance inside an AWS VPC — no public database exposure required.
Overview
This project demonstrates how to build an MCP (Model Context Protocol) server that bridges Claude Desktop to an AWS-hosted SQL Server environment. All database traffic flows over the private VPC network — the SQL Server port is never exposed to the public internet.
Claude can use plain English to:
Inspect and manage EC2 instances (start, stop, list)
Run PowerShell or bash commands on any instance via AWS SSM
Query any database on the SQL Server with T-SQL
List all databases and their health status
Related MCP server: AWS SSO MCP Server
Architecture
Claude Desktop
|
| MCP (streamable-HTTP)
v
┌─────────────────────────────────┐
│ server.py │
│ (FastMCP) │
│ │
│ ┌──────────┐ ┌─────────────┐ │
│ │ boto3 │ │ pyodbc │ │
│ └────┬─────┘ └──────┬──────┘ │
└───────┼───────────────┼─────────┘
│ │
AWS API VPC-internal TCP
│ │
┌──────┴──────┐ ┌─────┴──────────────┐
│ EC2 + SSM │ │ Windows EC2 │
│ (control) │ │ SQL Server 2019+ │
└─────────────┘ └────────────────────┘Key design decisions:
SSM is used for remote command execution instead of RDP/SSH — no inbound ports needed on instances.
Platform detection automatically selects the correct SSM document (PowerShell vs bash).
pyodbcconnects to SQL Server via the private VPC IP, keeping the database off the public internet.
MCP Tools
Tool | Description |
| List all EC2 instances with state, type, and public IP |
| Start a stopped EC2 instance by ID |
| Stop a running EC2 instance by ID |
| Run a shell or PowerShell command via SSM (auto-detects OS) |
| Execute any T-SQL query against a named database |
| List all SQL Server databases with state and recovery model |
Prerequisites
AWS Side
An AWS account with at least one EC2 instance running SQL Server (Windows)
SSM Agent installed and running on all managed EC2 instances
An IAM role attached to each EC2 instance with the
AmazonSSMManagedInstanceCorepolicyThe machine running this server needs AWS credentials with permissions for
ec2:Describe*,ec2:StartInstances,ec2:StopInstances,ssm:SendCommand, andssm:GetCommandInvocation
Local Machine
Python 3.10 or later
Windows: Download from Microsoft
macOS:
brew install msodbcsql17Ubuntu/Debian:
sudo apt-get install -y msodbcsql17
Claude Desktop with MCP support enabled
Setup
1. Clone the repository
git clone https://github.com/jesseeastern/claude-mcp-aws-sqlserver.git
cd claude-mcp-aws-sqlserver2. Install Python dependencies
pip install -r requirements.txt3. Configure credentials
Edit server.py and fill in the constants at the top of the file:
WINDOWS_INSTANCE_ID = "i-XXXXXXXXXXXXXXXXX" # Your Windows EC2 instance ID
SQL_SERVER_IP = "10.0.0.X" # Private VPC IP of the SQL Server
SQL_SERVER_PORT = 1433
SQL_USER = "sa"
SQL_PASSWORD = "your-password-here"Tip: For production use, load these values from environment variables or AWS Secrets Manager instead of hardcoding them.
4. Configure AWS credentials
The server uses the standard boto3 credential chain. The easiest approach:
aws configure
# or set environment variables:
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=us-east-25. Register with Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"vpc-mcp": {
"command": "python",
"args": ["/absolute/path/to/server.py"],
"transport": "streamable-http",
"url": "http://localhost:8000/mcp"
}
}
}6. Start the server
python server.pyExample Prompts
Once connected, you can ask Claude things like:
"List all my EC2 instances and tell me which ones are running."
"Start instance i-0abc123def456789a and wait for it to be available."
"What databases exist on the SQL Server?"
"Run this query against AdventureWorks2019: SELECT TOP 10 * FROM Sales.SalesOrderHeader ORDER BY TotalDue DESC"
"Check free disk space on the Windows instance using PowerShell."
Security Notes
Never commit real passwords or AWS credentials to source control. Use environment variables or a secrets manager.
The placeholder values in
server.py(i-XXXXXXXXXXXXXXXXX,YOUR_SA_PASSWORD_HERE) are intentional — replace them in your local copy only.Restrict the IAM role to the minimum required permissions using the principle of least privilege.
Consider enabling AWS CloudTrail to audit all SSM command executions.
Tech Stack
FastMCP — Python MCP server framework
boto3 — AWS SDK for Python
pyodbc — ODBC database connectivity
AWS EC2 — Virtual machines in the cloud
AWS Systems Manager (SSM) — Secure remote command execution without open inbound ports
License
This project is licensed under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to connect to and interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through natural language. Supports executing queries, managing tables, exporting data, and storing business insights with authentication options including AWS IAM.MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to AWS infrastructure through AWS IAM Identity Center for secure, natural language management of cloud resources across multiple accounts. It enables users to execute AWS CLI commands, monitor resources, and run remote shell commands on EC2 instances via Systems Manager.1,185 npm15ISC
- AlicenseBqualityDmaintenanceEnables Claude to interact with core AWS services like S3, EC2, RDS, and CloudWatch, along with a generic SDK wrapper for any AWS operation. It also supports cost monitoring and optional vector store capabilities for document ingestion and search.103-
- AlicenseBqualityDmaintenanceEnables Claude Desktop to interact with 57 AWS services using over 200 tools and local machine profiles. It supports multi-profile configurations and features a read-only safe mode by default to manage infrastructure like EC2, S3, and Lambda securely.100BSD 3-Clause