fms-odata-mcp 0.1.2

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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +154 -0
  3. package/dist/config.d.ts +104 -0
  4. package/dist/config.d.ts.map +1 -0
  5. package/dist/config.js +248 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/connection.d.ts +49 -0
  8. package/dist/connection.d.ts.map +1 -0
  9. package/dist/connection.js +126 -0
  10. package/dist/connection.js.map +1 -0
  11. package/dist/index.d.ts +7 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +90 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/logger.d.ts +15 -0
  16. package/dist/logger.d.ts.map +1 -0
  17. package/dist/logger.js +57 -0
  18. package/dist/logger.js.map +1 -0
  19. package/dist/odata-client.d.ts +102 -0
  20. package/dist/odata-client.d.ts.map +1 -0
  21. package/dist/odata-client.js +226 -0
  22. package/dist/odata-client.js.map +1 -0
  23. package/dist/odata-parser.d.ts +64 -0
  24. package/dist/odata-parser.d.ts.map +1 -0
  25. package/dist/odata-parser.js +126 -0
  26. package/dist/odata-parser.js.map +1 -0
  27. package/dist/tools/configuration.d.ts +69 -0
  28. package/dist/tools/configuration.d.ts.map +1 -0
  29. package/dist/tools/configuration.js +221 -0
  30. package/dist/tools/configuration.js.map +1 -0
  31. package/dist/tools/connection.d.ts +66 -0
  32. package/dist/tools/connection.d.ts.map +1 -0
  33. package/dist/tools/connection.js +230 -0
  34. package/dist/tools/connection.js.map +1 -0
  35. package/dist/tools/index.d.ts +319 -0
  36. package/dist/tools/index.d.ts.map +1 -0
  37. package/dist/tools/index.js +48 -0
  38. package/dist/tools/index.js.map +1 -0
  39. package/dist/tools/odata.d.ts +233 -0
  40. package/dist/tools/odata.d.ts.map +1 -0
  41. package/dist/tools/odata.js +404 -0
  42. package/dist/tools/odata.js.map +1 -0
  43. package/dist/transport.d.ts +18 -0
  44. package/dist/transport.d.ts.map +1 -0
  45. package/dist/transport.js +138 -0
  46. package/dist/transport.js.map +1 -0
  47. package/package.json +72 -0
