
MCP Magic: AI-Powered Azure SQL Analysis in Plain English
Imagine being able to ask your database questions in plain English and getting visualizations quickly. Traditional SQL analysis requires expertise in SQL query language and separate visualization tools. However, by combining MSSQL and Charting MCP servers in VS Code with natural language, we can enable data analysis for both technical and non-technical users.
This powerful combination makes complex database querying and visualization accessible to everyone, regardless of their SQL expertise.
What is an MCP Server?
MCP (Model Context Protocol) servers are lightweight programs that each expose specific capabilities through the standardized Model Context Protocol. This allows your LLM to gather more context or take action using tools. There has been an explosion of MCP servers that provide capabilities like database querying, visualization, and more. Think of an MCP server like an API, except it’s designed to be consumed by an AI Agent rather than a traditional application.
Setting Up Your Environment
Prerequisites
- Visual Studio Code
- Azure SQL Database (like AdventureWorks)
- Github Copilot Chat (in Agent mode) or similar AI Agent
Installing and Configuring MSSQL MCP Server
- Clone the MSSQL MCP server repository:
- Configure the server in VS Code settings.json:
Note – I had to modify the index.ts file to include tenantId information when obtaining an access token. You may need to do something similar. The code relies on Entra Auth for authentication.
Note – Ensure your firewall rules allow connections from your client IP address.
Adding Charting MCP Server for Visualization
- Add to your VS Code
settings.json:
- Now start both MCP servers. In VS Code, you can do this by clicking “Start” above each MCP server JSON entry.
Verifying Connection
Try a simple natural language query like:
“What tables are in my database?”
Your response should include a list of tables from your Azure SQL Database.
Example Query and Visualization
Prompt:
“What time of day do we get the most orders placed? Visualize the data in a line chart.”
From here, the LLM will do several things:
- Utilize the MSSQL MCP server to gather more information about your database, such as listing each of the table names.
- Query for the columns on the tables of interest.
- If data is contained in multiple tables, it will perform joins automatically.
- From there, it will generate a query that aggregates the orders by time of day as raw data.
- Lastly, the LLM will proceed to use the visualization MCP tools to produce a chart and generate a .png file for you to download.

Summary
Using natural language, AI, and MCP servers in VS Code makes Azure SQL Database analysis much more approachable. You don’t have to be a SQL expert or juggle multiple tools—just ask questions and get answers, including charts, right in your editor. MCP servers are flexible, and there are plenty of options out there, from charting to automation. The ecosystem is expanding quickly, so it’s worth exploring what’s available and seeing how you can streamline your workflows.
A good place to start exploring is this repo that lists a lot of popular MCP servers: https://github.com/modelcontextprotocol/servers.


