Hosted MCPDatabase

SQL Server MCP Server

Explore and query Microsoft SQL Server and Azure SQL in natural language: tables, views, stored procedures, relationships, and read-only SELECT queries.

Setup

1 field · 1 secret

Credentials are injected into an ephemeral sandbox at boot and destroyed with it.

Runtime

Standard

Sessions run up to 60 minutes before the sandbox is reclaimed.

Models

60+ AI models

Chat with 60+ AI models on the same workflow — switch to a different model mid-conversation and re-run the same prompt, or use Compare mode to put several side-by-side.

What the SQL Server MCP server does

How models use it and what it is built for.

The SQL Server MCP server gives a model a full map of a Microsoft SQL Server database — tables, columns, views, stored procedures, triggers and foreign-key relationships — and lets it query the data with SELECT statements.

Custom queries are restricted to SELECT. Any statement that would change data or schema is refused by the server before it reaches the database.

It connects with a standard connection string using SQL authentication, from a cloud sandbox, over the public internet.

What a model can do with it

Concrete operations exposed as tools.

  • List databases, tables and views, and describe their columns
  • Map foreign-key relationships between tables
  • Inspect stored procedures, views and triggers
  • Preview sample rows from a table
  • Run read-only SELECT queries for custom questions

How to set up the SQL Server MCP server

In order. Each step assumes the previous one worked.

  1. 01

    Allow the connection

    The server connects over the public internet. For Azure SQL, add a firewall rule that permits the connection. An on-premises server needs a public endpoint or tunnel.

  2. 02

    Create a read-only login

    Use a SQL-authentication login mapped to a user with db_datareader on the databases the agent should see.

  3. 03

    Paste a connection string

    For example: Server=myserver.database.windows.net,1433;Database=mydb;User Id=reader;Password=…;Encrypt=True; — Windows (integrated) authentication is not available from a cloud sandbox.

  4. 04

    Test the connection

    Ask the model to list the databases it can see. If they come back, you are connected.

Configuration

What you provide before the sandbox starts.

Connection StringRequiredSecret

SQL authentication, e.g. Server=myserver.database.windows.net,1433;Database=mydb;User Id=reader;Password=…;Encrypt=True; — the server must be reachable from the public internet (Windows authentication is not supported).

Example prompts

Paste any of these into Agent Studio once the server is connected.

Map the relationships between the tables in this database and explain the data model.

What does the stored procedure usp_GetCustomerOrders do? Summarise its logic.

Show the top 10 products by revenue this year.

Which tables have no primary key?

Limits and things to watch

Known constraints, stated plainly.

  • Queries are SELECT-only; INSERT, UPDATE, DELETE and DDL are refused.
  • SQL authentication only — Windows integrated authentication is not supported.
  • The server must be reachable from the public internet.

Test SQL Server against a real model

Deploy the server hosted, then watch which tools a model actually reaches for — with full JSON input and output on every call. Switch models mid-conversation to compare how each one uses the same server.

Frequently asked questions

About the SQL Server MCP server.

Does it work with Azure SQL Database?

Yes, with SQL authentication: use your Azure SQL server name in the connection string and allow the connection in the server firewall.

Can the AI change data or drop tables?

No. The query tool only accepts SELECT statements and refuses everything else. A db_datareader login adds a database-level guarantee on top.

Why is Windows authentication not supported?

Integrated authentication relies on the identity of a domain-joined machine. A cloud sandbox has no such identity, so use a SQL login instead.

More