MCP SQL 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., "@MCP SQL Servershow me the top 10 rows from the orders table"
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.
MCP SQL Server
Remote FastMCP server for dual SQL Server 2019 instances with strong read-only controls, rate limiting, and diagnostics.
What This Repository Provides
FastMCP + FastAPI service exposing SQL tools over HTTP at /mcp
Dual-instance SQL Server 2019 support (primary and secondary)
Read-only SQL policy controls with denylist (13 patterns: DDL, DML, DCL, system procedures) and allowlist config
Redis or local rate limiting with per-actor and global limits
Security-oriented output handling (sensitive field redaction)
Diagnostics endpoints for runtime posture and tool usage
Docker runtime and compose files for local and remote operation
Related MCP server: FastAPI Database MCP Server
Important Documentation
Tool catalog - canonical list of exposed tools and contracts.
Access levels and controlled write - authorization model and write guardrails.
Runtime policy configuration guide - authoritative policy workflow, YAML roles, and safe update steps.
Run with Docker - local and remote Docker runtime instructions.
Azure Container Apps deployment - Azure deployment flow and operational guidance.
Cloud deployment strategy analysis - cross-cloud comparison of Azure, AWS, and Databricks hosting strategies for this MCP server.
Deployment checklist - pre-deploy and post-deploy validation steps.
Security maintenance runbook - weekly/monthly/quarterly security operations.
Scaling strategy runbook - scaling and load-validation operations.
Connectivity and diagnostics spec - discovery and diagnostics behavior reference.
Security policy - reporting and hardening policy.
Contributing guide - branch, PR, and testing expectations.
Repository Structure
src: service runtime, tool registration, middleware, diagnostics
config: instance config, policy, and rate-limit settings
policy: SQL allowlist and denylist definitions
docker: Dockerfile and compose files
tests: unit tests
testing: integration and operational test harnesses
docs: tool catalog, runbooks, and run instructions
docs/runbooks/scaling-strategy.md: runbook for scaling and load-validation operations
docs/runbooks/security-maintenance.md: runbook for security posture checks and maintenance
docs/access-levels-and-controlled-write.md: access model and controlled-write enforcement reference
Quick Start (Local)
Create and activate a Python 3.11+ virtual environment.
Install dependencies:
Windows (PowerShell):
pip install -e .[dev]Linux/macOS:
pip install -e '.[dev]'Copy environment and config templates:
Windows (PowerShell):
Copy-Item .env.example .envLinux/macOS:
cp .env.example .envConfigure instances in
config/instances.yaml(this repository already includes it; noinstances.yaml.examplefile is provided). For parity with the.env.example->.envpattern above, use the existing file as your local runtime file and useconfig/instances.runtime.example.yamlas the format/key reference.Run the service:
python -m src.serverValidate endpoints:
Primary rollout verification checks:
/diagnostics/health: confirms service and instance connectivity./diagnostics/security: confirms auth mode, required scope count, group-authorization posture, and registered tool inventory./diagnostics/pool: confirms per-instance SQL pool sizing and reuse counters.
Docker Runtime
Use the runtime compose flow documented in docs/run-mcp-server-with-docker.md.
Controlled-write policy is enforced from config/runtime-policy.yaml. The file policy/sql-allowlist.yaml is a review/reference mirror and is not loaded as a runtime policy source.
docker compose -f docker/docker-compose.runtime.yml up -dOperational Runbooks
Scaling strategy - guidance for dashboard scaling and load validation.
Security maintenance - maintenance checks for security posture and operational hygiene.
Testing
Run unit tests:
pytest -qCurrent validation snapshot:
Full test suite:
196 passedSee docs/release-notes-v1.4.0.md for the latest release details.
Security Notes
Do not commit real secrets.
Keep .env local only.
Prefer least-privilege SQL credentials.
See SECURITY.md for reporting and hardening guidance.
Contributing
See CONTRIBUTING.md for branch, PR, and test expectations.
Release and CI
CI runs on pull requests and pushes to master/main.
Release tags follow v* (example: v1.2).
Latest release notes: docs/release-notes-v1.4.0.md
CMMI-Oriented Platform Integration
This repository includes GitHub-native process controls aligned to CMMI implementation patterns:
Requirements management: requirement issue template and PR traceability sections
Configuration management: branch protection, CODEOWNERS, signed commits, and protected release tags
Verification and validation: CI checks, PR gates, and traceability check workflow
Measurement and analysis: scheduled traceability matrix generation
Audit trail: issue/PR history, commit history, and workflow logs retained in GitHub
Artifacts:
.github/ISSUE_TEMPLATE/requirement.yml
.github/workflows/traceability-check.yml
.github/workflows/traceability-matrix.yml
docs/traceability-matrix.md
License
Licensed under the MIT License. See LICENSE.
This 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-qualityCmaintenanceRead-only SQL Server MCP server enabling safe database queries, table listing, and schema inspection with built-in security protections.MIT
- Flicense-qualityDmaintenanceProvides read-only SQL query access to Postgres and DuckDB databases via MCP tools, with extensive security hardening for public endpoints.1
- Alicense-qualityBmaintenanceEnables querying multiple SQL Server, Azure SQL, or Synapse databases through a single MCP interface, with support for read-only targets and various authentication methods.MIT
- Alicense-qualityBmaintenanceMCP server for safely exposing SQL Server database capabilities to LLM clients, with read-only mode, security features, and observability.28MIT
Related MCP Connectors
A paid remote MCP for AI SDK data query MCP, built to return verdicts, receipts, usage logs, and aud
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP server for wafergraph.com's semiconductor & AI supply-chain data: 30 tools, no auth.
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/harryvaldez/mcp-sql-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server