
Microsoft has previewed an MCP tool for SQL Server, implemented both for Node.js and .NET. The notion of using AI natural language to avoid SQL seems attractive, but we found the initial experience frustrating and limited.
Principal product manager Arun Vijayraghavan introduced the new preview, calling it “the next leap in data interaction.” According to Vijayraghavan, the capabilities of Microsoft SQL Server have been locked behind specialized tools and complex query languages – which we take to be a reference to SQL (Structured Query Language), which has formed the basis for interacting with relational databases for decades. The same could be said of other popular database managers, including the open-source MySQL and PostgreSQL.

An MCP (Model Context Protocol) tool makes database commands available to AI agents such as GitHub Copilot or Claude Code. Microsoft has now implemented a tool for SQL Server, which is open source on GitHub, though currently buried under SQL AI Samples. An MCP server runs locally, and this one is implemented in both Node.js and in .NET, using the respective SDKs available for building such servers.
Once up and running, the MCP server for SQL Server offers 8 commands:
- List Tables
- Describe Table
- Create Table
- Drop Table
- Insert Data
- Read Data
- Update Data
- Create Index
The MCP tool is geared towards Azure SQL databases and currently only supports Entra ID authentication, though it looks like SQL Server connections may be added shortly.
We followed Vijayraghavan’s guidance for installing the current preview. Currently only GitHub Copilot or Claude Desktop is officially supported, though being a standard protocol the tool should work with other AI agents. An experiment with Google’s new Gemini CLI was successful for us though; the server started and Gemini CLI could see the commands, authenticated with the correct Entra ID account. Operations take a long time, even when it is the simplest possible instruction such as “list the tables in the database,” without any indication of what is happening; the user has to guess at whether it is a connection failure or may eventually complete.
Over to Copilot, and after some fiddling we could start the MCP server successfully and connect. A prompt to create a customer table worked OK, but we forgot to specify a telephone field. Attempting to add one evoked the message, “Direct ALTER TABLE statements are not allowed through the current interface.” Trying the same through Gemini showed the more user-friendly message, “I can’t directly add a field to an existing table.” Credit to Gemini: it also said that ” Since I cannot modify the table directly, I can create a new table named Customer_with_phone that includes all the existing fields plus a new Telephone field. Then, I can copy all the data from the old Customer table to the new one.” A reasonable plan; though a quick ALTER TABLE done without AI would be even easier.

Vijayraghavan posted separately about a more successful demonstration in which non-expert database user “Susan” creates and populates a SQL Server database for managing a conference. The AI does everything, starting from an empty database. Perhaps Susan might go on to use AI to code a web application using the same database, for registration, checking schedules, and so on.
While that sounds compelling, there are caveats. SQL is a powerful language, though with many variations depending on which database manager is used, but also one with some unusual characteristics. The performance of a SQL command can vary hugely depending on how it is constructed and how the underlying database is designed and indexed. It is also possible to get subtle errors where a query does almost but not quite what the user intends. Ideally AI could help to optimize performance and avoid errors, but potentially it could also do the reverse. Microsoft’s example of a non-expert user creating a database from scratch is vulnerable to these kinds of unintended consequences.
An MCP Server for SQL Server has wider application. Used by experts developing applications which use SQL Server it has potential to improve productivity, since wrangling SQL to get the desired output with good performance can be tricky and it is the sort of thing AI can help with; it could do that without requiring an MCP server but having agentic access to the database schema is an advantage, security considerations aside.