SQL Server MCP serverand Python AI tasks
qbash hosts a SQL Server MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.
Developers use qbash Tasks to write cloud-hosted Python functions that pair SQL Server with models such as Claude and GPT.
MCP server
Build a SQL Server MCP server
Give ChatGPT, Claude and your other AI tools access to SQL Server through one server. You pick which SQL Server tools it shares, and you can add other connectors, memory folders and Tasks to the same server.
How to set it up
- Connect SQL Server on the qbash Connectors page.
- Create an MCP server and add the SQL Server tools you want to share.
- Paste the server URL into your client. It connects with OAuth or an access token.
Python AI task
Write a SQL Server task in Python
A qbash Task is a hosted Python function that calls SQL Server and AI models.
List paid orders that have not shipped
Query the oldest 25 paid orders without a shipment, then ask an inline prompt to summarise the backlog by age.
report = qbash.integrations.mssql.execute_query(
query="""SELECT TOP (25) order_id, customer_id, total, created_at
FROM dbo.orders
WHERE status = @p1 AND shipped_at IS NULL
ORDER BY created_at ASC""",
queryParams=["paid"], outputFormat="json_rows",
queryTimeout=30000, retryAttempts=1,
)
rows = report["result"]["rows"]
if rows:
summary = qbash.ai.run_prompt(
slug="mssql-shipping-backlog",
variables={"orders": json.dumps(rows)},
)
qbash.output(summary)
else:
qbash.output("No paid orders are waiting to ship.")
Sample execute_query response
{
"status": "success",
"result": {
"rows": [
{
"order_id": 1042,
"customer_id": 311,
"total": 189.5,
"created_at": "2026-09-28T09:00:00"
}
],
"count": 1
},
"row_count": 1
}
What the SQL Server connector can do
- Execute a SQL query against an Azure SQL database. It runs with the rights of the configured login, so point the credential at a db_datareader login to keep it to reads
- List the user schemas in the connected database
- List the tables and views in a schema
- Describe the columns, indexes and foreign keys of a table
qbash Tasks: AI applications in Python
A Task is a Python function that calls SQL Server, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.
Run Tasks on a schedule or from your team's tools
- Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
- Version controlled Every save is a revision you can compare and roll back.
- Logged Each run records its inputs, output, errors and what started it.
- Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.
SQL Server MCP questions
Does Microsoft have an official SQL Server MCP server?
Yes. Microsoft’s SQL MCP Server is part of Data API builder, which you configure and host, and it exposes the tables you define as entities. qbash runs SQL with your login and serves it on one URL with other connectors and Tasks.
Can the SQL Server MCP server change data?
It can if the login can. execute_query runs any statement the configured login is allowed to run, so connect a login with only db_datareader to keep a client to SELECT.
Which connection details does qbash ask for?
The host, port, database name, username and password of a SQL login. Azure SQL and SQL Server databases use the same form.
Guides that use SQL Server
Related data connectors
Build a SQL Server task
Write it in Python with AI steps, and qbash hosts it with versions and run logs.
Build a SQL Server MCP server
Pick the SQL Server tools to share and connect ChatGPT, Claude or Grok Bot.