@nodusapi/mcp-server 1.2.1 → 1.3.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/MIGRATION_GUIDE.md +212 -0
- package/QUICKSTART.md +18 -7
- package/README.md +6 -6
- package/TROUBLESHOOTING.md +1 -2
- package/cursor-config.example.json +0 -1
- package/dist/client/types.d.ts +0 -1
- package/dist/client/types.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -4
- package/dist/config.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/docs/project-goal-mcp.md +3 -3
- package/package.json +1 -1
- package/dist/tools/data-tools.d.ts +0 -4
- package/dist/tools/data-tools.d.ts.map +0 -1
- package/dist/tools/data-tools.js +0 -100
- package/dist/tools/data-tools.js.map +0 -1
- package/dist/tools/project-tools.d.ts +0 -4
- package/dist/tools/project-tools.d.ts.map +0 -1
- package/dist/tools/project-tools.js +0 -123
- package/dist/tools/project-tools.js.map +0 -1
- package/dist/tools/schema-tools.d.ts +0 -4
- package/dist/tools/schema-tools.d.ts.map +0 -1
- package/dist/tools/schema-tools.js +0 -274
- package/dist/tools/schema-tools.js.map +0 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Migration Guide: Removing PROJECT_SLUG Requirement
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Starting from version 1.3.0, the `NODUS_PROJECT_SLUG` environment variable is **no longer required** in MCP server configuration. This change makes project management more flexible by allowing users to work with multiple projects dynamically through MCP tools.
|
|
6
|
+
|
|
7
|
+
## What Changed?
|
|
8
|
+
|
|
9
|
+
### Before (v1.2.x and earlier)
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"nodus": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "@nodusapi/mcp-server"],
|
|
17
|
+
"env": {
|
|
18
|
+
"NODUS_API_KEY": "nds_your_key",
|
|
19
|
+
"NODUS_PROJECT_SLUG": "my-project" // ❌ No longer needed
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### After (v1.3.0+)
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"nodus": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["-y", "@nodusapi/mcp-server"],
|
|
34
|
+
"env": {
|
|
35
|
+
"NODUS_API_KEY": "nds_your_key" // ✅ Only API key needed
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Why This Change?
|
|
43
|
+
|
|
44
|
+
1. **More Flexible**: Users can work with multiple projects without reconfiguring
|
|
45
|
+
2. **Better UX**: No need to know project slug upfront
|
|
46
|
+
3. **Consistent**: Aligns with how the API and web dashboard work
|
|
47
|
+
4. **Dynamic**: Use MCP tools to list and switch between projects
|
|
48
|
+
|
|
49
|
+
## How to Migrate
|
|
50
|
+
|
|
51
|
+
### Step 1: Update Your Configuration
|
|
52
|
+
|
|
53
|
+
Remove `NODUS_PROJECT_SLUG` from your MCP configuration:
|
|
54
|
+
|
|
55
|
+
**Cursor Settings** (`.cursor/settings.json`):
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"nodus": {
|
|
60
|
+
"command": "npx",
|
|
61
|
+
"args": ["-y", "@nodusapi/mcp-server@latest"],
|
|
62
|
+
"env": {
|
|
63
|
+
"NODUS_API_KEY": "nds_your_key"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Config File** (`~/.nodus-mcp/config.json`):
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"apiKey": "nds_your_key",
|
|
74
|
+
"apiUrl": "https://api.nodus.com"
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 2: Use Project Management Tools
|
|
79
|
+
|
|
80
|
+
After connecting, use these MCP tools to manage projects:
|
|
81
|
+
|
|
82
|
+
#### List Available Projects
|
|
83
|
+
```
|
|
84
|
+
"Show me all my projects"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
or explicitly call the tool:
|
|
88
|
+
- Tool: `list_projects`
|
|
89
|
+
- No parameters needed
|
|
90
|
+
- Returns: List of all projects with their IDs and slugs
|
|
91
|
+
|
|
92
|
+
#### Switch to a Project
|
|
93
|
+
```
|
|
94
|
+
"Switch to project [project-id]"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
or explicitly:
|
|
98
|
+
- Tool: `switch_project`
|
|
99
|
+
- Parameters: `{ "projectId": "uuid-here" }`
|
|
100
|
+
- Returns: New project context
|
|
101
|
+
|
|
102
|
+
#### Create a New Project
|
|
103
|
+
```
|
|
104
|
+
"Create a new project called 'My New Project'"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
or explicitly:
|
|
108
|
+
- Tool: `create_project`
|
|
109
|
+
- Parameters: `{ "name": "My New Project" }`
|
|
110
|
+
- Returns: New project with auto-generated API key
|
|
111
|
+
|
|
112
|
+
## Workflow Example
|
|
113
|
+
|
|
114
|
+
### Old Way (v1.2.x)
|
|
115
|
+
1. Know your project slug beforehand
|
|
116
|
+
2. Configure MCP with `NODUS_PROJECT_SLUG`
|
|
117
|
+
3. Restart Cursor if you need to switch projects
|
|
118
|
+
4. Reconfigure MCP with new slug
|
|
119
|
+
|
|
120
|
+
### New Way (v1.3.0+)
|
|
121
|
+
1. Configure MCP once with just your API key
|
|
122
|
+
2. Ask: "List my projects"
|
|
123
|
+
3. Ask: "Switch to project [id]"
|
|
124
|
+
4. Start working - no restart needed!
|
|
125
|
+
|
|
126
|
+
## Breaking Changes
|
|
127
|
+
|
|
128
|
+
⚠️ **None!** This is a backwards-compatible change.
|
|
129
|
+
|
|
130
|
+
- If you have `NODUS_PROJECT_SLUG` in your config, it will be **ignored** (no errors)
|
|
131
|
+
- Existing configurations will continue to work
|
|
132
|
+
- Just remove the unused parameter when convenient
|
|
133
|
+
|
|
134
|
+
## Benefits
|
|
135
|
+
|
|
136
|
+
### For Single Project Users
|
|
137
|
+
- Simpler configuration (one less parameter)
|
|
138
|
+
- Same workflow as before
|
|
139
|
+
- API key automatically works with your project
|
|
140
|
+
|
|
141
|
+
### For Multi-Project Users
|
|
142
|
+
- No need for multiple MCP server configurations
|
|
143
|
+
- Switch between projects dynamically
|
|
144
|
+
- One connection, all projects
|
|
145
|
+
|
|
146
|
+
### For Teams
|
|
147
|
+
- Team members can use the same configuration
|
|
148
|
+
- Each person works with their own projects
|
|
149
|
+
- No need to share project-specific settings
|
|
150
|
+
|
|
151
|
+
## FAQs
|
|
152
|
+
|
|
153
|
+
**Q: Do I need to update immediately?**
|
|
154
|
+
A: No, existing configurations will continue to work. The `NODUS_PROJECT_SLUG` parameter is simply ignored.
|
|
155
|
+
|
|
156
|
+
**Q: How do I know which project I'm currently using?**
|
|
157
|
+
A: Use the `list_projects` tool or ask "Which project am I using?"
|
|
158
|
+
|
|
159
|
+
**Q: Can I still work with one specific project only?**
|
|
160
|
+
A: Yes! Just use `switch_project` once after connecting, then work as usual.
|
|
161
|
+
|
|
162
|
+
**Q: What if I have multiple API keys?**
|
|
163
|
+
A: You can still configure multiple MCP servers with different API keys:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"mcpServers": {
|
|
168
|
+
"nodus-account-1": {
|
|
169
|
+
"command": "npx",
|
|
170
|
+
"args": ["-y", "@nodusapi/mcp-server@latest"],
|
|
171
|
+
"env": {
|
|
172
|
+
"NODUS_API_KEY": "nds_key_1"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"nodus-account-2": {
|
|
176
|
+
"command": "npx",
|
|
177
|
+
"args": ["-y", "@nodusapi/mcp-server@latest"],
|
|
178
|
+
"env": {
|
|
179
|
+
"NODUS_API_KEY": "nds_key_2"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Q: Does this affect the web dashboard?**
|
|
187
|
+
A: No, the web dashboard (`nodusweb`) has also been updated to reflect this change. The MCP button no longer includes `PROJECT_SLUG` in generated configurations.
|
|
188
|
+
|
|
189
|
+
## Updated Documentation
|
|
190
|
+
|
|
191
|
+
All documentation has been updated to reflect this change:
|
|
192
|
+
|
|
193
|
+
- ✅ README.md
|
|
194
|
+
- ✅ QUICKSTART.md
|
|
195
|
+
- ✅ TROUBLESHOOTING.md
|
|
196
|
+
- ✅ cursor-config.example.json
|
|
197
|
+
- ✅ Web dashboard MCP button
|
|
198
|
+
- ✅ API documentation
|
|
199
|
+
|
|
200
|
+
## Support
|
|
201
|
+
|
|
202
|
+
If you have any questions or issues with this migration:
|
|
203
|
+
|
|
204
|
+
- Check the [Troubleshooting Guide](TROUBLESHOOTING.md)
|
|
205
|
+
- Open an issue on [GitHub](https://github.com/nodusapi/nodusmcp/issues)
|
|
206
|
+
- Reach out on our community channels
|
|
207
|
+
|
|
208
|
+
## Version History
|
|
209
|
+
|
|
210
|
+
- **v1.3.0** (Current): `PROJECT_SLUG` removed, project management via tools
|
|
211
|
+
- **v1.2.1**: Last version with `PROJECT_SLUG` support
|
|
212
|
+
- **v1.2.0**: Initial project management tools added
|
package/QUICKSTART.md
CHANGED
|
@@ -19,14 +19,15 @@ Open Cursor settings and add to MCP servers:
|
|
|
19
19
|
"command": "npx",
|
|
20
20
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
21
21
|
"env": {
|
|
22
|
-
"NODUS_API_KEY": "nds_your_actual_key_here"
|
|
23
|
-
"NODUS_PROJECT_SLUG": "optional_project_slug"
|
|
22
|
+
"NODUS_API_KEY": "nds_your_actual_key_here"
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
```
|
|
29
28
|
|
|
29
|
+
**Note:** You don't need to specify a project slug. Use the `list_projects` and `switch_project` tools to work with your projects after connecting.
|
|
30
|
+
|
|
30
31
|
### 3. Restart Cursor
|
|
31
32
|
|
|
32
33
|
Restart Cursor to load the MCP server.
|
|
@@ -136,7 +137,19 @@ Try these commands in Cursor:
|
|
|
136
137
|
|
|
137
138
|
## Advanced Configuration
|
|
138
139
|
|
|
139
|
-
### Multiple Projects
|
|
140
|
+
### Working with Multiple Projects
|
|
141
|
+
|
|
142
|
+
You can use the built-in project management tools to switch between projects:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
"List all my projects"
|
|
146
|
+
"Switch to project 'my-dev-project'"
|
|
147
|
+
"Create a new project called 'Production API'"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Using Different API Keys
|
|
151
|
+
|
|
152
|
+
If you need to work with multiple accounts or environments, you can configure separate MCP servers:
|
|
140
153
|
|
|
141
154
|
```json
|
|
142
155
|
{
|
|
@@ -145,16 +158,14 @@ Try these commands in Cursor:
|
|
|
145
158
|
"command": "npx",
|
|
146
159
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
147
160
|
"env": {
|
|
148
|
-
"NODUS_API_KEY": "nds_dev_key"
|
|
149
|
-
"NODUS_PROJECT_SLUG": "dev-project"
|
|
161
|
+
"NODUS_API_KEY": "nds_dev_key"
|
|
150
162
|
}
|
|
151
163
|
},
|
|
152
164
|
"nodus-prod": {
|
|
153
165
|
"command": "npx",
|
|
154
166
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
155
167
|
"env": {
|
|
156
|
-
"NODUS_API_KEY": "nds_prod_key"
|
|
157
|
-
"NODUS_PROJECT_SLUG": "production"
|
|
168
|
+
"NODUS_API_KEY": "nds_prod_key"
|
|
158
169
|
}
|
|
159
170
|
}
|
|
160
171
|
}
|
package/README.md
CHANGED
|
@@ -58,18 +58,18 @@ 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
|
-
NODUS_PROJECT_SLUG=your_project_slug (optional)
|
|
62
61
|
NODUS_API_URL=https://api.nodus.com (optional, defaults to production)
|
|
63
62
|
```
|
|
64
63
|
|
|
64
|
+
**Note:** You don't need to specify a project slug. Use the `list_projects` and `switch_project` tools to manage your projects.
|
|
65
|
+
|
|
65
66
|
### Option 2: Interactive Setup
|
|
66
67
|
|
|
67
68
|
If no configuration is found, the server will prompt you for:
|
|
68
69
|
- API Key
|
|
69
70
|
- API URL (defaults to https://api.nodus.com)
|
|
70
|
-
- Project Slug (optional)
|
|
71
71
|
|
|
72
|
-
Configuration is saved to `~/.nodus-mcp/config.json` for future use.
|
|
72
|
+
Configuration is saved to `~/.nodus-mcp/config.json` for future use. After connecting, use project management tools to select and switch between projects.
|
|
73
73
|
|
|
74
74
|
### Option 3: Manual Configuration
|
|
75
75
|
|
|
@@ -78,7 +78,6 @@ Create `~/.nodus-mcp/config.json`:
|
|
|
78
78
|
```json
|
|
79
79
|
{
|
|
80
80
|
"apiKey": "nds_your_api_key_here",
|
|
81
|
-
"projectSlug": "your_project_slug",
|
|
82
81
|
"apiUrl": "https://api.nodus.com"
|
|
83
82
|
}
|
|
84
83
|
```
|
|
@@ -94,14 +93,15 @@ Add to your `.cursor/settings.json` or Cursor MCP settings:
|
|
|
94
93
|
"command": "npx",
|
|
95
94
|
"args": ["-y", "@nodusapi/mcp-server"],
|
|
96
95
|
"env": {
|
|
97
|
-
"NODUS_API_KEY": "nds_your_api_key_here"
|
|
98
|
-
"NODUS_PROJECT_SLUG": "your_project_slug"
|
|
96
|
+
"NODUS_API_KEY": "nds_your_api_key_here"
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
```
|
|
104
102
|
|
|
103
|
+
After connecting, use the `list_projects` tool to see your projects, and `switch_project` to work with a specific project.
|
|
104
|
+
|
|
105
105
|
Or use a local path during development:
|
|
106
106
|
|
|
107
107
|
```json
|
package/TROUBLESHOOTING.md
CHANGED
|
@@ -126,8 +126,7 @@ When running MCP server in Cursor, check the MCP logs:
|
|
|
126
126
|
"args": ["-y", "@nodusapi/mcp-server@latest"],
|
|
127
127
|
"env": {
|
|
128
128
|
"NODUS_API_URL": "http://localhost:3000",
|
|
129
|
-
"NODUS_API_KEY": "nodus_your_full_api_key_here"
|
|
130
|
-
"NODUS_PROJECT_SLUG": "your-project-slug"
|
|
129
|
+
"NODUS_API_KEY": "nodus_your_full_api_key_here"
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
}
|
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,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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CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,wBAAsB,UAAU,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAO9D;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAOnE;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,wBAAsB,UAAU,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAO9D;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAOnE;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,CAmBtD;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CAqC5D"}
|
package/dist/config.js
CHANGED
|
@@ -23,12 +23,10 @@ export async function saveConfig(config) {
|
|
|
23
23
|
}
|
|
24
24
|
export async function getConfig() {
|
|
25
25
|
const apiKey = process.env.NODUS_API_KEY;
|
|
26
|
-
const projectSlug = process.env.NODUS_PROJECT_SLUG;
|
|
27
26
|
const apiUrl = process.env.NODUS_API_URL || 'https://api.nodus.com';
|
|
28
27
|
if (apiKey) {
|
|
29
28
|
return {
|
|
30
29
|
apiKey,
|
|
31
|
-
projectSlug,
|
|
32
30
|
apiUrl,
|
|
33
31
|
};
|
|
34
32
|
}
|
|
@@ -58,11 +56,9 @@ export async function promptForConfig() {
|
|
|
58
56
|
throw new Error('API Key is required');
|
|
59
57
|
}
|
|
60
58
|
const apiUrl = await question('API URL (default: https://api.nodus.com): ');
|
|
61
|
-
const projectSlug = await question('Project Slug (optional, press Enter to skip): ');
|
|
62
59
|
const config = {
|
|
63
60
|
apiKey: apiKey.trim(),
|
|
64
61
|
apiUrl: apiUrl.trim() || 'https://api.nodus.com',
|
|
65
|
-
projectSlug: projectSlug.trim() || undefined,
|
|
66
62
|
};
|
|
67
63
|
await saveConfig(config);
|
|
68
64
|
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,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EAAsE,CAAC,CAAC;IACtF,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAEtE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAmB,EAAE;QAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,4CAA4C,CAAC,CAAC;QAE5E,MAAM,MAAM,GAAgB;YAC1B,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE;YACrB,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,uBAAuB;SACjD,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
|
@@ -21,9 +21,6 @@ async function main() {
|
|
|
21
21
|
console.error(`✓ Configuration validated`);
|
|
22
22
|
console.error(`✓ API Key: ${maskApiKey(config.apiKey)}`);
|
|
23
23
|
console.error(`✓ API URL: ${config.apiUrl}`);
|
|
24
|
-
if (config.projectSlug) {
|
|
25
|
-
console.error(`✓ Project Slug: ${config.projectSlug}`);
|
|
26
|
-
}
|
|
27
24
|
console.error('');
|
|
28
25
|
}
|
|
29
26
|
catch (error) {
|
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,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,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,EA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
92
92
|
2. Set environment variables:
|
|
93
93
|
```bash
|
|
94
94
|
export NODUS_API_KEY="nds_your_key"
|
|
95
|
-
export NODUS_PROJECT_SLUG="your_project_slug"
|
|
96
95
|
```
|
|
97
96
|
3. Run: `npm start`
|
|
98
|
-
4.
|
|
99
|
-
5.
|
|
97
|
+
4. Use `list_projects` to see your projects and `switch_project` to select one
|
|
98
|
+
5. Configure Cursor to use local server
|
|
99
|
+
6. Test with natural language commands
|
|
100
100
|
|
|
101
101
|
## Future Enhancements
|
|
102
102
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { GetRowSchema, CreateRowSchema, } from '../utils/validation.js';
|
|
3
|
-
export function registerDataTools(server, client) {
|
|
4
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
5
|
-
const tools = [
|
|
6
|
-
{
|
|
7
|
-
name: 'get_row',
|
|
8
|
-
description: 'Get a single row by ID from a table',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
tableSlug: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
description: 'Table identifier (slug)',
|
|
15
|
-
},
|
|
16
|
-
id: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
description: 'Row UUID',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
required: ['tableSlug', 'id'],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'create_row',
|
|
26
|
-
description: 'Create a new row in a table',
|
|
27
|
-
inputSchema: {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
tableSlug: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Table identifier (slug)',
|
|
33
|
-
},
|
|
34
|
-
data: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
description: 'Row data matching table schema',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: ['tableSlug', 'data'],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
return { tools };
|
|
44
|
-
});
|
|
45
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
46
|
-
const { name, arguments: args } = request.params;
|
|
47
|
-
try {
|
|
48
|
-
switch (name) {
|
|
49
|
-
case 'get_row': {
|
|
50
|
-
const params = GetRowSchema.parse(args);
|
|
51
|
-
const row = await client.getRow(params.tableSlug, params.id);
|
|
52
|
-
return {
|
|
53
|
-
content: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
text: JSON.stringify({
|
|
57
|
-
row,
|
|
58
|
-
message: `Retrieved row ${params.id} from table "${params.tableSlug}"`,
|
|
59
|
-
}, null, 2),
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
case 'create_row': {
|
|
65
|
-
const params = CreateRowSchema.parse(args);
|
|
66
|
-
const row = await client.createRow(params.tableSlug, params.data);
|
|
67
|
-
return {
|
|
68
|
-
content: [
|
|
69
|
-
{
|
|
70
|
-
type: 'text',
|
|
71
|
-
text: JSON.stringify({
|
|
72
|
-
row,
|
|
73
|
-
message: `Successfully created row in table "${params.tableSlug}"`,
|
|
74
|
-
}, null, 2),
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
default:
|
|
80
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
85
|
-
return {
|
|
86
|
-
content: [
|
|
87
|
-
{
|
|
88
|
-
type: 'text',
|
|
89
|
-
text: JSON.stringify({
|
|
90
|
-
error: errorMessage,
|
|
91
|
-
tool: name,
|
|
92
|
-
}, null, 2),
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
isError: true,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=data-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;oBACd,UAAU,EAAE;wBACV,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,yBAAyB;yBACvC;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,UAAU;yBACxB;qBACF;oBACD,QAAQ,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;iBAC9B;aACF;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,WAAW,EAAE,6BAA6B;gBAC1C,WAAW,EAAE;oBAC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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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-tools.d.ts","sourceRoot":"","sources":["../../src/tools/project-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAOxD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,QAiJvE"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { ListProjectsSchema, CreateProjectSchema, SwitchProjectSchema, } from '../utils/validation.js';
|
|
3
|
-
export function registerProjectTools(server, client) {
|
|
4
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
5
|
-
const tools = [
|
|
6
|
-
{
|
|
7
|
-
name: 'list_projects',
|
|
8
|
-
description: 'List all projects for the authenticated user',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'create_project',
|
|
16
|
-
description: 'Create a new project with automatic API key generation',
|
|
17
|
-
inputSchema: {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
name: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'Project name',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
required: ['name'],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'switch_project',
|
|
30
|
-
description: 'Switch to a different project (returns new JWT token)',
|
|
31
|
-
inputSchema: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
projectId: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Project UUID to switch to',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: ['projectId'],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
return { tools };
|
|
44
|
-
});
|
|
45
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
46
|
-
const { name, arguments: args } = request.params;
|
|
47
|
-
try {
|
|
48
|
-
switch (name) {
|
|
49
|
-
case 'list_projects': {
|
|
50
|
-
ListProjectsSchema.parse(args);
|
|
51
|
-
const projects = await client.getProjects();
|
|
52
|
-
return {
|
|
53
|
-
content: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
text: JSON.stringify({
|
|
57
|
-
projects: projects.map((p) => ({
|
|
58
|
-
id: p.id,
|
|
59
|
-
name: p.name,
|
|
60
|
-
slug: p.slug,
|
|
61
|
-
createdAt: p.createdAt,
|
|
62
|
-
})),
|
|
63
|
-
count: projects.length,
|
|
64
|
-
message: `Found ${projects.length} projects`,
|
|
65
|
-
}, null, 2),
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
case 'create_project': {
|
|
71
|
-
const params = CreateProjectSchema.parse(args);
|
|
72
|
-
const project = await client.createProject(params.name);
|
|
73
|
-
return {
|
|
74
|
-
content: [
|
|
75
|
-
{
|
|
76
|
-
type: 'text',
|
|
77
|
-
text: JSON.stringify({
|
|
78
|
-
project,
|
|
79
|
-
message: `Successfully created project "${project.name}" with ID ${project.id}`,
|
|
80
|
-
note: 'An API key has been automatically generated for this project',
|
|
81
|
-
}, null, 2),
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
case 'switch_project': {
|
|
87
|
-
const params = SwitchProjectSchema.parse(args);
|
|
88
|
-
const result = await client.switchProject(params.projectId);
|
|
89
|
-
return {
|
|
90
|
-
content: [
|
|
91
|
-
{
|
|
92
|
-
type: 'text',
|
|
93
|
-
text: JSON.stringify({
|
|
94
|
-
project: result.project,
|
|
95
|
-
message: `Successfully switched to project "${result.project.name}"`,
|
|
96
|
-
note: 'A new JWT token has been issued. You may need to update your authentication.',
|
|
97
|
-
}, null, 2),
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
default:
|
|
103
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
108
|
-
return {
|
|
109
|
-
content: [
|
|
110
|
-
{
|
|
111
|
-
type: 'text',
|
|
112
|
-
text: JSON.stringify({
|
|
113
|
-
error: errorMessage,
|
|
114
|
-
tool: name,
|
|
115
|
-
}, null, 2),
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
isError: true,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=project-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-tools.js","sourceRoot":"","sources":["../../src/tools/project-tools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,MAAmB;IACtE,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,KAAK,GAAG;YACZ;gBACE,IAAI,EAAE,eAAe;gBACrB,WAAW,EAAE,8CAA8C;gBAC3D,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,EAAE;iBACf;aACF;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,wDAAwD;gBACrE,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB;aACF;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,uDAAuD;gBACpE,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,2BAA2B;yBACzC;qBACF;oBACD,QAAQ,EAAE,CAAC,WAAW,CAAC;iBACxB;aACF;SACF,CAAC;QAEF,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC,CACF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ts","sourceRoot":"","sources":["../../src/tools/schema-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAUxD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,QA0TtE"}
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { ListTablesSchema, GetTableSchemaSchema, CreateTableSchema, UpdateTableSchema, AddColumnSchema, UpdateColumnSchema, } from '../utils/validation.js';
|
|
3
|
-
export function registerSchemaTools(server, client) {
|
|
4
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
5
|
-
const tools = [
|
|
6
|
-
{
|
|
7
|
-
name: 'list_tables',
|
|
8
|
-
description: 'List all tables in the project',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'get_table_schema',
|
|
16
|
-
description: 'Get detailed schema for a specific table including all columns',
|
|
17
|
-
inputSchema: {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
tableSlug: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'Table identifier (slug)',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
required: ['tableSlug'],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'create_table',
|
|
30
|
-
description: 'Create a new table in the project',
|
|
31
|
-
inputSchema: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
name: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Human-readable table name',
|
|
37
|
-
},
|
|
38
|
-
slug: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Table slug (lowercase, numbers, underscores only)',
|
|
41
|
-
pattern: '^[a-z0-9_]+$',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
required: ['name', 'slug'],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'update_table',
|
|
49
|
-
description: 'Update table name',
|
|
50
|
-
inputSchema: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
properties: {
|
|
53
|
-
tableSlug: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
description: 'Current table slug',
|
|
56
|
-
},
|
|
57
|
-
name: {
|
|
58
|
-
type: 'string',
|
|
59
|
-
description: 'New table name',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
required: ['tableSlug', 'name'],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'add_column',
|
|
67
|
-
description: 'Add a new column to a table',
|
|
68
|
-
inputSchema: {
|
|
69
|
-
type: 'object',
|
|
70
|
-
properties: {
|
|
71
|
-
tableSlug: {
|
|
72
|
-
type: 'string',
|
|
73
|
-
description: 'Table identifier (slug)',
|
|
74
|
-
},
|
|
75
|
-
name: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
description: 'Human-readable column name',
|
|
78
|
-
},
|
|
79
|
-
slug: {
|
|
80
|
-
type: 'string',
|
|
81
|
-
description: 'Column slug (lowercase, numbers, underscores only)',
|
|
82
|
-
pattern: '^[a-z0-9_]+$',
|
|
83
|
-
},
|
|
84
|
-
type: {
|
|
85
|
-
type: 'string',
|
|
86
|
-
enum: ['string', 'text', 'integer', 'float', 'boolean', 'datetime', 'json'],
|
|
87
|
-
description: 'Column data type',
|
|
88
|
-
},
|
|
89
|
-
isRequired: {
|
|
90
|
-
type: 'boolean',
|
|
91
|
-
description: 'Whether the column is required',
|
|
92
|
-
},
|
|
93
|
-
defaultValue: {
|
|
94
|
-
description: 'Default value for the column',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
required: ['tableSlug', 'name', 'slug', 'type'],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'update_column',
|
|
102
|
-
description: 'Update column properties (name, isRequired, defaultValue)',
|
|
103
|
-
inputSchema: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
properties: {
|
|
106
|
-
tableSlug: {
|
|
107
|
-
type: 'string',
|
|
108
|
-
description: 'Table identifier (slug)',
|
|
109
|
-
},
|
|
110
|
-
columnSlug: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
description: 'Column identifier (slug)',
|
|
113
|
-
},
|
|
114
|
-
name: {
|
|
115
|
-
type: 'string',
|
|
116
|
-
description: 'New column name',
|
|
117
|
-
},
|
|
118
|
-
isRequired: {
|
|
119
|
-
type: 'boolean',
|
|
120
|
-
description: 'Whether the column is required',
|
|
121
|
-
},
|
|
122
|
-
defaultValue: {
|
|
123
|
-
description: 'Default value for the column',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
required: ['tableSlug', 'columnSlug'],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
];
|
|
130
|
-
return { tools };
|
|
131
|
-
});
|
|
132
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
133
|
-
const { name, arguments: args } = request.params;
|
|
134
|
-
try {
|
|
135
|
-
switch (name) {
|
|
136
|
-
case 'list_tables': {
|
|
137
|
-
ListTablesSchema.parse(args);
|
|
138
|
-
const tables = await client.getTables();
|
|
139
|
-
return {
|
|
140
|
-
content: [
|
|
141
|
-
{
|
|
142
|
-
type: 'text',
|
|
143
|
-
text: JSON.stringify({
|
|
144
|
-
tables: tables.map((t) => ({
|
|
145
|
-
name: t.name,
|
|
146
|
-
slug: t.slug,
|
|
147
|
-
rowCount: t.rowCount,
|
|
148
|
-
createdAt: t.createdAt,
|
|
149
|
-
})),
|
|
150
|
-
count: tables.length,
|
|
151
|
-
message: `Found ${tables.length} tables in the project`,
|
|
152
|
-
}, null, 2),
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
case 'get_table_schema': {
|
|
158
|
-
const params = GetTableSchemaSchema.parse(args);
|
|
159
|
-
const table = await client.getTable(params.tableSlug);
|
|
160
|
-
return {
|
|
161
|
-
content: [
|
|
162
|
-
{
|
|
163
|
-
type: 'text',
|
|
164
|
-
text: JSON.stringify({
|
|
165
|
-
table: {
|
|
166
|
-
name: table.name,
|
|
167
|
-
slug: table.slug,
|
|
168
|
-
createdAt: table.createdAt,
|
|
169
|
-
},
|
|
170
|
-
columns: table.columns.map((c) => ({
|
|
171
|
-
name: c.name,
|
|
172
|
-
slug: c.slug,
|
|
173
|
-
type: c.type,
|
|
174
|
-
isRequired: c.isRequired,
|
|
175
|
-
defaultValue: c.defaultValue,
|
|
176
|
-
})),
|
|
177
|
-
message: `Retrieved schema for table "${table.name}" with ${table.columns.length} columns`,
|
|
178
|
-
}, null, 2),
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
case 'create_table': {
|
|
184
|
-
const params = CreateTableSchema.parse(args);
|
|
185
|
-
const table = await client.createTable(params.name, params.slug);
|
|
186
|
-
return {
|
|
187
|
-
content: [
|
|
188
|
-
{
|
|
189
|
-
type: 'text',
|
|
190
|
-
text: JSON.stringify({
|
|
191
|
-
table,
|
|
192
|
-
message: `Successfully created table "${table.name}" (${table.slug})`,
|
|
193
|
-
}, null, 2),
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
case 'update_table': {
|
|
199
|
-
const params = UpdateTableSchema.parse(args);
|
|
200
|
-
const table = await client.updateTable(params.tableSlug, params.name);
|
|
201
|
-
return {
|
|
202
|
-
content: [
|
|
203
|
-
{
|
|
204
|
-
type: 'text',
|
|
205
|
-
text: JSON.stringify({
|
|
206
|
-
table,
|
|
207
|
-
message: `Successfully updated table "${table.slug}" to "${table.name}"`,
|
|
208
|
-
}, null, 2),
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
case 'add_column': {
|
|
214
|
-
const params = AddColumnSchema.parse(args);
|
|
215
|
-
const table = await client.addColumn(params.tableSlug, {
|
|
216
|
-
name: params.name,
|
|
217
|
-
slug: params.slug,
|
|
218
|
-
type: params.type,
|
|
219
|
-
isRequired: params.isRequired,
|
|
220
|
-
defaultValue: params.defaultValue,
|
|
221
|
-
});
|
|
222
|
-
return {
|
|
223
|
-
content: [
|
|
224
|
-
{
|
|
225
|
-
type: 'text',
|
|
226
|
-
text: JSON.stringify({
|
|
227
|
-
column: table.columns.find((c) => c.slug === params.slug),
|
|
228
|
-
message: `Successfully added column "${params.name}" to table "${params.tableSlug}"`,
|
|
229
|
-
}, null, 2),
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
case 'update_column': {
|
|
235
|
-
const params = UpdateColumnSchema.parse(args);
|
|
236
|
-
const table = await client.updateColumn(params.tableSlug, params.columnSlug, {
|
|
237
|
-
name: params.name,
|
|
238
|
-
isRequired: params.isRequired,
|
|
239
|
-
defaultValue: params.defaultValue,
|
|
240
|
-
});
|
|
241
|
-
return {
|
|
242
|
-
content: [
|
|
243
|
-
{
|
|
244
|
-
type: 'text',
|
|
245
|
-
text: JSON.stringify({
|
|
246
|
-
column: table.columns.find((c) => c.slug === params.columnSlug),
|
|
247
|
-
message: `Successfully updated column "${params.columnSlug}" in table "${params.tableSlug}"`,
|
|
248
|
-
}, null, 2),
|
|
249
|
-
},
|
|
250
|
-
],
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
default:
|
|
254
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
catch (error) {
|
|
258
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
259
|
-
return {
|
|
260
|
-
content: [
|
|
261
|
-
{
|
|
262
|
-
type: 'text',
|
|
263
|
-
text: JSON.stringify({
|
|
264
|
-
error: errorMessage,
|
|
265
|
-
tool: name,
|
|
266
|
-
}, null, 2),
|
|
267
|
-
},
|
|
268
|
-
],
|
|
269
|
-
isError: true,
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
//# sourceMappingURL=schema-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-tools.js","sourceRoot":"","sources":["../../src/tools/schema-tools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,MAAmB;IACrE,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,KAAK,GAAG;YACZ;gBACE,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,gCAAgC;gBAC7C,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,EAAE;iBACf;aACF;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EAAE,gEAAgE;gBAC7E,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,yBAAyB;yBACvC;qBACF;oBACD,QAAQ,EAAE,CAAC,WAAW,CAAC;iBACxB;aACF;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,mCAAmC;gBAChD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ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