Provides SQL server operations via a conversational MCP interface for querying and managing databases.
Configuration
View docs{
"mcpServers": {
"dennismartis-sql_mcp_server": {
"command": "python",
"args": [
"mcp_sql_server.py"
]
}
}
}You can run a FastMCP-based server that exposes MS SQL Server operations through a conversational interface. This enables you to query, describe, and modify your SQL databases using natural language, while handling the underlying SQL interactions in a non-blocking, scalable way.
You interact with the MCP server via a client that sends natural language requests. You can ask it to run SQL queries, list tables, describe a table’s columns, and perform data-changing operations like INSERTs, UPDATEs, or DELETEs. You can also view which ODBC drivers are installed and retrieve general information about the connected database. The server handles non-blocking execution, error reporting, and transaction management so you can focus on results and data insights.
Prerequisites you need before starting are Python 3.7 or newer and a SQL Server instance with the appropriate ODBC driver.
Install the required Python packages.
{
"step": "Install dependencies",
"command": "pip install pyodbc asyncio fastmcp"
}Start the MCP SQL Server using Python to execute the server script. Ensure your connection parameters are configured in the script or environment as needed.
{
"step": "Run the server",
"command": "python mcp_sql_server.py",
"notes": "The server initializes and connects to the configured SQL Server database."
}Execute a SQL query and return the results. Accepts an optional query parameter; if omitted, defaults to selecting all rows from [dbo].[Table_1]. Returns the results as a formatted string.
List all tables in the connected database and return their names as a string.
Return the column information for a specified table, including column names and data types.
Execute non-query SQL statements such as INSERT, UPDATE, or DELETE. Returns the number of affected rows and handles transactions (commit/rollback) automatically.
List all ODBC drivers installed on the system, returned as a comma-separated string.
Provide high-level information about the connected database, including server name, database name, SQL Server version, current server time, and table count.