fixparser-plugin-mcp 9.1.7-e016b83b → 9.1.7-e11287f5

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.
@@ -3,6 +3,234 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { Field, Fields, Messages } from "fixparser";
5
5
  import { z } from "zod";
6
+ var toolSchemas = {
7
+ parse: {
8
+ description: "Parses a FIX message and describes it in plain language",
9
+ schema: {
10
+ type: "object",
11
+ properties: {
12
+ fixString: { type: "string" }
13
+ },
14
+ required: ["fixString"]
15
+ }
16
+ },
17
+ parseToJSON: {
18
+ description: "Parses a FIX message into JSON",
19
+ schema: {
20
+ type: "object",
21
+ properties: {
22
+ fixString: { type: "string" }
23
+ },
24
+ required: ["fixString"]
25
+ }
26
+ },
27
+ verifyOrder: {
28
+ description: "Verifies order parameters before execution. verifyOrder must be called before executeOrder.",
29
+ schema: {
30
+ type: "object",
31
+ properties: {
32
+ clOrdID: { type: "string" },
33
+ handlInst: {
34
+ type: "string",
35
+ enum: ["1", "2", "3"],
36
+ description: "Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"
37
+ },
38
+ quantity: { type: "string" },
39
+ price: { type: "string" },
40
+ ordType: {
41
+ type: "string",
42
+ enum: [
43
+ "1",
44
+ "2",
45
+ "3",
46
+ "4",
47
+ "5",
48
+ "6",
49
+ "7",
50
+ "8",
51
+ "9",
52
+ "A",
53
+ "B",
54
+ "C",
55
+ "D",
56
+ "E",
57
+ "F",
58
+ "G",
59
+ "H",
60
+ "I",
61
+ "J",
62
+ "K",
63
+ "L",
64
+ "M",
65
+ "P",
66
+ "Q",
67
+ "R",
68
+ "S"
69
+ ],
70
+ description: "Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"
71
+ },
72
+ side: {
73
+ type: "string",
74
+ enum: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H"],
75
+ description: "Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"
76
+ },
77
+ symbol: { type: "string" },
78
+ timeInForce: {
79
+ type: "string",
80
+ enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C"],
81
+ description: "Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"
82
+ }
83
+ },
84
+ required: ["clOrdID", "handlInst", "quantity", "price", "ordType", "side", "symbol", "timeInForce"]
85
+ }
86
+ },
87
+ executeOrder: {
88
+ description: "Executes a verified order. verifyOrder must be called before executeOrder. user has to explicitly allow executeOrder.",
89
+ schema: {
90
+ type: "object",
91
+ properties: {
92
+ clOrdID: { type: "string" },
93
+ handlInst: {
94
+ type: "string",
95
+ enum: ["1", "2", "3"],
96
+ description: "Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"
97
+ },
98
+ quantity: { type: "string" },
99
+ price: { type: "string" },
100
+ ordType: {
101
+ type: "string",
102
+ enum: [
103
+ "1",
104
+ "2",
105
+ "3",
106
+ "4",
107
+ "5",
108
+ "6",
109
+ "7",
110
+ "8",
111
+ "9",
112
+ "A",
113
+ "B",
114
+ "C",
115
+ "D",
116
+ "E",
117
+ "F",
118
+ "G",
119
+ "H",
120
+ "I",
121
+ "J",
122
+ "K",
123
+ "L",
124
+ "M",
125
+ "P",
126
+ "Q",
127
+ "R",
128
+ "S"
129
+ ],
130
+ description: "Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"
131
+ },
132
+ side: {
133
+ type: "string",
134
+ enum: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H"],
135
+ description: "Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"
136
+ },
137
+ symbol: { type: "string" },
138
+ timeInForce: {
139
+ type: "string",
140
+ enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C"],
141
+ description: "Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"
142
+ }
143
+ },
144
+ required: ["clOrdID", "handlInst", "quantity", "price", "ordType", "side", "symbol", "timeInForce"]
145
+ }
146
+ },
147
+ marketDataRequest: {
148
+ description: "Requests market data for specified symbols",
149
+ schema: {
150
+ type: "object",
151
+ properties: {
152
+ mdUpdateType: {
153
+ type: "string",
154
+ enum: ["0", "1"],
155
+ description: "Market Data Update Type: 0=Full Refresh, 1=Incremental Refresh"
156
+ },
157
+ symbols: { type: "array", items: { type: "string" } },
158
+ mdReqID: { type: "string" },
159
+ subscriptionRequestType: {
160
+ type: "string",
161
+ enum: ["0", "1", "2"],
162
+ description: "Subscription Request Type: 0=Snapshot, 1=Snapshot + Updates, 2=Disable Previous Snapshot + Update Request"
163
+ },
164
+ mdEntryTypes: {
165
+ type: "array",
166
+ items: {
167
+ type: "string",
168
+ enum: [
169
+ "0",
170
+ "1",
171
+ "2",
172
+ "3",
173
+ "4",
174
+ "5",
175
+ "6",
176
+ "7",
177
+ "8",
178
+ "9",
179
+ "A",
180
+ "B",
181
+ "C",
182
+ "D",
183
+ "E",
184
+ "F",
185
+ "G",
186
+ "H",
187
+ "I",
188
+ "J",
189
+ "K",
190
+ "L",
191
+ "M",
192
+ "N",
193
+ "O",
194
+ "P",
195
+ "Q",
196
+ "R",
197
+ "S",
198
+ "T",
199
+ "U",
200
+ "V",
201
+ "W",
202
+ "X",
203
+ "Y",
204
+ "Z"
205
+ ],
206
+ description: "Market Data Entry Types: 0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price, 5=Closing Price, 6=Settlement Price, 7=High Price, 8=Low Price, 9=Trade Volume, A=Open Interest, B=Simulated Sell Price, C=Simulated Buy Price, D=Empty Book, E=Session High Bid, F=Session Low Offer, G=Fixing Price, H=Electronic Volume, I=Threshold Limits and Price Band Variation, J=Clearing Price, K=Open Interest Change, L=Last Trade Price, M=Last Trade Volume, N=Last Trade Time, O=Last Trade Tick, P=Last Trade Exchange, Q=Last Trade ID, R=Last Trade Side, S=Last Trade Price Change, T=Last Trade Price Change Percent, U=Last Trade Price Change Basis Points, V=Last Trade Price Change Points, W=Last Trade Price Change Ticks, X=Last Trade Price Change Ticks Percent, Y=Last Trade Price Change Ticks Basis Points, Z=Last Trade Price Change Ticks Points"
207
+ }
208
+ }
209
+ },
210
+ required: ["mdUpdateType", "symbols", "mdReqID", "subscriptionRequestType", "mdEntryTypes"]
211
+ }
212
+ },
213
+ getStockGraph: {
214
+ description: "Generates a price chart for a given symbol",
215
+ schema: {
216
+ type: "object",
217
+ properties: {
218
+ symbol: { type: "string" }
219
+ },
220
+ required: ["symbol"]
221
+ }
222
+ },
223
+ getStockPriceHistory: {
224
+ description: "Returns price history for a given symbol",
225
+ schema: {
226
+ type: "object",
227
+ properties: {
228
+ symbol: { type: "string" }
229
+ },
230
+ required: ["symbol"]
231
+ }
232
+ }
233
+ };
6
234
  var MCPLocal = class {
7
235
  parser;
8
236
  server = new Server(
@@ -12,168 +240,16 @@ var MCPLocal = class {
12
240
  },
13
241
  {
14
242
  capabilities: {
15
- tools: {
16
- parse: {
17
- description: "Parses a FIX message and describes it in plain language",
18
- parameters: {
19
- type: "object",
20
- properties: {
21
- fixString: { type: "string" }
22
- },
23
- required: ["fixString"]
24
- }
25
- },
26
- parseToJSON: {
27
- description: "Parses a FIX message into JSON",
28
- parameters: {
29
- type: "object",
30
- properties: {
31
- fixString: { type: "string" }
32
- },
33
- required: ["fixString"]
34
- }
35
- },
36
- verifyOrder: {
37
- description: "Verifies order parameters before execution",
38
- parameters: {
39
- type: "object",
40
- properties: {
41
- clOrdID: { type: "string" },
42
- handlInst: { type: "string", enum: ["1", "2", "3"] },
43
- quantity: { type: "string" },
44
- price: { type: "string" },
45
- ordType: {
46
- type: "string",
47
- enum: [
48
- "1",
49
- "2",
50
- "3",
51
- "4",
52
- "5",
53
- "6",
54
- "7",
55
- "8",
56
- "9",
57
- "A",
58
- "B",
59
- "C",
60
- "D",
61
- "E",
62
- "F",
63
- "G",
64
- "H",
65
- "I",
66
- "J",
67
- "K",
68
- "L",
69
- "M",
70
- "P",
71
- "Q",
72
- "R",
73
- "S"
74
- ]
75
- },
76
- side: {
77
- type: "string",
78
- enum: [
79
- "1",
80
- "2",
81
- "3",
82
- "4",
83
- "5",
84
- "6",
85
- "7",
86
- "8",
87
- "9",
88
- "A",
89
- "B",
90
- "C",
91
- "D",
92
- "E",
93
- "F",
94
- "G",
95
- "H"
96
- ]
97
- },
98
- symbol: { type: "string" },
99
- timeInForce: {
100
- type: "string",
101
- enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C"]
102
- }
103
- },
104
- required: [
105
- "clOrdID",
106
- "handlInst",
107
- "quantity",
108
- "price",
109
- "ordType",
110
- "side",
111
- "symbol",
112
- "timeInForce"
113
- ]
114
- }
115
- },
116
- executeOrder: {
117
- description: "Executes a verified order",
118
- parameters: {
119
- type: "object",
120
- properties: {
121
- clOrdID: { type: "string" },
122
- handlInst: { type: "string", enum: ["1", "2", "3"] },
123
- quantity: { type: "string" },
124
- price: { type: "string" },
125
- ordType: { type: "string" },
126
- side: { type: "string" },
127
- symbol: { type: "string" },
128
- timeInForce: { type: "string" }
129
- },
130
- required: [
131
- "clOrdID",
132
- "handlInst",
133
- "quantity",
134
- "price",
135
- "ordType",
136
- "side",
137
- "symbol",
138
- "timeInForce"
139
- ]
140
- }
141
- },
142
- marketDataRequest: {
143
- description: "Requests market data for specified symbols",
144
- parameters: {
145
- type: "object",
146
- properties: {
147
- mdUpdateType: { type: "string", enum: ["0", "1"] },
148
- symbols: { type: "array", items: { type: "string" } },
149
- mdReqID: { type: "string" },
150
- subscriptionRequestType: { type: "string", enum: ["0", "1", "2"] },
151
- mdEntryTypes: { type: "array", items: { type: "string" } }
152
- },
153
- required: ["mdUpdateType", "symbols", "mdReqID", "subscriptionRequestType", "mdEntryTypes"]
154
- }
155
- },
156
- getStockGraph: {
157
- description: "Generates a price chart for a given symbol",
158
- parameters: {
159
- type: "object",
160
- properties: {
161
- symbol: { type: "string" }
162
- },
163
- required: ["symbol"]
164
- }
243
+ tools: Object.entries(toolSchemas).reduce(
244
+ (acc, [name, { description, schema }]) => {
245
+ acc[name] = {
246
+ description,
247
+ parameters: schema
248
+ };
249
+ return acc;
165
250
  },
166
- getStockPriceHistory: {
167
- description: "Returns price history for a given symbol",
168
- parameters: {
169
- type: "object",
170
- properties: {
171
- symbol: { type: "string" }
172
- },
173
- required: ["symbol"]
174
- }
175
- }
176
- }
251
+ {}
252
+ )
177
253
  }
178
254
  }
179
255
  );
@@ -268,181 +344,11 @@ var MCPLocal = class {
268
344
  z.object({ method: z.literal("tools/list") }),
269
345
  async (request, extra) => {
270
346
  return {
271
- tools: [
272
- {
273
- name: "parse",
274
- description: "Parses a FIX message and describes it in plain language",
275
- inputSchema: {
276
- type: "object",
277
- properties: {
278
- fixString: { type: "string" }
279
- },
280
- required: ["fixString"]
281
- }
282
- },
283
- {
284
- name: "parseToJSON",
285
- description: "Parses a FIX message into JSON",
286
- inputSchema: {
287
- type: "object",
288
- properties: {
289
- fixString: { type: "string" }
290
- },
291
- required: ["fixString"]
292
- }
293
- },
294
- {
295
- name: "verifyOrder",
296
- description: "Verifies order parameters before execution",
297
- inputSchema: {
298
- type: "object",
299
- properties: {
300
- clOrdID: { type: "string" },
301
- handlInst: { type: "string", enum: ["1", "2", "3"] },
302
- quantity: { type: "string" },
303
- price: { type: "string" },
304
- ordType: {
305
- type: "string",
306
- enum: [
307
- "1",
308
- "2",
309
- "3",
310
- "4",
311
- "5",
312
- "6",
313
- "7",
314
- "8",
315
- "9",
316
- "A",
317
- "B",
318
- "C",
319
- "D",
320
- "E",
321
- "F",
322
- "G",
323
- "H",
324
- "I",
325
- "J",
326
- "K",
327
- "L",
328
- "M",
329
- "P",
330
- "Q",
331
- "R",
332
- "S"
333
- ]
334
- },
335
- side: {
336
- type: "string",
337
- enum: [
338
- "1",
339
- "2",
340
- "3",
341
- "4",
342
- "5",
343
- "6",
344
- "7",
345
- "8",
346
- "9",
347
- "A",
348
- "B",
349
- "C",
350
- "D",
351
- "E",
352
- "F",
353
- "G",
354
- "H"
355
- ]
356
- },
357
- symbol: { type: "string" },
358
- timeInForce: {
359
- type: "string",
360
- enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C"]
361
- }
362
- },
363
- required: [
364
- "clOrdID",
365
- "handlInst",
366
- "quantity",
367
- "price",
368
- "ordType",
369
- "side",
370
- "symbol",
371
- "timeInForce"
372
- ]
373
- }
374
- },
375
- {
376
- name: "executeOrder",
377
- description: "Executes a verified order",
378
- inputSchema: {
379
- type: "object",
380
- properties: {
381
- clOrdID: { type: "string" },
382
- handlInst: { type: "string", enum: ["1", "2", "3"] },
383
- quantity: { type: "string" },
384
- price: { type: "string" },
385
- ordType: { type: "string" },
386
- side: { type: "string" },
387
- symbol: { type: "string" },
388
- timeInForce: { type: "string" }
389
- },
390
- required: [
391
- "clOrdID",
392
- "handlInst",
393
- "quantity",
394
- "price",
395
- "ordType",
396
- "side",
397
- "symbol",
398
- "timeInForce"
399
- ]
400
- }
401
- },
402
- {
403
- name: "marketDataRequest",
404
- description: "Requests market data for specified symbols",
405
- inputSchema: {
406
- type: "object",
407
- properties: {
408
- mdUpdateType: { type: "string", enum: ["0", "1"] },
409
- symbols: { type: "array", items: { type: "string" } },
410
- mdReqID: { type: "string" },
411
- subscriptionRequestType: { type: "string", enum: ["0", "1", "2"] },
412
- mdEntryTypes: { type: "array", items: { type: "string" } }
413
- },
414
- required: [
415
- "mdUpdateType",
416
- "symbols",
417
- "mdReqID",
418
- "subscriptionRequestType",
419
- "mdEntryTypes"
420
- ]
421
- }
422
- },
423
- {
424
- name: "getStockGraph",
425
- description: "Generates a price chart for a given symbol",
426
- inputSchema: {
427
- type: "object",
428
- properties: {
429
- symbol: { type: "string" }
430
- },
431
- required: ["symbol"]
432
- }
433
- },
434
- {
435
- name: "getStockPriceHistory",
436
- description: "Returns price history for a given symbol",
437
- inputSchema: {
438
- type: "object",
439
- properties: {
440
- symbol: { type: "string" }
441
- },
442
- required: ["symbol"]
443
- }
444
- }
445
- ]
347
+ tools: Object.entries(toolSchemas).map(([name, { description, schema }]) => ({
348
+ name,
349
+ description,
350
+ inputSchema: schema
351
+ }))
446
352
  };
447
353
  }
448
354
  );