@@ -0,0 +1,233 @@
1
+ /**
2
+ * OData Tool Definitions
3
+ */
4
+ export declare const odataTools: ({
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: string;
9
+ properties: {
10
+ table?: undefined;
11
+ filter?: undefined;
12
+ select?: undefined;
13
+ orderby?: undefined;
14
+ top?: undefined;
15
+ skip?: undefined;
16
+ expand?: undefined;
17
+ count?: undefined;
18
+ recordId?: undefined;
19
+ data?: undefined;
20
+ };
21
+ required: never[];
22
+ };
23
+ } | {
24
+ name: string;
25
+ description: string;
26
+ inputSchema: {
27
+ type: string;
28
+ properties: {
29
+ table: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ filter: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ select: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ orderby: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ top: {
46
+ type: string;
47
+ description: string;
48
+ };
49
+ skip: {
50
+ type: string;
51
+ description: string;
52
+ };
53
+ expand: {
54
+ type: string;
55
+ description: string;
56
+ };
57
+ count: {
58
+ type: string;
59
+ description: string;
60
+ };
61
+ recordId?: undefined;
62
+ data?: undefined;
63
+ };
64
+ required: string[];
65
+ };
66
+ } | {
67
+ name: string;
68
+ description: string;
69
+ inputSchema: {
70
+ type: string;
71
+ properties: {
72
+ table: {
73
+ type: string;
74
+ description: string;
75
+ };
76
+ recordId: {
77
+ type: string;
78
+ description: string;
79
+ };
80
+ select: {
81
+ type: string;
82
+ description: string;
83
+ };
84
+ expand: {
85
+ type: string;
86
+ description: string;
87
+ };
88
+ filter?: undefined;
89
+ orderby?: undefined;
90
+ top?: undefined;
91
+ skip?: undefined;
92
+ count?: undefined;
93
+ data?: undefined;
94
+ };
95
+ required: string[];
96
+ };
97
+ } | {
98
+ name: string;
99
+ description: string;
100
+ inputSchema: {
101
+ type: string;
102
+ properties: {
103
+ table: {
104
+ type: string;
105
+ description: string;
106
+ };
107
+ top: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ skip: {
112
+ type: string;
113
+ description: string;
114
+ };
115
+ filter?: undefined;
116
+ select?: undefined;
117
+ orderby?: undefined;
118
+ expand?: undefined;
119
+ count?: undefined;
120
+ recordId?: undefined;
121
+ data?: undefined;
122
+ };
123
+ required: string[];
124
+ };
125
+ } | {
126
+ name: string;
127
+ description: string;
128
+ inputSchema: {
129
+ type: string;
130
+ properties: {
131
+ table: {
132
+ type: string;
133
+ description: string;
134
+ };
135
+ filter: {
136
+ type: string;
137
+ description: string;
138
+ };
139
+ select?: undefined;
140
+ orderby?: undefined;
141
+ top?: undefined;
142
+ skip?: undefined;
143
+ expand?: undefined;
144
+ count?: undefined;
145
+ recordId?: undefined;
146
+ data?: undefined;
147
+ };
148
+ required: string[];
149
+ };
150
+ } | {
151
+ name: string;
152
+ description: string;
153
+ inputSchema: {
154
+ type: string;
155
+ properties: {
156
+ table: {
157
+ type: string;
158
+ description: string;
159
+ };
160
+ data: {
161
+ type: string;
162
+ description: string;
163
+ };
164
+ filter?: undefined;
165
+ select?: undefined;
166
+ orderby?: undefined;
167
+ top?: undefined;
168
+ skip?: undefined;
169
+ expand?: undefined;
170
+ count?: undefined;
171
+ recordId?: undefined;
172
+ };
173
+ required: string[];
174
+ };
175
+ } | {
176
+ name: string;
177
+ description: string;
178
+ inputSchema: {
179
+ type: string;
180
+ properties: {
181
+ table: {
182
+ type: string;
183
+ description: string;
184
+ };
185
+ recordId: {
186
+ type: string;
187
+ description: string;
188
+ };
189
+ data: {
190
+ type: string;
191
+ description: string;
192
+ };
193
+ filter?: undefined;
194
+ select?: undefined;
195
+ orderby?: undefined;
196
+ top?: undefined;
197
+ skip?: undefined;
198
+ expand?: undefined;
199
+ count?: undefined;
200
+ };
201
+ required: string[];
202
+ };
203
+ } | {
204
+ name: string;
205
+ description: string;
206
+ inputSchema: {
207
+ type: string;
208
+ properties: {
209
+ table: {
210
+ type: string;
211
+ description: string;
212
+ };
213
+ recordId: {
214
+ type: string;
215
+ description: string;
216
+ };
217
+ filter?: undefined;
218
+ select?: undefined;
219
+ orderby?: undefined;
220
+ top?: undefined;
221
+ skip?: undefined;
222
+ expand?: undefined;
223
+ count?: undefined;
224
+ data?: undefined;
225
+ };
226
+ required: string[];
227
+ };
228
+ })[];
229
+ /**
230
+ * OData Tool Handlers
231
+ */
232
+ export declare function handleODataTool(name: string, args: any): Promise<any>;
233
+ //# sourceMappingURL=odata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odata.d.ts","sourceRoot":"","sources":["../../src/tools/odata.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuMtB,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CA0E3E"}
@@ -0,0 +1,404 @@
1
+ import { connectionManager } from "../connection.js";
2
+ import { ODataParser } from "../odata-parser.js";
3
+ import { logger } from "../logger.js";
4
+ /**
5
+ * OData Tool Definitions
6
+ */
7
+ export const odataTools = [
8
+ // Metadata Tools
9
+ {
10
+ name: "fm_odata_get_service_document",
11
+ description: "Get the OData service document listing all available tables/entity sets in the database",
12
+ inputSchema: {
13
+ type: "object",
14
+ properties: {},
15
+ required: [],
16
+ },
17
+ },
18
+ {
19
+ name: "fm_odata_get_metadata",
20
+ description: "Get the OData metadata document (EDMX/XML) describing the database schema, tables, and fields",
21
+ inputSchema: {
22
+ type: "object",
23
+ properties: {},
24
+ required: [],
25
+ },
26
+ },
27
+ {
28
+ name: "fm_odata_list_tables",
29
+ description: "List all tables/entity sets available in the database (parsed from metadata)",
30
+ inputSchema: {
31
+ type: "object",
32
+ properties: {},
33
+ required: [],
34
+ },
35
+ },
36
+ // Query Tools
37
+ {
38
+ name: "fm_odata_query_records",
39
+ description: "Query records from a table with OData filter expressions and query options",
40
+ inputSchema: {
41
+ type: "object",
42
+ properties: {
43
+ table: {
44
+ type: "string",
45
+ description: "Table/entity set name (e.g., 'contact', 'address')",
46
+ },
47
+ filter: {
48
+ type: "string",
49
+ description: "OData $filter expression (e.g., \"FirstName eq 'John'\" or \"Age gt 25\")",
50
+ },
51
+ select: {
52
+ type: "string",
53
+ description: "Comma-separated list of fields to return (e.g., 'FirstName,LastName,Email')",
54
+ },
55
+ orderby: {
56
+ type: "string",
57
+ description: "OData $orderby expression (e.g., 'LastName asc' or 'Age desc')",
58
+ },
59
+ top: {
60
+ type: "number",
61
+ description: "Maximum number of records to return (pagination)",
62
+ },
63
+ skip: {
64
+ type: "number",
65
+ description: "Number of records to skip (pagination)",
66
+ },
67
+ expand: {
68
+ type: "string",
69
+ description: "Related records to expand (navigation properties)",
70
+ },
71
+ count: {
72
+ type: "boolean",
73
+ description: "Include total count of matching records",
74
+ },
75
+ },
76
+ required: ["table"],
77
+ },
78
+ },
79
+ {
80
+ name: "fm_odata_get_record",
81
+ description: "Get a single record by its ID",
82
+ inputSchema: {
83
+ type: "object",
84
+ properties: {
85
+ table: {
86
+ type: "string",
87
+ description: "Table/entity set name",
88
+ },
89
+ recordId: {
90
+ type: "string",
91
+ description: "Record ID",
92
+ },
93
+ select: {
94
+ type: "string",
95
+ description: "Comma-separated list of fields to return",
96
+ },
97
+ expand: {
98
+ type: "string",
99
+ description: "Related records to expand",
100
+ },
101
+ },
102
+ required: ["table", "recordId"],
103
+ },
104
+ },
105
+ {
106
+ name: "fm_odata_get_records",
107
+ description: "Get records from a table (simple query without filters)",
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ table: {
112
+ type: "string",
113
+ description: "Table/entity set name",
114
+ },
115
+ top: {
116
+ type: "number",
117
+ description: "Maximum number of records to return",
118
+ },
119
+ skip: {
120
+ type: "number",
121
+ description: "Number of records to skip",
122
+ },
123
+ },
124
+ required: ["table"],
125
+ },
126
+ },
127
+ {
128
+ name: "fm_odata_count_records",
129
+ description: "Count records in a table, optionally with a filter",
130
+ inputSchema: {
131
+ type: "object",
132
+ properties: {
133
+ table: {
134
+ type: "string",
135
+ description: "Table/entity set name",
136
+ },
137
+ filter: {
138
+ type: "string",
139
+ description: "OData $filter expression",
140
+ },
141
+ },
142
+ required: ["table"],
143
+ },
144
+ },
145
+ // CRUD Tools
146
+ {
147
+ name: "fm_odata_create_record",
148
+ description: "Create a new record in a table",
149
+ inputSchema: {
150
+ type: "object",
151
+ properties: {
152
+ table: {
153
+ type: "string",
154
+ description: "Table/entity set name",
155
+ },
156
+ data: {
157
+ type: "object",
158
+ description: "Field values for the new record (JSON object with field names as keys)",
159
+ },
160
+ },
161
+ required: ["table", "data"],
162
+ },
163
+ },
164
+ {
165
+ name: "fm_odata_update_record",
166
+ description: "Update an existing record",
167
+ inputSchema: {
168
+ type: "object",
169
+ properties: {
170
+ table: {
171
+ type: "string",
172
+ description: "Table/entity set name",
173
+ },
174
+ recordId: {
175
+ type: "string",
176
+ description: "Record ID to update",
177
+ },
178
+ data: {
179
+ type: "object",
180
+ description: "Field values to update (JSON object with field names as keys)",
181
+ },
182
+ },
183
+ required: ["table", "recordId", "data"],
184
+ },
185
+ },
186
+ {
187
+ name: "fm_odata_delete_record",
188
+ description: "Delete a record",
189
+ inputSchema: {
190
+ type: "object",
191
+ properties: {
192
+ table: {
193
+ type: "string",
194
+ description: "Table/entity set name",
195
+ },
196
+ recordId: {
197
+ type: "string",
198
+ description: "Record ID to delete",
199
+ },
200
+ },
201
+ required: ["table", "recordId"],
202
+ },
203
+ },
204
+ ];
205
+ /**
206
+ * OData Tool Handlers
207
+ */
208
+ export async function handleODataTool(name, args) {
209
+ try {
210
+ const client = connectionManager.getCurrentClient();
211
+ if (!client) {
212
+ return {
213
+ content: [
214
+ {
215
+ type: "text",
216
+ text: "No active connection. Please set a connection first using fm_odata_set_connection or fm_odata_connect.",
217
+ },
218
+ ],
219
+ isError: true,
220
+ };
221
+ }
222
+ logger.debug(`Handling OData tool: ${name}`, args);
223
+ switch (name) {
224
+ // Metadata Tools
225
+ case "fm_odata_get_service_document":
226
+ return await handleGetServiceDocument(client);
227
+ case "fm_odata_get_metadata":
228
+ return await handleGetMetadata(client);
229
+ case "fm_odata_list_tables":
230
+ return await handleListTables(client);
231
+ // Query Tools
232
+ case "fm_odata_query_records":
233
+ return await handleQueryRecords(client, args);
234
+ case "fm_odata_get_record":
235
+ return await handleGetRecord(client, args);
236
+ case "fm_odata_get_records":
237
+ return await handleGetRecords(client, args);
238
+ case "fm_odata_count_records":
239
+ return await handleCountRecords(client, args);
240
+ // CRUD Tools
241
+ case "fm_odata_create_record":
242
+ return await handleCreateRecord(client, args);
243
+ case "fm_odata_update_record":
244
+ return await handleUpdateRecord(client, args);
245
+ case "fm_odata_delete_record":
246
+ return await handleDeleteRecord(client, args);
247
+ default:
248
+ return {
249
+ content: [
250
+ {
251
+ type: "text",
252
+ text: `Unknown OData tool: ${name}`,
253
+ },
254
+ ],
255
+ isError: true,
256
+ };
257
+ }
258
+ }
259
+ catch (error) {
260
+ logger.error(`Error in ${name}:`, error);
261
+ return {
262
+ content: [
263
+ {
264
+ type: "text",
265
+ text: ODataParser.formatError(error),
266
+ },
267
+ ],
268
+ isError: true,
269
+ };
270
+ }
271
+ }
272
+ // Metadata Tool Handlers
273
+ async function handleGetServiceDocument(client) {
274
+ const serviceDoc = await client.getServiceDocument();
275
+ return {
276
+ content: [
277
+ {
278
+ type: "text",
279
+ text: ODataParser.formatServiceDocument(serviceDoc),
280
+ },
281
+ ],
282
+ };
283
+ }
284
+ async function handleGetMetadata(client) {
285
+ const metadata = await client.getMetadata();
286
+ return {
287
+ content: [
288
+ {
289
+ type: "text",
290
+ text: metadata,
291
+ },
292
+ ],
293
+ };
294
+ }
295
+ async function handleListTables(client) {
296
+ const metadata = await client.getMetadata();
297
+ const tables = ODataParser.parseMetadataForTables(metadata);
298
+ return {
299
+ content: [
300
+ {
301
+ type: "text",
302
+ text: `Available tables:\n${tables.join("\n")}`,
303
+ },
304
+ ],
305
+ };
306
+ }
307
+ // Query Tool Handlers
308
+ async function handleQueryRecords(client, args) {
309
+ const response = await client.queryRecords(args.table, {
310
+ filter: args.filter,
311
+ select: args.select,
312
+ orderby: args.orderby,
313
+ top: args.top,
314
+ skip: args.skip,
315
+ expand: args.expand,
316
+ count: args.count,
317
+ });
318
+ const summary = ODataParser.createQuerySummary(response);
319
+ const formatted = ODataParser.formatQueryResponse(response);
320
+ return {
321
+ content: [
322
+ {
323
+ type: "text",
324
+ text: `${summary}\n\n${formatted}`,
325
+ },
326
+ ],
327
+ };
328
+ }
329
+ async function handleGetRecord(client, args) {
330
+ const record = await client.getRecord(args.table, args.recordId, {
331
+ select: args.select,
332
+ expand: args.expand,
333
+ });
334
+ return {
335
+ content: [
336
+ {
337
+ type: "text",
338
+ text: ODataParser.formatRecordResponse(record),
339
+ },
340
+ ],
341
+ };
342
+ }
343
+ async function handleGetRecords(client, args) {
344
+ const response = await client.queryRecords(args.table, {
345
+ top: args.top,
346
+ skip: args.skip,
347
+ });
348
+ const summary = ODataParser.createQuerySummary(response);
349
+ const formatted = ODataParser.formatQueryResponse(response);
350
+ return {
351
+ content: [
352
+ {
353
+ type: "text",
354
+ text: `${summary}\n\n${formatted}`,
355
+ },
356
+ ],
357
+ };
358
+ }
359
+ async function handleCountRecords(client, args) {
360
+ const count = await client.countRecords(args.table, args.filter);
361
+ return {
362
+ content: [
363
+ {
364
+ type: "text",
365
+ text: `Total records in ${args.table}: ${count}`,
366
+ },
367
+ ],
368
+ };
369
+ }
370
+ // CRUD Tool Handlers
371
+ async function handleCreateRecord(client, args) {
372
+ const newRecord = await client.createRecord(args.table, args.data);
373
+ return {
374
+ content: [
375
+ {
376
+ type: "text",
377
+ text: `Record created successfully:\n${ODataParser.formatRecordResponse(newRecord)}`,
378
+ },
379
+ ],
380
+ };
381
+ }
382
+ async function handleUpdateRecord(client, args) {
383
+ await client.updateRecord(args.table, args.recordId, args.data);
384
+ return {
385
+ content: [
386
+ {
387
+ type: "text",
388
+ text: `Record ${args.recordId} in ${args.table} updated successfully`,
389
+ },
390
+ ],
391
+ };
392
+ }
393
+ async function handleDeleteRecord(client, args) {
394
+ await client.deleteRecord(args.table, args.recordId);
395
+ return {
396
+ content: [
397
+ {
398
+ type: "text",
399
+ text: `Record ${args.recordId} deleted from ${args.table}`,
400
+ },
401
+ ],
402
+ };
403
+ }
404
+ //# sourceMappingURL=odata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/tools/odata.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,iBAAiB;IACjB;QACE,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,yFAAyF;QACtG,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,+FAA+F;QAC5G,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;KACF;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,8EAA8E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IAAI,CAAC,KAAK,EAAE;aAC3D;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ export type TransportType = "stdio" | "http" | "https";
3
+ export interface TransportConfig {
4
+ type: TransportType;
5
+ port?: number;
6
+ host?: string;
7
+ certPath?: string;
8
+ keyPath?: string;
9
+ }
10
+ /**
11
+ * Parse transport configuration from environment variables
12
+ */
13
+ export declare function getTransportConfig(): TransportConfig;
14
+ /**
15
+ * Create and connect transport based on configuration
16
+ */
17
+ export declare function setupTransport(server: Server, config: TransportConfig): Promise<void>;
18
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAOnE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAYpD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAiBf"}