regen-koi-mcp 1.0.6 → 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/README.md +311 -18
- package/dist/cache.d.ts +70 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +230 -0
- package/dist/cache.js.map +1 -0
- package/dist/graph_tool.d.ts +12 -4
- package/dist/graph_tool.d.ts.map +1 -1
- package/dist/graph_tool.js +335 -26
- package/dist/graph_tool.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -20
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +68 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +133 -0
- package/dist/logger.js.map +1 -0
- package/dist/metrics.d.ts +111 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +279 -0
- package/dist/metrics.js.map +1 -0
- package/dist/resilience.d.ts +128 -0
- package/dist/resilience.d.ts.map +1 -0
- package/dist/resilience.js +317 -0
- package/dist/resilience.js.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +30 -1
- package/dist/tools.js.map +1 -1
- package/dist/validation.d.ts +223 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +287 -0
- package/dist/validation.js.map +1 -0
- package/package.json +8 -2
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Module - Input Validation with Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Provides input validation for all MCP tool parameters to prevent
|
|
5
|
+
* injection attacks and ensure data integrity.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { logger } from './logger.js';
|
|
9
|
+
/**
|
|
10
|
+
* Safe string - prevents SQL/Cypher injection
|
|
11
|
+
* Allows alphanumeric, underscore, hyphen, dot, and spaces
|
|
12
|
+
*/
|
|
13
|
+
const SafeString = z.string()
|
|
14
|
+
.min(1, 'Value cannot be empty')
|
|
15
|
+
.max(200, 'Value too long (max 200 characters)')
|
|
16
|
+
.regex(/^[a-zA-Z0-9_\-. ]+$/, 'Invalid characters. Only letters, numbers, underscores, hyphens, dots, and spaces allowed.');
|
|
17
|
+
/**
|
|
18
|
+
* Safe identifier - for entity names, type names, etc.
|
|
19
|
+
* More restrictive than SafeString
|
|
20
|
+
*/
|
|
21
|
+
const SafeIdentifier = z.string()
|
|
22
|
+
.min(1, 'Identifier cannot be empty')
|
|
23
|
+
.max(100, 'Identifier too long (max 100 characters)')
|
|
24
|
+
.regex(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Invalid identifier. Must start with a letter and contain only letters, numbers, and underscores.');
|
|
25
|
+
/**
|
|
26
|
+
* Safe path - for file paths
|
|
27
|
+
* Prevents path traversal attacks
|
|
28
|
+
*/
|
|
29
|
+
const SafePath = z.string()
|
|
30
|
+
.min(1, 'Path cannot be empty')
|
|
31
|
+
.max(500, 'Path too long (max 500 characters)')
|
|
32
|
+
.refine((val) => !val.includes('..') && !val.includes('\0'), 'Invalid path. Path traversal not allowed.');
|
|
33
|
+
/**
|
|
34
|
+
* Query type enum
|
|
35
|
+
*/
|
|
36
|
+
const QueryTypeEnum = z.enum([
|
|
37
|
+
'keeper_for_msg',
|
|
38
|
+
'msgs_for_keeper',
|
|
39
|
+
'docs_mentioning',
|
|
40
|
+
'entities_in_doc',
|
|
41
|
+
'related_entities',
|
|
42
|
+
'find_by_type',
|
|
43
|
+
'search_entities',
|
|
44
|
+
'list_repos',
|
|
45
|
+
'list_entity_types',
|
|
46
|
+
'get_entity_stats',
|
|
47
|
+
'list_modules',
|
|
48
|
+
'get_module',
|
|
49
|
+
'search_modules',
|
|
50
|
+
'module_entities',
|
|
51
|
+
'module_for_entity'
|
|
52
|
+
]);
|
|
53
|
+
/**
|
|
54
|
+
* Repository enum
|
|
55
|
+
*/
|
|
56
|
+
const RepositoryEnum = z.enum([
|
|
57
|
+
'regen-ledger',
|
|
58
|
+
'regen-web',
|
|
59
|
+
'regen-data-standards',
|
|
60
|
+
'regenie-corpus',
|
|
61
|
+
'koi-sensors'
|
|
62
|
+
]);
|
|
63
|
+
/**
|
|
64
|
+
* Schema for query_code_graph tool
|
|
65
|
+
*/
|
|
66
|
+
export const QueryCodeGraphSchema = z.object({
|
|
67
|
+
query_type: QueryTypeEnum,
|
|
68
|
+
entity_name: SafeString.optional(),
|
|
69
|
+
entity_type: SafeIdentifier.optional(),
|
|
70
|
+
doc_path: SafePath.optional(),
|
|
71
|
+
repo_name: z.string().max(100).optional(),
|
|
72
|
+
module_name: SafeString.optional()
|
|
73
|
+
}).refine((data) => {
|
|
74
|
+
// Validate required fields based on query type
|
|
75
|
+
const requiresEntityName = [
|
|
76
|
+
'keeper_for_msg',
|
|
77
|
+
'msgs_for_keeper',
|
|
78
|
+
'docs_mentioning',
|
|
79
|
+
'related_entities',
|
|
80
|
+
'search_entities',
|
|
81
|
+
'search_modules',
|
|
82
|
+
'module_for_entity'
|
|
83
|
+
];
|
|
84
|
+
const requiresDocPath = ['entities_in_doc'];
|
|
85
|
+
const requiresEntityType = ['find_by_type'];
|
|
86
|
+
const requiresModuleName = ['get_module', 'module_entities'];
|
|
87
|
+
if (requiresEntityName.includes(data.query_type) && !data.entity_name) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (requiresDocPath.includes(data.query_type) && !data.doc_path) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (requiresEntityType.includes(data.query_type) && !data.entity_type) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (requiresModuleName.includes(data.query_type) && !data.module_name) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}, {
|
|
101
|
+
message: 'Required parameter missing for this query type'
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* Schema for search_knowledge tool
|
|
105
|
+
*/
|
|
106
|
+
export const SearchKnowledgeSchema = z.object({
|
|
107
|
+
query: z.string()
|
|
108
|
+
.min(1, 'Query cannot be empty')
|
|
109
|
+
.max(500, 'Query too long (max 500 characters)'),
|
|
110
|
+
limit: z.number()
|
|
111
|
+
.int()
|
|
112
|
+
.min(1, 'Limit must be at least 1')
|
|
113
|
+
.max(20, 'Limit cannot exceed 20')
|
|
114
|
+
.optional()
|
|
115
|
+
.default(5),
|
|
116
|
+
published_from: z.string()
|
|
117
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')
|
|
118
|
+
.optional(),
|
|
119
|
+
published_to: z.string()
|
|
120
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')
|
|
121
|
+
.optional(),
|
|
122
|
+
include_undated: z.boolean().optional().default(false)
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Schema for hybrid_search tool
|
|
126
|
+
*/
|
|
127
|
+
export const HybridSearchSchema = z.object({
|
|
128
|
+
query: z.string()
|
|
129
|
+
.min(1, 'Query cannot be empty')
|
|
130
|
+
.max(500, 'Query too long (max 500 characters)'),
|
|
131
|
+
limit: z.number()
|
|
132
|
+
.int()
|
|
133
|
+
.min(1, 'Limit must be at least 1')
|
|
134
|
+
.max(50, 'Limit cannot exceed 50')
|
|
135
|
+
.optional()
|
|
136
|
+
.default(10)
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Schema for search_github_docs tool
|
|
140
|
+
*/
|
|
141
|
+
export const SearchGithubDocsSchema = z.object({
|
|
142
|
+
query: z.string()
|
|
143
|
+
.min(1, 'Query cannot be empty')
|
|
144
|
+
.max(300, 'Query too long (max 300 characters)'),
|
|
145
|
+
repository: RepositoryEnum.optional(),
|
|
146
|
+
limit: z.number()
|
|
147
|
+
.int()
|
|
148
|
+
.min(1, 'Limit must be at least 1')
|
|
149
|
+
.max(20, 'Limit cannot exceed 20')
|
|
150
|
+
.optional()
|
|
151
|
+
.default(10)
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Schema for get_repo_overview tool
|
|
155
|
+
*/
|
|
156
|
+
export const GetRepoOverviewSchema = z.object({
|
|
157
|
+
repository: RepositoryEnum
|
|
158
|
+
});
|
|
159
|
+
/**
|
|
160
|
+
* Schema for get_tech_stack tool
|
|
161
|
+
*/
|
|
162
|
+
export const GetTechStackSchema = z.object({
|
|
163
|
+
repository: RepositoryEnum.optional()
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Schema for get_stats tool
|
|
167
|
+
*/
|
|
168
|
+
export const GetStatsSchema = z.object({
|
|
169
|
+
detailed: z.boolean().optional().default(false)
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* Schema for generate_weekly_digest tool
|
|
173
|
+
*/
|
|
174
|
+
export const GenerateWeeklyDigestSchema = z.object({
|
|
175
|
+
start_date: z.string()
|
|
176
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')
|
|
177
|
+
.optional(),
|
|
178
|
+
end_date: z.string()
|
|
179
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')
|
|
180
|
+
.optional(),
|
|
181
|
+
save_to_file: z.boolean().optional().default(false),
|
|
182
|
+
output_path: SafePath.optional(),
|
|
183
|
+
format: z.enum(['markdown', 'json']).optional().default('markdown')
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* Validate input against a schema
|
|
187
|
+
*/
|
|
188
|
+
export function validateInput(schema, input, toolName) {
|
|
189
|
+
try {
|
|
190
|
+
const data = schema.parse(input);
|
|
191
|
+
return { success: true, data };
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
if (error instanceof z.ZodError) {
|
|
195
|
+
const zodError = error;
|
|
196
|
+
const errorMessage = zodError.issues
|
|
197
|
+
.map((e) => `${e.path.join('.')}: ${e.message}`)
|
|
198
|
+
.join('; ');
|
|
199
|
+
logger.warn({
|
|
200
|
+
action: 'validation_failed',
|
|
201
|
+
tool: toolName,
|
|
202
|
+
errors: zodError.issues
|
|
203
|
+
}, `Validation failed for ${toolName}: ${errorMessage}`);
|
|
204
|
+
return {
|
|
205
|
+
success: false,
|
|
206
|
+
error: `Validation failed: ${errorMessage}`,
|
|
207
|
+
details: zodError.issues
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
logger.error({
|
|
211
|
+
action: 'validation_error',
|
|
212
|
+
tool: toolName,
|
|
213
|
+
error: error instanceof Error ? error.message : String(error)
|
|
214
|
+
}, `Unexpected validation error for ${toolName}`);
|
|
215
|
+
return {
|
|
216
|
+
success: false,
|
|
217
|
+
error: 'Unexpected validation error'
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Map of tool names to their schemas
|
|
223
|
+
*/
|
|
224
|
+
export const ToolSchemas = {
|
|
225
|
+
query_code_graph: QueryCodeGraphSchema,
|
|
226
|
+
search_knowledge: SearchKnowledgeSchema,
|
|
227
|
+
hybrid_search: HybridSearchSchema,
|
|
228
|
+
search_github_docs: SearchGithubDocsSchema,
|
|
229
|
+
get_repo_overview: GetRepoOverviewSchema,
|
|
230
|
+
get_tech_stack: GetTechStackSchema,
|
|
231
|
+
get_stats: GetStatsSchema,
|
|
232
|
+
generate_weekly_digest: GenerateWeeklyDigestSchema
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Validate tool input by tool name
|
|
236
|
+
*/
|
|
237
|
+
export function validateToolInput(toolName, input) {
|
|
238
|
+
const schema = ToolSchemas[toolName];
|
|
239
|
+
if (!schema) {
|
|
240
|
+
logger.debug({
|
|
241
|
+
action: 'no_validation_schema',
|
|
242
|
+
tool: toolName
|
|
243
|
+
}, `No validation schema defined for ${toolName}, passing through`);
|
|
244
|
+
return { success: true, data: input };
|
|
245
|
+
}
|
|
246
|
+
return validateInput(schema, input, toolName);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Sanitize a string for safe use in queries
|
|
250
|
+
* Removes potentially dangerous characters
|
|
251
|
+
*/
|
|
252
|
+
export function sanitizeString(input) {
|
|
253
|
+
return input
|
|
254
|
+
.replace(/[;'"\\]/g, '') // Remove SQL/Cypher injection characters
|
|
255
|
+
.replace(/\\/g, '') // Remove backslashes
|
|
256
|
+
.replace(/\x00/g, '') // Remove null bytes
|
|
257
|
+
.trim();
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Check if a string looks like an injection attempt
|
|
261
|
+
*/
|
|
262
|
+
export function detectInjection(input) {
|
|
263
|
+
const patterns = [
|
|
264
|
+
/(\bor\b|\band\b)\s*\d*\s*=\s*\d*/i, // SQL OR 1=1
|
|
265
|
+
/--/, // SQL comment
|
|
266
|
+
/\/\*/, // Block comment
|
|
267
|
+
/;\s*(drop|delete|update|insert)/i, // SQL commands
|
|
268
|
+
/\$\$/, // Cypher parameter injection
|
|
269
|
+
/\}\s*\)/, // Cypher escape
|
|
270
|
+
];
|
|
271
|
+
return patterns.some(pattern => pattern.test(input));
|
|
272
|
+
}
|
|
273
|
+
export default {
|
|
274
|
+
validateInput,
|
|
275
|
+
validateToolInput,
|
|
276
|
+
sanitizeString,
|
|
277
|
+
detectInjection,
|
|
278
|
+
QueryCodeGraphSchema,
|
|
279
|
+
SearchKnowledgeSchema,
|
|
280
|
+
HybridSearchSchema,
|
|
281
|
+
SearchGithubDocsSchema,
|
|
282
|
+
GetRepoOverviewSchema,
|
|
283
|
+
GetTechStackSchema,
|
|
284
|
+
GetStatsSchema,
|
|
285
|
+
GenerateWeeklyDigestSchema
|
|
286
|
+
};
|
|
287
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,M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C,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,QAAQ,GAAG;QACf,mCAAmC,EAAG,aAAa;QACnD,IAAI,EAAoC,cAAc;QACtD,MAAM,EAAkC,gBAAgB;QACxD,kCAAkC,EAAK,eAAe;QACtD,MAAM,EAAkC,6BAA6B;QACrE,SAAS,EAA+B,gBAAgB;KACzD,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,eAAe;IACb,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,oBAAoB;IACpB,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,kBAAkB;IAClB,cAAc;IACd,0BAA0B;CAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "regen-koi-mcp",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "MCP server for accessing Regen Network's KOI (Knowledge Organization Infrastructure) system",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"dev": "tsx src/index.ts",
|
|
20
20
|
"clean": "rm -rf dist",
|
|
21
21
|
"setup": "node scripts/setup.js",
|
|
22
|
+
"login": "tsx src/scripts/login.ts",
|
|
22
23
|
"install-all": "./setup.sh",
|
|
23
24
|
"prepublishOnly": "npm run clean && npm run build"
|
|
24
25
|
},
|
|
@@ -50,8 +51,13 @@
|
|
|
50
51
|
"@types/pg": "^8.15.6",
|
|
51
52
|
"axios": "^1.7.7",
|
|
52
53
|
"dotenv": "^16.4.5",
|
|
54
|
+
"lru-cache": "^11.2.2",
|
|
55
|
+
"open": "^11.0.0",
|
|
53
56
|
"pg": "^8.16.3",
|
|
54
|
-
"
|
|
57
|
+
"pino": "^10.1.0",
|
|
58
|
+
"pino-pretty": "^13.1.2",
|
|
59
|
+
"regen-koi-mcp": "^1.0.0",
|
|
60
|
+
"zod": "^4.1.13"
|
|
55
61
|
},
|
|
56
62
|
"devDependencies": {
|
|
57
63
|
"@types/node": "^20.16.11",
|