sql
SQL MCP is a Model Context Provider (MCP) server that allows AI applications to execute SQL queries
claude mcp add --transport stdio adetxt-sql-mcp npx @adetxt/sql-mcp
How to use
This MCP server, sql-mcp, exposes a Model Context Protocol interface for interacting with SQL databases. It provides a standardized way to execute queries, inspect schemas, and manage data through MCP-compatible clients. With sql-mcp running, you can connect your MCP-enabled tools to a SQL database and perform operations like reading table structures, listing schemas, running parameterized queries, and performing transactional work within the MCP workflow. The server is designed to be drop-in compatible with other MCP tooling, so you can plug it into existing MCP-enabled environments and leverage familiar MCP commands to interact with your SQL backend.
How to install
Prerequisites:
- Node.js and npm (or core club tools that provide npx)
- Access to a SQL database you want to expose via MCP
Installation options (all rely on running the MCP server via npx):
- Install in Widsurf (run the MCP server with npx):
{
"mcpServers": {
"sql-mcp": {
"command": "npx",
"args": ["@adetxt/sql-mcp"]
}
}
}
- Install in Cursor (same npx approach):
{
"mcpServers": {
"sql-mcp": {
"command": "npx",
"args": ["@adetxt/sql-mcp"]
}
}
}
- Install in VS Code (stdio type configuration):
{
"mcp": {
"servers": {
"sql-mcp": {
"type": "stdio",
"command": "npx",
"args": ["@adetxt/sql-mcp"]
}
}
}
}
Prerequisites summary:
- Node.js and npm installed on the host
- Access to the target SQL database (host, port, username, password, database name)
- Optional: environment variables for database connection (see additional notes and environment variables below)
Additional notes
Environment and configuration tips:
- Set a DATABASE_URL or individual DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, and DB_NAME variables as required by your environment so sql-mcp can connect to the SQL backend.
- Ensure network access from the MCP host to the SQL database (firewalls, VPC/subnet routing, and SSL requirements).
- When starting, verify connection strings and permissions on the target database (read/write permissions as needed).
- If you run into authentication or connectivity issues, check the MCP server logs for host/port, authentication errors, or TLS/SSL mismatch messages.
- For multi-database setups, ensure the server configuration supports selecting the appropriate database/schema per request.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
mcp-router
A Unified MCP Server Management App (MCP Manager).
mcp-graphql
Model Context Protocol server for GraphQL
mcp-echarts
🧬 Generate visual charts using ECharts with AI MCP dynamically, used for chart generation and data analysis.
Matryoshka
MCP server for token-efficient large document analysis via the use of REPL state
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)