@nodusapi/mcp-server 1.0.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/IMPLEMENTATION_SUMMARY.md +210 -0
- package/LICENSE +21 -0
- package/NPM_TOKEN_GUIDE.md +58 -0
- package/PUBLISH_GUIDE.md +152 -0
- package/QUICKSTART.md +139 -0
- package/README.md +394 -0
- package/cursor-config.example.json +13 -0
- package/dist/client/nodus-client.d.ts +30 -0
- package/dist/client/nodus-client.d.ts.map +1 -0
- package/dist/client/nodus-client.js +121 -0
- package/dist/client/nodus-client.js.map +1 -0
- package/dist/client/types.d.ts +81 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +75 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/schema-resources.d.ts +4 -0
- package/dist/resources/schema-resources.d.ts.map +1 -0
- package/dist/resources/schema-resources.js +113 -0
- package/dist/resources/schema-resources.js.map +1 -0
- package/dist/tools/data-tools.d.ts +4 -0
- package/dist/tools/data-tools.d.ts.map +1 -0
- package/dist/tools/data-tools.js +229 -0
- package/dist/tools/data-tools.js.map +1 -0
- package/dist/tools/project-tools.d.ts +4 -0
- package/dist/tools/project-tools.d.ts.map +1 -0
- package/dist/tools/project-tools.js +226 -0
- package/dist/tools/project-tools.js.map +1 -0
- package/dist/tools/schema-tools.d.ts +4 -0
- package/dist/tools/schema-tools.d.ts.map +1 -0
- package/dist/tools/schema-tools.js +274 -0
- package/dist/tools/schema-tools.js.map +1 -0
- package/dist/utils/auth.d.ts +5 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +27 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/validation.d.ts +168 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +68 -0
- package/dist/utils/validation.js.map +1 -0
- package/docs/project-goal-mcp.md +129 -0
- package/docs/research/mcp-links.md +2 -0
- package/package.json +51 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ListRowsSchema: z.ZodObject<{
|
|
3
|
+
tableSlug: z.ZodString;
|
|
4
|
+
page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
5
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
6
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
7
|
+
orderDir: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
8
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
tableSlug: string;
|
|
11
|
+
page?: number | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
orderBy?: string | undefined;
|
|
14
|
+
orderDir?: "ASC" | "DESC" | undefined;
|
|
15
|
+
filters?: Record<string, any> | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
tableSlug: string;
|
|
18
|
+
page?: number | undefined;
|
|
19
|
+
limit?: number | undefined;
|
|
20
|
+
orderBy?: string | undefined;
|
|
21
|
+
orderDir?: "ASC" | "DESC" | undefined;
|
|
22
|
+
filters?: Record<string, any> | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const GetRowSchema: z.ZodObject<{
|
|
25
|
+
tableSlug: z.ZodString;
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
id: string;
|
|
29
|
+
tableSlug: string;
|
|
30
|
+
}, {
|
|
31
|
+
id: string;
|
|
32
|
+
tableSlug: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const CreateRowSchema: z.ZodObject<{
|
|
35
|
+
tableSlug: z.ZodString;
|
|
36
|
+
data: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
data: Record<string, any>;
|
|
39
|
+
tableSlug: string;
|
|
40
|
+
}, {
|
|
41
|
+
data: Record<string, any>;
|
|
42
|
+
tableSlug: string;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const UpdateRowSchema: z.ZodObject<{
|
|
45
|
+
tableSlug: z.ZodString;
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
data: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
id: string;
|
|
50
|
+
data: Record<string, any>;
|
|
51
|
+
tableSlug: string;
|
|
52
|
+
}, {
|
|
53
|
+
id: string;
|
|
54
|
+
data: Record<string, any>;
|
|
55
|
+
tableSlug: string;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const DeleteRowSchema: z.ZodObject<{
|
|
58
|
+
tableSlug: z.ZodString;
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
id: string;
|
|
62
|
+
tableSlug: string;
|
|
63
|
+
}, {
|
|
64
|
+
id: string;
|
|
65
|
+
tableSlug: string;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const ListTablesSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
68
|
+
export declare const GetTableSchemaSchema: z.ZodObject<{
|
|
69
|
+
tableSlug: z.ZodString;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
tableSlug: string;
|
|
72
|
+
}, {
|
|
73
|
+
tableSlug: string;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const CreateTableSchema: z.ZodObject<{
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
slug: z.ZodString;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
slug: string;
|
|
80
|
+
name: string;
|
|
81
|
+
}, {
|
|
82
|
+
slug: string;
|
|
83
|
+
name: string;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const UpdateTableSchema: z.ZodObject<{
|
|
86
|
+
tableSlug: z.ZodString;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
name: string;
|
|
90
|
+
tableSlug: string;
|
|
91
|
+
}, {
|
|
92
|
+
name: string;
|
|
93
|
+
tableSlug: string;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const AddColumnSchema: z.ZodObject<{
|
|
96
|
+
tableSlug: z.ZodString;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
slug: z.ZodString;
|
|
99
|
+
type: z.ZodEnum<["string", "text", "integer", "float", "boolean", "datetime", "json"]>;
|
|
100
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
defaultValue: z.ZodOptional<z.ZodAny>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
slug: string;
|
|
104
|
+
type: "string" | "boolean" | "text" | "integer" | "float" | "datetime" | "json";
|
|
105
|
+
name: string;
|
|
106
|
+
tableSlug: string;
|
|
107
|
+
isRequired?: boolean | undefined;
|
|
108
|
+
defaultValue?: any;
|
|
109
|
+
}, {
|
|
110
|
+
slug: string;
|
|
111
|
+
type: "string" | "boolean" | "text" | "integer" | "float" | "datetime" | "json";
|
|
112
|
+
name: string;
|
|
113
|
+
tableSlug: string;
|
|
114
|
+
isRequired?: boolean | undefined;
|
|
115
|
+
defaultValue?: any;
|
|
116
|
+
}>;
|
|
117
|
+
export declare const UpdateColumnSchema: z.ZodObject<{
|
|
118
|
+
tableSlug: z.ZodString;
|
|
119
|
+
columnSlug: z.ZodString;
|
|
120
|
+
name: z.ZodOptional<z.ZodString>;
|
|
121
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
defaultValue: z.ZodOptional<z.ZodAny>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
tableSlug: string;
|
|
125
|
+
columnSlug: string;
|
|
126
|
+
name?: string | undefined;
|
|
127
|
+
isRequired?: boolean | undefined;
|
|
128
|
+
defaultValue?: any;
|
|
129
|
+
}, {
|
|
130
|
+
tableSlug: string;
|
|
131
|
+
columnSlug: string;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
isRequired?: boolean | undefined;
|
|
134
|
+
defaultValue?: any;
|
|
135
|
+
}>;
|
|
136
|
+
export declare const ListProjectsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
137
|
+
export declare const CreateProjectSchema: z.ZodObject<{
|
|
138
|
+
name: z.ZodString;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
name: string;
|
|
141
|
+
}, {
|
|
142
|
+
name: string;
|
|
143
|
+
}>;
|
|
144
|
+
export declare const SwitchProjectSchema: z.ZodObject<{
|
|
145
|
+
projectId: z.ZodString;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
projectId: string;
|
|
148
|
+
}, {
|
|
149
|
+
projectId: string;
|
|
150
|
+
}>;
|
|
151
|
+
export declare const ListApiKeysSchema: z.ZodObject<{
|
|
152
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
projectId?: string | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
projectId?: string | undefined;
|
|
157
|
+
}>;
|
|
158
|
+
export declare const CreateApiKeySchema: z.ZodObject<{
|
|
159
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
name: string;
|
|
163
|
+
projectId?: string | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
name: string;
|
|
166
|
+
projectId?: string | undefined;
|
|
167
|
+
}>;
|
|
168
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;EAGvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;EAI1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,gDAAe,CAAC;AAE7C,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAO1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAM7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,gDAAe,CAAC;AAE/C,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const ListRowsSchema = z.object({
|
|
3
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
4
|
+
page: z.number().int().positive().default(1).optional().describe('Page number for pagination'),
|
|
5
|
+
limit: z.number().int().positive().max(100).default(20).optional().describe('Number of rows per page'),
|
|
6
|
+
orderBy: z.string().optional().describe('Column to order by'),
|
|
7
|
+
orderDir: z.enum(['ASC', 'DESC']).optional().describe('Sort direction'),
|
|
8
|
+
filters: z.record(z.any()).optional().describe('Filters to apply (column: value pairs)'),
|
|
9
|
+
});
|
|
10
|
+
export const GetRowSchema = z.object({
|
|
11
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
12
|
+
id: z.string().uuid().describe('Row UUID'),
|
|
13
|
+
});
|
|
14
|
+
export const CreateRowSchema = z.object({
|
|
15
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
16
|
+
data: z.record(z.any()).describe('Row data matching table schema'),
|
|
17
|
+
});
|
|
18
|
+
export const UpdateRowSchema = z.object({
|
|
19
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
20
|
+
id: z.string().uuid().describe('Row UUID'),
|
|
21
|
+
data: z.record(z.any()).describe('Partial row data to update'),
|
|
22
|
+
});
|
|
23
|
+
export const DeleteRowSchema = z.object({
|
|
24
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
25
|
+
id: z.string().uuid().describe('Row UUID to delete'),
|
|
26
|
+
});
|
|
27
|
+
export const ListTablesSchema = z.object({});
|
|
28
|
+
export const GetTableSchemaSchema = z.object({
|
|
29
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
30
|
+
});
|
|
31
|
+
export const CreateTableSchema = z.object({
|
|
32
|
+
name: z.string().min(1).max(255).describe('Human-readable table name'),
|
|
33
|
+
slug: z.string().min(1).max(255).regex(/^[a-z0-9_]+$/).describe('Table slug (lowercase, numbers, underscores only)'),
|
|
34
|
+
});
|
|
35
|
+
export const UpdateTableSchema = z.object({
|
|
36
|
+
tableSlug: z.string().min(1).describe('Current table slug'),
|
|
37
|
+
name: z.string().min(1).max(255).describe('New table name'),
|
|
38
|
+
});
|
|
39
|
+
export const AddColumnSchema = z.object({
|
|
40
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
41
|
+
name: z.string().min(1).max(255).describe('Human-readable column name'),
|
|
42
|
+
slug: z.string().min(1).max(255).regex(/^[a-z0-9_]+$/).describe('Column slug (lowercase, numbers, underscores only)'),
|
|
43
|
+
type: z.enum(['string', 'text', 'integer', 'float', 'boolean', 'datetime', 'json']).describe('Column data type'),
|
|
44
|
+
isRequired: z.boolean().optional().describe('Whether the column is required'),
|
|
45
|
+
defaultValue: z.any().optional().describe('Default value for the column'),
|
|
46
|
+
});
|
|
47
|
+
export const UpdateColumnSchema = z.object({
|
|
48
|
+
tableSlug: z.string().min(1).describe('Table identifier (slug)'),
|
|
49
|
+
columnSlug: z.string().min(1).describe('Column identifier (slug)'),
|
|
50
|
+
name: z.string().min(1).max(255).optional().describe('New column name'),
|
|
51
|
+
isRequired: z.boolean().optional().describe('Whether the column is required'),
|
|
52
|
+
defaultValue: z.any().optional().describe('Default value for the column'),
|
|
53
|
+
});
|
|
54
|
+
export const ListProjectsSchema = z.object({});
|
|
55
|
+
export const CreateProjectSchema = z.object({
|
|
56
|
+
name: z.string().min(1).max(255).describe('Project name'),
|
|
57
|
+
});
|
|
58
|
+
export const SwitchProjectSchema = z.object({
|
|
59
|
+
projectId: z.string().uuid().describe('Project UUID to switch to'),
|
|
60
|
+
});
|
|
61
|
+
export const ListApiKeysSchema = z.object({
|
|
62
|
+
projectId: z.string().uuid().optional().describe('Project UUID (optional, uses current project if not provided)'),
|
|
63
|
+
});
|
|
64
|
+
export const CreateApiKeySchema = z.object({
|
|
65
|
+
projectId: z.string().uuid().optional().describe('Project UUID (optional, uses current project if not provided)'),
|
|
66
|
+
name: z.string().min(1).max(255).describe('API key name'),
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAA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AE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;CAClH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;IACjH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;CAC1D,CAAC,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Nodus MCP Server - Project Documentation
|
|
2
|
+
|
|
3
|
+
## Project Goal
|
|
4
|
+
|
|
5
|
+
This MCP server allows AI assistants (like Claude in Cursor) to interact directly with NodusAPI endpoints, enabling natural language database operations.
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
User (Cursor/Claude)
|
|
11
|
+
↓
|
|
12
|
+
MCP Protocol (stdio)
|
|
13
|
+
↓
|
|
14
|
+
Nodus MCP Server
|
|
15
|
+
↓
|
|
16
|
+
NodusAPI Client (HTTP)
|
|
17
|
+
↓
|
|
18
|
+
NodusAPI Backend
|
|
19
|
+
↓
|
|
20
|
+
PostgreSQL Database
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Key Design Decisions
|
|
24
|
+
|
|
25
|
+
### 1. Security First
|
|
26
|
+
- No delete operations for tables/projects (only rows)
|
|
27
|
+
- API key validation and masking
|
|
28
|
+
- Comprehensive error handling
|
|
29
|
+
- Input validation with Zod
|
|
30
|
+
|
|
31
|
+
### 2. Hybrid Configuration
|
|
32
|
+
- Environment variables (Cursor integration)
|
|
33
|
+
- Interactive prompt (first-time setup)
|
|
34
|
+
- Persistent config file (~/.nodus-mcp/config.json)
|
|
35
|
+
|
|
36
|
+
### 3. Tool Categories
|
|
37
|
+
- **Data Tools**: CRUD operations on table rows
|
|
38
|
+
- **Schema Tools**: Table and column management
|
|
39
|
+
- **Project Tools**: Project and API key management
|
|
40
|
+
- **Resources**: Automatic schema context for LLM
|
|
41
|
+
|
|
42
|
+
### 4. Error Handling
|
|
43
|
+
- User-friendly error messages
|
|
44
|
+
- Graceful API error handling
|
|
45
|
+
- Network retry logic in client
|
|
46
|
+
- Validation errors with context
|
|
47
|
+
|
|
48
|
+
## File Structure
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
src/
|
|
52
|
+
├── index.ts # Main entry point, MCP server setup
|
|
53
|
+
├── config.ts # Configuration management
|
|
54
|
+
├── client/
|
|
55
|
+
│ ├── nodus-client.ts # HTTP client wrapper for NodusAPI
|
|
56
|
+
│ └── types.ts # TypeScript interfaces
|
|
57
|
+
├── tools/
|
|
58
|
+
│ ├── data-tools.ts # Data CRUD MCP tools
|
|
59
|
+
│ ├── schema-tools.ts # Schema management MCP tools
|
|
60
|
+
│ └── project-tools.ts # Project management MCP tools
|
|
61
|
+
├── resources/
|
|
62
|
+
│ └── schema-resources.ts # MCP resources for table schemas
|
|
63
|
+
└── utils/
|
|
64
|
+
├── auth.ts # Authentication helpers
|
|
65
|
+
└── validation.ts # Zod validation schemas
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Development Notes
|
|
69
|
+
|
|
70
|
+
### MCP Protocol
|
|
71
|
+
- Uses stdio transport for local communication
|
|
72
|
+
- Tools are discovered via ListToolsRequestSchema
|
|
73
|
+
- Tools are invoked via CallToolRequestSchema
|
|
74
|
+
- Resources provide contextual information to LLM
|
|
75
|
+
|
|
76
|
+
### API Client
|
|
77
|
+
- Axios-based HTTP client
|
|
78
|
+
- Automatic error handling and formatting
|
|
79
|
+
- Support for all NodusAPI endpoints
|
|
80
|
+
- Query parameter building for filters/pagination
|
|
81
|
+
|
|
82
|
+
### Validation
|
|
83
|
+
- Zod schemas for all tool inputs
|
|
84
|
+
- Type safety throughout the codebase
|
|
85
|
+
- Runtime validation before API calls
|
|
86
|
+
|
|
87
|
+
## Testing
|
|
88
|
+
|
|
89
|
+
To test locally:
|
|
90
|
+
|
|
91
|
+
1. Build: `npm run build`
|
|
92
|
+
2. Set environment variables:
|
|
93
|
+
```bash
|
|
94
|
+
export NODUS_API_KEY="nds_your_key"
|
|
95
|
+
export NODUS_PROJECT_ID="your_project_id"
|
|
96
|
+
```
|
|
97
|
+
3. Run: `npm start`
|
|
98
|
+
4. Configure Cursor to use local server
|
|
99
|
+
5. Test with natural language commands
|
|
100
|
+
|
|
101
|
+
## Future Enhancements
|
|
102
|
+
|
|
103
|
+
Potential improvements:
|
|
104
|
+
- [ ] Caching for table schemas
|
|
105
|
+
- [ ] Batch operations support
|
|
106
|
+
- [ ] Webhook/event subscriptions
|
|
107
|
+
- [ ] Advanced filtering DSL
|
|
108
|
+
- [ ] Transaction support
|
|
109
|
+
- [ ] Custom function execution
|
|
110
|
+
- [ ] File upload/download support
|
|
111
|
+
- [ ] Real-time data subscriptions
|
|
112
|
+
|
|
113
|
+
## Publishing Checklist
|
|
114
|
+
|
|
115
|
+
Before publishing to npm:
|
|
116
|
+
1. ✅ Update version in package.json
|
|
117
|
+
2. ✅ Ensure all tests pass
|
|
118
|
+
3. ✅ Build successfully
|
|
119
|
+
4. ✅ README is complete
|
|
120
|
+
5. ✅ License file added
|
|
121
|
+
6. ⬜ GitHub repository created
|
|
122
|
+
7. ⬜ npm package published
|
|
123
|
+
8. ⬜ MCP Registry submission
|
|
124
|
+
|
|
125
|
+
## Related Documentation
|
|
126
|
+
|
|
127
|
+
- [NodusAPI Documentation](../nodusapi/docs/)
|
|
128
|
+
- [MCP Specification](https://modelcontextprotocol.io)
|
|
129
|
+
- [TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodusapi/mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for NodusAPI - Enable LLMs to interact with your BaaS backend",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nodus-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsx watch src/index.ts",
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"start": "node dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"nodus",
|
|
20
|
+
"nodusapi",
|
|
21
|
+
"baas",
|
|
22
|
+
"llm",
|
|
23
|
+
"ai",
|
|
24
|
+
"cursor",
|
|
25
|
+
"claude"
|
|
26
|
+
],
|
|
27
|
+
"author": "Alperen Cenky <alprncnky@gmail.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/nodusapi/nodusmcp.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/nodusapi/nodusmcp/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/nodusapi/nodusmcp#readme",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
39
|
+
"axios": "^1.6.0",
|
|
40
|
+
"zod": "^3.25.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"tsx": "^4.0.0",
|
|
45
|
+
"typescript": "^5.0.0"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
},
|
|
50
|
+
"mcpName": "io.github.nodusapi/nodus-mcp-server"
|
|
51
|
+
}
|