You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,15 +14,9 @@ You: "Show me all customers from New York"
14
14
Claude: *queries your MSSQL Database database and gives you the answer in plain English*
15
15
```
16
16
17
-
18
17
## How Does It Work? 🛠️
19
18
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 MSSQL Database data naturally!
19
+
This server leverages the Model Context Protocol (MCP), a versatile framework that acts as a universal translator between AI models and databases. It supports multiple AI assistants including Claude Desktop and VS Code Agent.
26
20
27
21
### What Can It Do? 📊
28
22
@@ -36,19 +30,10 @@ Here's all you need to do:
36
30
37
31
### Prerequisites
38
32
- Node.js 14 or higher
39
-
- Claude Desktop
33
+
- Claude Desktop or VS Code with Agent extension
40
34
41
35
### Set up project
42
36
43
-
- Obtain MSSQL Database server_name, database_name. Create an '.env' file and fill in details with the obtained values
44
-
45
-
```
46
-
SERVER_NAME='<INSERT>'
47
-
DATABASE_NAME='<INSERT>'
48
-
```
49
-
50
-
### Getting Started
51
-
52
37
1.**Install Dependencies**
53
38
Run the following command in the root folder to install all necessary dependencies:
54
39
```bash
@@ -73,25 +58,122 @@ DATABASE_NAME='<INSERT>'
73
58
MSSQL Database Server running on stdio
74
59
```
75
60
76
-
### Add your project details to Claude Destkop's config file, and set parameters accordingly
77
-
78
-
Open Claude Desktop and Navigate to File -> Settings -> Developer -> Edit Config and open the `claude_desktop_config` file and replace with the values below,
79
-
80
-
```json
81
-
{
82
-
"mcpServers": {
83
-
"mssql": {
84
-
"command": "node",
85
-
"args": [ "C:/repos/MCP/dist/index.js" ],
86
-
"env": {
87
-
"SERVER_NAME": "",
88
-
"DATABASE_NAME": "",
89
-
"READONLY": ""// set to "true" to restrict to read-only operations
61
+
## Configuration Setup
62
+
63
+
### Option 1: VS Code Agent Setup
64
+
65
+
1.**Install VS Code Agent Extension**
66
+
- Open VS Code
67
+
- Go to Extensions (Ctrl+Shift+X)
68
+
- Search for "Agent" and install the official Agent extension
69
+
70
+
2.**Create MCP Configuration File**
71
+
- Create a `.vscode/mcp.json` file in your workspace
- Close and reopen Claude Desktop for the changes to take effect
150
+
151
+
### Configuration Parameters
152
+
153
+
-**SERVER_NAME**: Your MSSQL Database server name (e.g., `my-server.database.windows.net`)
154
+
-**DATABASE_NAME**: Your database name
155
+
-**READONLY**: Set to `"true"` to restrict to read-only operations, `"false"` for full access
156
+
-**Path**: Update the path in `args` to point to your actual project location
157
+
158
+
## Sample Configurations
159
+
160
+
You can find sample configuration files in the `src/samples/` folder:
161
+
-`claude_desktop_config.json` - For Claude Desktop
162
+
-`vscode_agent_config.json` - For VS Code Agent
163
+
164
+
## Usage Examples
165
+
166
+
Once configured, you can interact with your database using natural language:
167
+
168
+
- "Show me all users from New York"
169
+
- "Create a new table called products with columns for id, name, and price"
170
+
- "Update all pending orders to completed status"
171
+
- "List all tables in the database"
172
+
173
+
## Security Notes
174
+
175
+
- The server requires a WHERE clause for read operations to prevent accidental full table scans
176
+
- Update operations require explicit WHERE clauses for security
177
+
- Set `READONLY: "true"` in production environments if you only need read access
96
178
97
-
You should now have successfully configured the MCP server for MSSQL Database with Claude Desktop. This setup allows you to seamlessly interact with MSSQL Database through the MCP server.
179
+
You should now have successfully configured the MCP server for MSSQL Database with your preferred AI assistant. This setup allows you to seamlessly interact with MSSQL Database through natural language queries!
0 commit comments