@nodusapi/mcp-server 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QUICKSTART.md +185 -18
- package/README.md +4 -4
- package/TROUBLESHOOTING.md +174 -0
- package/cursor-config.example.json +1 -1
- package/dist/client/types.d.ts +1 -1
- package/dist/client/types.d.ts.map +1 -1
- package/dist/config.js +4 -4
- package/dist/config.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/tools/data-tools.d.ts.map +1 -1
- package/dist/tools/data-tools.js +1 -130
- package/dist/tools/data-tools.js.map +1 -1
- package/docs/project-goal-mcp.md +1 -1
- package/package.json +1 -1
package/QUICKSTART.md
CHANGED
|
@@ -20,7 +20,7 @@ Open Cursor settings and add to MCP servers:
|
|
|
20
20
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
21
21
|
"env": {
|
|
22
22
|
"NODUS_API_KEY": "nds_your_actual_key_here",
|
|
23
|
-
"
|
|
23
|
+
"NODUS_PROJECT_SLUG": "optional_project_slug"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -43,25 +43,81 @@ Try these commands in Cursor:
|
|
|
43
43
|
"List all tasks"
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## Available MCP Tools
|
|
47
|
+
|
|
48
|
+
### Project Management (3 tools)
|
|
49
|
+
- `list_projects` - List all your projects
|
|
50
|
+
- `create_project` - Create a new project with automatic API key
|
|
51
|
+
- `switch_project` - Switch to a different project
|
|
52
|
+
|
|
53
|
+
### Schema Management (6 tools)
|
|
54
|
+
- `list_tables` - List all tables in your project
|
|
55
|
+
- `get_table_schema` - Get detailed schema for a table
|
|
56
|
+
- `create_table` - Create a new table
|
|
57
|
+
- `update_table` - Update table name
|
|
58
|
+
- `add_column` - Add a new column to a table
|
|
59
|
+
- `update_column` - Update column properties
|
|
60
|
+
|
|
61
|
+
### Data Operations (2 tools)
|
|
62
|
+
- `get_row` - Get a single row by ID
|
|
63
|
+
- `create_row` - Create a new row
|
|
64
|
+
|
|
46
65
|
## Common Use Cases
|
|
47
66
|
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
### 📊 Schema Design
|
|
68
|
+
|
|
69
|
+
**Create a new table:**
|
|
70
|
+
```
|
|
71
|
+
"Create a new table called 'users' with slug 'users'"
|
|
72
|
+
"Create a 'blog_posts' table"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Add columns:**
|
|
76
|
+
```
|
|
77
|
+
"Add a 'title' string column to the users table"
|
|
78
|
+
"Add an 'email' string column (required) to users"
|
|
79
|
+
"Add a 'published_at' datetime column to blog_posts"
|
|
80
|
+
"Add a 'content' text column to blog_posts with default value 'Draft'"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**View schema:**
|
|
84
|
+
```
|
|
85
|
+
"Show me the schema for the users table"
|
|
86
|
+
"What columns does the blog_posts table have?"
|
|
87
|
+
"List all my database tables"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Update schema:**
|
|
91
|
+
```
|
|
92
|
+
"Rename the users table to 'customers'"
|
|
93
|
+
"Make the email column required in users table"
|
|
94
|
+
"Update the title column to be required"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 💾 Data Management
|
|
98
|
+
|
|
99
|
+
**Create records:**
|
|
100
|
+
```
|
|
101
|
+
"Create a new user with name 'John Doe' and email 'john@example.com'"
|
|
102
|
+
"Add a blog post with title 'My First Post' and content 'Hello World'"
|
|
103
|
+
"Insert a task with title 'Learn MCP' and status 'pending'"
|
|
104
|
+
```
|
|
53
105
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
106
|
+
**Read records:**
|
|
107
|
+
```
|
|
108
|
+
"Get the user with ID abc-123"
|
|
109
|
+
"Show me the blog post with ID xyz-456"
|
|
110
|
+
"Retrieve the task with ID def-789"
|
|
111
|
+
```
|
|
59
112
|
|
|
60
|
-
### Project Management
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
113
|
+
### 🎯 Project Management
|
|
114
|
+
|
|
115
|
+
**Work with projects:**
|
|
116
|
+
```
|
|
117
|
+
"List all my projects"
|
|
118
|
+
"Create a new project called 'Production API'"
|
|
119
|
+
"Switch to project 'my-dev-project'"
|
|
120
|
+
```
|
|
65
121
|
|
|
66
122
|
## Troubleshooting
|
|
67
123
|
|
|
@@ -90,7 +146,7 @@ Try these commands in Cursor:
|
|
|
90
146
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
91
147
|
"env": {
|
|
92
148
|
"NODUS_API_KEY": "nds_dev_key",
|
|
93
|
-
"
|
|
149
|
+
"NODUS_PROJECT_SLUG": "dev-project"
|
|
94
150
|
}
|
|
95
151
|
},
|
|
96
152
|
"nodus-prod": {
|
|
@@ -98,7 +154,7 @@ Try these commands in Cursor:
|
|
|
98
154
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
99
155
|
"env": {
|
|
100
156
|
"NODUS_API_KEY": "nds_prod_key",
|
|
101
|
-
"
|
|
157
|
+
"NODUS_PROJECT_SLUG": "production"
|
|
102
158
|
}
|
|
103
159
|
}
|
|
104
160
|
}
|
|
@@ -136,4 +192,115 @@ Try these commands in Cursor:
|
|
|
136
192
|
4. **Batch operations**: Ask for multiple operations in one message
|
|
137
193
|
5. **Context aware**: The LLM remembers previous table structures
|
|
138
194
|
|
|
195
|
+
## Complete Workflow Examples
|
|
196
|
+
|
|
197
|
+
### Example 1: Building a Blog System
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
# Step 1: Create tables
|
|
201
|
+
"Create a 'posts' table and an 'authors' table"
|
|
202
|
+
|
|
203
|
+
# Step 2: Add columns to posts
|
|
204
|
+
"Add these columns to posts table:
|
|
205
|
+
- title (string, required)
|
|
206
|
+
- slug (string, required)
|
|
207
|
+
- content (text, required)
|
|
208
|
+
- published_at (datetime)
|
|
209
|
+
- author_id (string, required)"
|
|
210
|
+
|
|
211
|
+
# Step 3: Add columns to authors
|
|
212
|
+
"Add these columns to authors table:
|
|
213
|
+
- name (string, required)
|
|
214
|
+
- email (string, required)
|
|
215
|
+
- bio (text)"
|
|
216
|
+
|
|
217
|
+
# Step 4: Create sample data
|
|
218
|
+
"Create an author with name 'John Doe' and email 'john@example.com'"
|
|
219
|
+
|
|
220
|
+
# Step 5: Create a blog post
|
|
221
|
+
"Create a post with title 'Hello World', slug 'hello-world',
|
|
222
|
+
content 'This is my first post', and use the author ID from the previous author"
|
|
223
|
+
|
|
224
|
+
# Step 6: Query specific data
|
|
225
|
+
"Get the post with ID xyz-123"
|
|
226
|
+
"Retrieve the author with ID abc-456"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Example 2: Task Management App
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
# Create table
|
|
233
|
+
"Create a table called 'tasks' with slug 'tasks'"
|
|
234
|
+
|
|
235
|
+
# Add columns
|
|
236
|
+
"Add a 'title' string column (required) to tasks"
|
|
237
|
+
"Add a 'description' text column to tasks"
|
|
238
|
+
"Add a 'status' string column to tasks with default value 'pending'"
|
|
239
|
+
"Add a 'due_date' datetime column to tasks"
|
|
240
|
+
"Add a 'priority' string column to tasks"
|
|
241
|
+
|
|
242
|
+
# Add tasks
|
|
243
|
+
"Create a task with title 'Buy groceries', status 'pending', priority 'high'"
|
|
244
|
+
"Create a task with title 'Finish report', status 'in_progress', priority 'high'"
|
|
245
|
+
"Create a task with title 'Clean house', status 'pending', priority 'low'"
|
|
246
|
+
|
|
247
|
+
# Query specific tasks
|
|
248
|
+
"Get the task with ID task-123"
|
|
249
|
+
"Show me the task with ID task-456"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Example 3: E-commerce Product Catalog
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
# Setup schema
|
|
256
|
+
"Create tables: products, categories, and orders"
|
|
257
|
+
|
|
258
|
+
# Products table
|
|
259
|
+
"Add columns to products:
|
|
260
|
+
- name (string, required)
|
|
261
|
+
- sku (string, required)
|
|
262
|
+
- price (float, required)
|
|
263
|
+
- description (text)
|
|
264
|
+
- stock (integer, default: 0)
|
|
265
|
+
- category_id (string)
|
|
266
|
+
- is_active (boolean, default: true)"
|
|
267
|
+
|
|
268
|
+
# Categories table
|
|
269
|
+
"Add to categories: name (string, required), slug (string, required)"
|
|
270
|
+
|
|
271
|
+
# Orders table
|
|
272
|
+
"Add to orders:
|
|
273
|
+
- product_id (string, required)
|
|
274
|
+
- quantity (integer, required)
|
|
275
|
+
- total_price (float, required)
|
|
276
|
+
- status (string, default: 'pending')"
|
|
277
|
+
|
|
278
|
+
# Add sample data
|
|
279
|
+
"Create a category called 'Electronics' with slug 'electronics'"
|
|
280
|
+
"Create a product: name 'Laptop', sku 'LAP-001', price 999.99,
|
|
281
|
+
category_id from electronics category, stock 50"
|
|
282
|
+
|
|
283
|
+
# Retrieve specific items
|
|
284
|
+
"Get the product with ID prod-123"
|
|
285
|
+
"Show me the category with ID cat-456"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Advanced Features
|
|
289
|
+
|
|
290
|
+
### Schema Exploration
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
"Show me all my tables"
|
|
294
|
+
"What is the schema for the users table?"
|
|
295
|
+
"List all columns in the products table"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Data Retrieval
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
"Get the user with ID abc-123"
|
|
302
|
+
"Show me the order with ID order-456"
|
|
303
|
+
"Retrieve the post with ID post-789"
|
|
304
|
+
```
|
|
305
|
+
|
|
139
306
|
Enjoy building with NodusAPI and AI! 🚀
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Set these environment variables in your MCP client configuration:
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
NODUS_API_KEY=nds_your_api_key_here
|
|
61
|
-
|
|
61
|
+
NODUS_PROJECT_SLUG=your_project_slug (optional)
|
|
62
62
|
NODUS_API_URL=https://api.nodus.com (optional, defaults to production)
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ NODUS_API_URL=https://api.nodus.com (optional, defaults to production)
|
|
|
67
67
|
If no configuration is found, the server will prompt you for:
|
|
68
68
|
- API Key
|
|
69
69
|
- API URL (defaults to https://api.nodus.com)
|
|
70
|
-
- Project
|
|
70
|
+
- Project Slug (optional)
|
|
71
71
|
|
|
72
72
|
Configuration is saved to `~/.nodus-mcp/config.json` for future use.
|
|
73
73
|
|
|
@@ -78,7 +78,7 @@ Create `~/.nodus-mcp/config.json`:
|
|
|
78
78
|
```json
|
|
79
79
|
{
|
|
80
80
|
"apiKey": "nds_your_api_key_here",
|
|
81
|
-
"
|
|
81
|
+
"projectSlug": "your_project_slug",
|
|
82
82
|
"apiUrl": "https://api.nodus.com"
|
|
83
83
|
}
|
|
84
84
|
```
|
|
@@ -95,7 +95,7 @@ Add to your `.cursor/settings.json` or Cursor MCP settings:
|
|
|
95
95
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
96
96
|
"env": {
|
|
97
97
|
"NODUS_API_KEY": "nds_your_api_key_here",
|
|
98
|
-
"
|
|
98
|
+
"NODUS_PROJECT_SLUG": "your_project_slug"
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# MCP Authentication Troubleshooting Guide
|
|
2
|
+
|
|
3
|
+
## Problem: "Authentication Required" Error
|
|
4
|
+
|
|
5
|
+
When connecting to Nodus MCP Server, you receive:
|
|
6
|
+
```
|
|
7
|
+
Authentication required
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Root Causes & Solutions
|
|
11
|
+
|
|
12
|
+
### 1. Invalid or Expired API Key
|
|
13
|
+
|
|
14
|
+
**Symptoms:**
|
|
15
|
+
- 401 Unauthorized error
|
|
16
|
+
- "Authentication required" message
|
|
17
|
+
|
|
18
|
+
**Solution:**
|
|
19
|
+
Create a new API key from Nodus Dashboard:
|
|
20
|
+
|
|
21
|
+
1. Go to Settings → API Keys
|
|
22
|
+
2. Click "Create New API Key"
|
|
23
|
+
3. Give it a name (e.g., "MCP Server")
|
|
24
|
+
4. **Copy the full key immediately** (it won't be shown again)
|
|
25
|
+
5. Update your MCP configuration
|
|
26
|
+
|
|
27
|
+
### 2. Wrong API Key Format
|
|
28
|
+
|
|
29
|
+
**Check:**
|
|
30
|
+
- API key should start with `nodus_`
|
|
31
|
+
- Should be approximately 70-80 characters long
|
|
32
|
+
- Example: `nodus_32c664c79c872c136b9716bca343bf0659efb63ba6efe32c936553050ad5ffde`
|
|
33
|
+
|
|
34
|
+
**Common mistakes:**
|
|
35
|
+
- Using the key prefix instead of full key
|
|
36
|
+
- Using an old key format (nds_ prefix)
|
|
37
|
+
- Copying key with extra spaces or newlines
|
|
38
|
+
|
|
39
|
+
### 3. Backend Not Running
|
|
40
|
+
|
|
41
|
+
**Check:**
|
|
42
|
+
```bash
|
|
43
|
+
curl http://localhost:3000/health
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Should return: `{"status":"ok"}`
|
|
47
|
+
|
|
48
|
+
If not running:
|
|
49
|
+
```bash
|
|
50
|
+
cd /path/to/nodusapi
|
|
51
|
+
npm run dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 4. Wrong API URL
|
|
55
|
+
|
|
56
|
+
**Check your configuration:**
|
|
57
|
+
- Local development: `http://localhost:3000`
|
|
58
|
+
- Production: `https://api.nodus.com`
|
|
59
|
+
|
|
60
|
+
**Don't use:**
|
|
61
|
+
- URLs with trailing slash: `http://localhost:3000/` ❌
|
|
62
|
+
- HTTPS for localhost: `https://localhost:3000` ❌
|
|
63
|
+
|
|
64
|
+
### 5. Case Sensitivity Issues
|
|
65
|
+
|
|
66
|
+
HTTP headers are case-insensitive, but some clients may have issues.
|
|
67
|
+
|
|
68
|
+
**Correct header:** `X-API-Key` or `x-api-key` (both work)
|
|
69
|
+
|
|
70
|
+
## Testing Your API Key
|
|
71
|
+
|
|
72
|
+
### Method 1: Using curl
|
|
73
|
+
```bash
|
|
74
|
+
curl http://localhost:3000/api/v1/projects \
|
|
75
|
+
-H "X-API-Key: YOUR_API_KEY_HERE"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Expected response:
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"success": true,
|
|
82
|
+
"data": [...]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Method 2: Using the test script
|
|
87
|
+
|
|
88
|
+
Create `test-auth.js`:
|
|
89
|
+
```javascript
|
|
90
|
+
import axios from 'axios';
|
|
91
|
+
|
|
92
|
+
const apiKey = 'YOUR_API_KEY_HERE';
|
|
93
|
+
const apiUrl = 'http://localhost:3000';
|
|
94
|
+
|
|
95
|
+
console.log('Key Prefix:', apiKey.substring(0, 18));
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const response = await axios.get(`${apiUrl}/api/v1/projects`, {
|
|
99
|
+
headers: { 'X-API-Key': apiKey }
|
|
100
|
+
});
|
|
101
|
+
console.log('✅ Success!', response.data);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.log('❌ Error:', error.response?.data || error.message);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Run:
|
|
108
|
+
```bash
|
|
109
|
+
node test-auth.js
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Method 3: Check MCP Server Logs
|
|
113
|
+
|
|
114
|
+
When running MCP server in Cursor, check the MCP logs:
|
|
115
|
+
1. Open Cursor Command Palette (Cmd/Ctrl + Shift + P)
|
|
116
|
+
2. Search for "MCP: Show Logs"
|
|
117
|
+
3. Look for authentication errors
|
|
118
|
+
|
|
119
|
+
## Valid MCP Configuration
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"nodus": {
|
|
125
|
+
"command": "npx",
|
|
126
|
+
"args": ["-y", "@nodusapi/mcp-server@latest"],
|
|
127
|
+
"env": {
|
|
128
|
+
"NODUS_API_URL": "http://localhost:3000",
|
|
129
|
+
"NODUS_API_KEY": "nodus_your_full_api_key_here",
|
|
130
|
+
"NODUS_PROJECT_SLUG": "your-project-slug"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Debugging Checklist
|
|
138
|
+
|
|
139
|
+
- [ ] Backend is running (test with `/health` endpoint)
|
|
140
|
+
- [ ] API key is valid (test with curl)
|
|
141
|
+
- [ ] API key starts with `nodus_`
|
|
142
|
+
- [ ] API key is the full key (not just prefix)
|
|
143
|
+
- [ ] API URL is correct (no trailing slash)
|
|
144
|
+
- [ ] Project slug exists in your account
|
|
145
|
+
- [ ] MCP server version is latest (`@latest` in config)
|
|
146
|
+
|
|
147
|
+
## Getting Help
|
|
148
|
+
|
|
149
|
+
If still having issues:
|
|
150
|
+
|
|
151
|
+
1. Check backend logs: Look for authentication attempts in your API server logs
|
|
152
|
+
2. Check MCP logs: Look for connection errors in Cursor MCP logs
|
|
153
|
+
3. Verify API key in database: Ensure the key exists and is active
|
|
154
|
+
4. Test with a fresh API key: Create a new one from dashboard
|
|
155
|
+
|
|
156
|
+
## Common Error Messages
|
|
157
|
+
|
|
158
|
+
| Error | Meaning | Solution |
|
|
159
|
+
|-------|---------|----------|
|
|
160
|
+
| "Authentication required" | No valid API key found | Create new API key |
|
|
161
|
+
| "Invalid API key format" | Key doesn't start with `nodus_` | Use correct format |
|
|
162
|
+
| "Connection refused" | Backend not running | Start backend server |
|
|
163
|
+
| "Invalid API URL format" | Malformed URL | Check URL syntax |
|
|
164
|
+
| "Resource not found" | Wrong project slug | Verify project slug |
|
|
165
|
+
|
|
166
|
+
## Quick Fix: Create New API Key
|
|
167
|
+
|
|
168
|
+
1. **Open Nodus Dashboard** → Settings
|
|
169
|
+
2. **Create API Key** → Give it a name
|
|
170
|
+
3. **Copy the full key** (all ~70+ characters)
|
|
171
|
+
4. **Update MCP config** in Cursor settings
|
|
172
|
+
5. **Restart Cursor** to reload MCP servers
|
|
173
|
+
|
|
174
|
+
The most common issue is using an invalid or expired API key. Always create a fresh key from the dashboard if you're unsure.
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;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jB,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB"}
|
package/dist/config.js
CHANGED
|
@@ -23,12 +23,12 @@ export async function saveConfig(config) {
|
|
|
23
23
|
}
|
|
24
24
|
export async function getConfig() {
|
|
25
25
|
const apiKey = process.env.NODUS_API_KEY;
|
|
26
|
-
const
|
|
26
|
+
const projectSlug = process.env.NODUS_PROJECT_SLUG;
|
|
27
27
|
const apiUrl = process.env.NODUS_API_URL || 'https://api.nodus.com';
|
|
28
28
|
if (apiKey) {
|
|
29
29
|
return {
|
|
30
30
|
apiKey,
|
|
31
|
-
|
|
31
|
+
projectSlug,
|
|
32
32
|
apiUrl,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
@@ -58,11 +58,11 @@ export async function promptForConfig() {
|
|
|
58
58
|
throw new Error('API Key is required');
|
|
59
59
|
}
|
|
60
60
|
const apiUrl = await question('API URL (default: https://api.nodus.com): ');
|
|
61
|
-
const
|
|
61
|
+
const projectSlug = await question('Project Slug (optional, press Enter to skip): ');
|
|
62
62
|
const config = {
|
|
63
63
|
apiKey: apiKey.trim(),
|
|
64
64
|
apiUrl: apiUrl.trim() || 'https://api.nodus.com',
|
|
65
|
-
|
|
65
|
+
projectSlug: projectSlug.trim() || undefined,
|
|
66
66
|
};
|
|
67
67
|
await saveConfig(config);
|
|
68
68
|
console.error('\n✓ Configuration saved successfully!\n');
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACzD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAEzD,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAmB;IAClD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IACzC,MAAM,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config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AAC;QAErF,MAAM,MAAM,GAAgB;YAC1B,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE;YACrB,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,uBAAuB;YAChD,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,SAAS;SAC7C,CAAC;QAEF,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAEzD,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,8 +23,8 @@ async function main() {
|
|
|
23
23
|
console.error(`✓ Configuration validated`);
|
|
24
24
|
console.error(`✓ API Key: ${maskApiKey(config.apiKey)}`);
|
|
25
25
|
console.error(`✓ API URL: ${config.apiUrl}`);
|
|
26
|
-
if (config.
|
|
27
|
-
console.error(`✓ Project
|
|
26
|
+
if (config.projectSlug) {
|
|
27
|
+
console.error(`✓ Project Slug: ${config.projectSlug}`);
|
|
28
28
|
}
|
|
29
29
|
console.error('');
|
|
30
30
|
}
|
|
@@ -50,9 +50,9 @@ async function main() {
|
|
|
50
50
|
await server.connect(transport);
|
|
51
51
|
console.error('✓ Nodus MCP Server is running!\n');
|
|
52
52
|
console.error('Available capabilities:');
|
|
53
|
-
console.error(' - Data CRUD:
|
|
53
|
+
console.error(' - Data CRUD: get_row, create_row');
|
|
54
54
|
console.error(' - Schema Management: list_tables, get_table_schema, create_table, update_table, add_column, update_column');
|
|
55
|
-
console.error(' - Project Management: list_projects, create_project, switch_project
|
|
55
|
+
console.error(' - Project Management: list_projects, create_project, switch_project');
|
|
56
56
|
console.error(' - Resources: nodus://schemas/tables\n');
|
|
57
57
|
console.error('Server is ready to receive requests from MCP clients.\n');
|
|
58
58
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAEhD,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACzE,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC;QACH,cAAc,CAAC,MAAM,CAAC,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC3C,OAAO,CAAC,KAAK,CAAC,cAAc,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,KAAK,CAAC,cAAc,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MA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AAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-tools.d.ts","sourceRoot":"","sources":["../../src/tools/data-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"data-tools.d.ts","sourceRoot":"","sources":["../../src/tools/data-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,QAoHpE"}
|
package/dist/tools/data-tools.js
CHANGED
|
@@ -1,45 +1,8 @@
|
|
|
1
1
|
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { GetRowSchema, CreateRowSchema, } from '../utils/validation.js';
|
|
3
3
|
export function registerDataTools(server, client) {
|
|
4
4
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
5
5
|
const tools = [
|
|
6
|
-
{
|
|
7
|
-
name: 'list_rows',
|
|
8
|
-
description: 'List rows from a table with pagination and filtering support',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
tableSlug: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
description: 'Table identifier (slug)',
|
|
15
|
-
},
|
|
16
|
-
page: {
|
|
17
|
-
type: 'number',
|
|
18
|
-
description: 'Page number for pagination',
|
|
19
|
-
default: 1,
|
|
20
|
-
},
|
|
21
|
-
limit: {
|
|
22
|
-
type: 'number',
|
|
23
|
-
description: 'Number of rows per page (max 100)',
|
|
24
|
-
default: 20,
|
|
25
|
-
},
|
|
26
|
-
orderBy: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'Column to order by',
|
|
29
|
-
},
|
|
30
|
-
orderDir: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
enum: ['ASC', 'DESC'],
|
|
33
|
-
description: 'Sort direction',
|
|
34
|
-
},
|
|
35
|
-
filters: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
description: 'Filters to apply (column: value pairs)',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
required: ['tableSlug'],
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
6
|
{
|
|
44
7
|
name: 'get_row',
|
|
45
8
|
description: 'Get a single row by ID from a table',
|
|
@@ -76,46 +39,6 @@ export function registerDataTools(server, client) {
|
|
|
76
39
|
required: ['tableSlug', 'data'],
|
|
77
40
|
},
|
|
78
41
|
},
|
|
79
|
-
{
|
|
80
|
-
name: 'update_row',
|
|
81
|
-
description: 'Update an existing row in a table',
|
|
82
|
-
inputSchema: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
properties: {
|
|
85
|
-
tableSlug: {
|
|
86
|
-
type: 'string',
|
|
87
|
-
description: 'Table identifier (slug)',
|
|
88
|
-
},
|
|
89
|
-
id: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Row UUID',
|
|
92
|
-
},
|
|
93
|
-
data: {
|
|
94
|
-
type: 'object',
|
|
95
|
-
description: 'Partial row data to update',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
required: ['tableSlug', 'id', 'data'],
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'delete_row',
|
|
103
|
-
description: 'Delete a row from a table',
|
|
104
|
-
inputSchema: {
|
|
105
|
-
type: 'object',
|
|
106
|
-
properties: {
|
|
107
|
-
tableSlug: {
|
|
108
|
-
type: 'string',
|
|
109
|
-
description: 'Table identifier (slug)',
|
|
110
|
-
},
|
|
111
|
-
id: {
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: 'Row UUID to delete',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
required: ['tableSlug', 'id'],
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
42
|
];
|
|
120
43
|
return { tools };
|
|
121
44
|
});
|
|
@@ -123,28 +46,6 @@ export function registerDataTools(server, client) {
|
|
|
123
46
|
const { name, arguments: args } = request.params;
|
|
124
47
|
try {
|
|
125
48
|
switch (name) {
|
|
126
|
-
case 'list_rows': {
|
|
127
|
-
const params = ListRowsSchema.parse(args);
|
|
128
|
-
const result = await client.listRows(params.tableSlug, {
|
|
129
|
-
page: params.page,
|
|
130
|
-
limit: params.limit,
|
|
131
|
-
orderBy: params.orderBy,
|
|
132
|
-
orderDir: params.orderDir,
|
|
133
|
-
filters: params.filters,
|
|
134
|
-
});
|
|
135
|
-
return {
|
|
136
|
-
content: [
|
|
137
|
-
{
|
|
138
|
-
type: 'text',
|
|
139
|
-
text: JSON.stringify({
|
|
140
|
-
rows: result.data,
|
|
141
|
-
pagination: result.meta,
|
|
142
|
-
message: `Found ${result.meta.total} rows in table "${params.tableSlug}"`,
|
|
143
|
-
}, null, 2),
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
49
|
case 'get_row': {
|
|
149
50
|
const params = GetRowSchema.parse(args);
|
|
150
51
|
const row = await client.getRow(params.tableSlug, params.id);
|
|
@@ -175,36 +76,6 @@ export function registerDataTools(server, client) {
|
|
|
175
76
|
],
|
|
176
77
|
};
|
|
177
78
|
}
|
|
178
|
-
case 'update_row': {
|
|
179
|
-
const params = UpdateRowSchema.parse(args);
|
|
180
|
-
const row = await client.updateRow(params.tableSlug, params.id, params.data);
|
|
181
|
-
return {
|
|
182
|
-
content: [
|
|
183
|
-
{
|
|
184
|
-
type: 'text',
|
|
185
|
-
text: JSON.stringify({
|
|
186
|
-
row,
|
|
187
|
-
message: `Successfully updated row ${params.id} in table "${params.tableSlug}"`,
|
|
188
|
-
}, null, 2),
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
case 'delete_row': {
|
|
194
|
-
const params = DeleteRowSchema.parse(args);
|
|
195
|
-
await client.deleteRow(params.tableSlug, params.id);
|
|
196
|
-
return {
|
|
197
|
-
content: [
|
|
198
|
-
{
|
|
199
|
-
type: 'text',
|
|
200
|
-
text: JSON.stringify({
|
|
201
|
-
success: true,
|
|
202
|
-
message: `Successfully deleted row ${params.id} from table "${params.tableSlug}"`,
|
|
203
|
-
}, null, 2),
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
79
|
default:
|
|
209
80
|
throw new Error(`Unknown tool: ${name}`);
|
|
210
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-tools.js","sourceRoot":"","sources":["../../src/tools/data-tools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"data-tools.js","sourceRoot":"","sources":["../../src/tools/data-tools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,YAAY,EACZ,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,MAAmB;IACnE,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,KAAK,GAAG;YACZ;gBACE,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,qCAAqC;gBAClD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBAC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E,gBAAgB,MAAM,CAAC,SAAS,GAAG;iCACvE,EACD,IAAI,EACJ,CAAC,CACF;6BACF;yBACF;qBACF,CAAC;gBACJ,CAAC;gBAED,KAAK,YAAY,CAAC,CAAC,CAAC;oBAClB,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAC3C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBAElE,OAAO;wBACL,OAAO,EAAE;4BACP;gCACE,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oCACE,GAAG;oCACH,OAAO,EAAE,sCAAsC,MAAM,CAAC,SAAS,GAAG;iCACnE,EACD,IAAI,EACJ,CAAC,CACF;6BACF;yBACF;qBACF,CAAC;gBACJ,CAAC;gBAED;oBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,KAAK,EAAE,YAAY;4BACnB,IAAI,EAAE,IAAI;yBACX,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/docs/project-goal-mcp.md
CHANGED
|
@@ -92,7 +92,7 @@ To test locally:
|
|
|
92
92
|
2. Set environment variables:
|
|
93
93
|
```bash
|
|
94
94
|
export NODUS_API_KEY="nds_your_key"
|
|
95
|
-
export
|
|
95
|
+
export NODUS_PROJECT_SLUG="your_project_slug"
|
|
96
96
|
```
|
|
97
97
|
3. Run: `npm start`
|
|
98
98
|
4. Configure Cursor to use local server
|