Skip to content

Commit 6ad77e1

Browse files
committed
Init commit of nodejs mssql MCP Server
1 parent 25cac81 commit 6ad77e1

17 files changed

+2990
-0
lines changed

MssqlMcp/NodejsMcpServer/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

MssqlMcp/NodejsMcpServer/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Azure SQL DB MCP Server
2+
3+
<div align="center">
4+
<img src="./src/img/logo.png" alt="Azure SQL DB MCP server logo" width="400"/>
5+
</div>
6+
7+
## What is this? 🤔
8+
9+
This is a server that lets your LLMs (like Claude) talk directly to your Azure SQL DB data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
10+
11+
### Quick Example
12+
```text
13+
You: "What were our top 10 customers last month?"
14+
Claude: *queries your Azure SQL DB database and gives you the answer in plain English*
15+
```
16+
17+
18+
## How Does It Work? 🛠️
19+
20+
This server leverages the Model Context Protocol (MCP), a versatile framework that acts as a universal translator between AI models and databases. Although MCP is built to support any AI model, it is currently accessible as a developer preview in Claude Desktop.
21+
22+
Here's all you need to do:
23+
1. Set up project (see below)
24+
2. Add your project details to Claude Desktop's config file
25+
3. Start chatting with your Azure SQL DB data naturally!
26+
27+
### What Can It Do? 📊
28+
29+
- Run Azure SQL DB queries by just asking questions in plain English
30+
31+
## Quick Start 🚀
32+
33+
### Prerequisites
34+
- Node.js 14 or higher
35+
- Claude Desktop
36+
37+
### Set up project
38+
39+
- Obtain Azure SQL DB server_name, database_name. Create an '.env' file and fill in details with the obtained values
40+
41+
```
42+
SERVER_NAME='<INSERT>'
43+
DATABASE_NAME='<INSERT>'
44+
```
45+
46+
### Getting Started
47+
48+
1. **Install Dependencies**
49+
Run the following command in the root folder to install all necessary dependencies:
50+
```bash
51+
npm install
52+
```
53+
54+
2. **Build the Project**
55+
Compile the project by running:
56+
```bash
57+
npm run build
58+
```
59+
60+
3. **Start the Server**
61+
Navigate to the `dist` folder and start the server:
62+
```bash
63+
npm start
64+
```
65+
66+
4. **Confirmation Message**
67+
You should see the following message:
68+
```
69+
Azure SQL DB Server running on stdio
70+
```
71+
72+
### Add your project details to Claude Destkop's config file, and set parameters accordingly
73+
74+
Open Claude Desktop and Navigate to File -> Settings -> Developer -> Edit Config and open the `claude_desktop_config` file and replace with the values below,
75+
76+
```json
77+
{
78+
"mcpServers": {
79+
"mssql": {
80+
"command": "node",
81+
"args": [ "C:/repos/MCP/dist/index.js" ],
82+
"env": {
83+
"SERVER_NAME": "",
84+
"DATABASE_NAME": "",
85+
"READONLY": "" // set to "true" to restrict to read-only operations
86+
}
87+
}
88+
}
89+
}
90+
91+
```
92+
93+
You should now have successfully configured the MCP server for Azure SQL DB with Claude Desktop. This setup allows you to seamlessly interact with Azure SQL DB through the MCP server.

0 commit comments

Comments
 (0)