fixparser-plugin-mcp 9.1.6-da9cb1d7 → 9.1.7-184ecd0e

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.
@@ -0,0 +1,707 @@
1
+ // src/MCPLocal.ts
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import {
5
+ CallToolRequestSchema,
6
+ GetPromptRequestSchema,
7
+ ListPromptsRequestSchema,
8
+ ListResourcesRequestSchema,
9
+ ListToolsRequestSchema
10
+ } from "@modelcontextprotocol/sdk/types.js";
11
+ import {
12
+ Field,
13
+ Fields,
14
+ HandlInst,
15
+ MDEntryType,
16
+ Messages,
17
+ OrdType,
18
+ SubscriptionRequestType,
19
+ TimeInForce
20
+ } from "fixparser";
21
+ var parseInputSchema = {
22
+ type: "object",
23
+ properties: {
24
+ fixString: {
25
+ type: "string",
26
+ description: "FIX message string to parse"
27
+ }
28
+ },
29
+ required: ["fixString"]
30
+ };
31
+ var parseToJSONInputSchema = {
32
+ type: "object",
33
+ properties: {
34
+ fixString: {
35
+ type: "string",
36
+ description: "FIX message string to parse"
37
+ }
38
+ },
39
+ required: ["fixString"]
40
+ };
41
+ var newOrderSingleInputSchema = {
42
+ type: "object",
43
+ properties: {
44
+ clOrdID: {
45
+ type: "string",
46
+ description: "Client Order ID"
47
+ },
48
+ handlInst: {
49
+ type: "string",
50
+ enum: ["1", "2", "3"],
51
+ default: HandlInst.AutomatedExecutionNoIntervention,
52
+ description: 'Handling instruction (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Manual, "2" for Automated, "3" for AutomatedNoIntervention)'
53
+ },
54
+ quantity: {
55
+ type: "number",
56
+ description: "Order quantity"
57
+ },
58
+ price: {
59
+ type: "number",
60
+ description: "Order price"
61
+ },
62
+ ordType: {
63
+ type: "string",
64
+ enum: [
65
+ "1",
66
+ "2",
67
+ "3",
68
+ "4",
69
+ "5",
70
+ "6",
71
+ "7",
72
+ "8",
73
+ "9",
74
+ "A",
75
+ "B",
76
+ "C",
77
+ "D",
78
+ "E",
79
+ "F",
80
+ "G",
81
+ "H",
82
+ "I",
83
+ "J",
84
+ "K",
85
+ "L",
86
+ "M",
87
+ "P",
88
+ "Q",
89
+ "R",
90
+ "S"
91
+ ],
92
+ default: OrdType.Market,
93
+ description: 'Order type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Market, "2" for Limit, "3" for Stop)'
94
+ },
95
+ side: {
96
+ type: "string",
97
+ enum: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H"],
98
+ description: 'Order side (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Buy, "2" for Sell, "3" for BuyMinus, "4" for SellPlus, "5" for SellShort, "6" for SellShortExempt, "7" for Undisclosed, "8" for Cross, "9" for CrossShort, "A" for CrossShortExempt, "B" for AsDefined, "C" for Opposite, "D" for Subscribe, "E" for Redeem, "F" for Lend, "G" for Borrow, "H" for SellUndisclosed)'
99
+ },
100
+ symbol: {
101
+ type: "string",
102
+ description: "Trading symbol"
103
+ },
104
+ timeInForce: {
105
+ type: "string",
106
+ enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C"],
107
+ default: TimeInForce.Day,
108
+ description: 'Time in force (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Day, "1" for Good Till Cancel, "2" for At Opening, "3" for Immediate or Cancel, "4" for Fill or Kill, "5" for Good Till Crossing, "6" for Good Till Date)'
109
+ }
110
+ },
111
+ required: ["clOrdID", "quantity", "price", "side", "symbol"]
112
+ };
113
+ var marketDataRequestInputSchema = {
114
+ type: "object",
115
+ properties: {
116
+ mdUpdateType: {
117
+ type: "string",
118
+ enum: ["0", "1"],
119
+ default: "0",
120
+ description: 'Market data update type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for FullRefresh, "1" for IncrementalRefresh)'
121
+ },
122
+ symbol: {
123
+ type: "string",
124
+ description: "Trading symbol"
125
+ },
126
+ mdReqID: {
127
+ type: "string",
128
+ description: "Market data request ID"
129
+ },
130
+ subscriptionRequestType: {
131
+ type: "string",
132
+ enum: ["0", "1", "2"],
133
+ default: SubscriptionRequestType.SnapshotAndUpdates,
134
+ description: 'Subscription request type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Snapshot + Updates, "1" for Snapshot, "2" for Unsubscribe)'
135
+ },
136
+ mdEntryType: {
137
+ type: "string",
138
+ enum: [
139
+ "0",
140
+ "1",
141
+ "2",
142
+ "3",
143
+ "4",
144
+ "5",
145
+ "6",
146
+ "7",
147
+ "8",
148
+ "9",
149
+ "A",
150
+ "B",
151
+ "C",
152
+ "D",
153
+ "E",
154
+ "F",
155
+ "G",
156
+ "H",
157
+ "J",
158
+ "K",
159
+ "L",
160
+ "M",
161
+ "N",
162
+ "O",
163
+ "P",
164
+ "Q",
165
+ "S",
166
+ "R",
167
+ "T",
168
+ "U",
169
+ "V",
170
+ "W",
171
+ "X",
172
+ "Y",
173
+ "Z",
174
+ "a",
175
+ "b",
176
+ "c",
177
+ "d",
178
+ "e",
179
+ "g",
180
+ "h",
181
+ "i",
182
+ "t"
183
+ ],
184
+ default: MDEntryType.Bid,
185
+ description: 'Market data entry type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Bid, "1" for Offer, "2" for Trade, "3" for Index Value, "4" for Opening Price)'
186
+ }
187
+ },
188
+ required: ["symbol", "mdReqID"]
189
+ };
190
+ var MCPLocal = class {
191
+ logger;
192
+ parser;
193
+ server = new Server(
194
+ {
195
+ name: "fixparser",
196
+ version: "1.0.0"
197
+ },
198
+ {
199
+ capabilities: {
200
+ tools: {},
201
+ prompts: {},
202
+ resources: {}
203
+ }
204
+ }
205
+ );
206
+ transport = new StdioServerTransport();
207
+ onReady = void 0;
208
+ pendingRequests = /* @__PURE__ */ new Map();
209
+ constructor({ logger, onReady }) {
210
+ if (logger) this.logger = logger;
211
+ if (onReady) this.onReady = onReady;
212
+ }
213
+ async register(parser) {
214
+ this.parser = parser;
215
+ this.parser.addOnMessageCallback((message) => {
216
+ this.logger?.log({
217
+ level: "info",
218
+ message: `FIXParser (MCP): (${parser.protocol?.toUpperCase()}): << received ${message.description}`
219
+ });
220
+ const msgType = message.messageType;
221
+ if (msgType === Messages.MarketDataSnapshotFullRefresh || msgType === Messages.ExecutionReport) {
222
+ const idField = msgType === Messages.MarketDataSnapshotFullRefresh ? message.getField(Fields.MDReqID) : message.getField(Fields.ClOrdID);
223
+ if (idField) {
224
+ const id = idField.value;
225
+ if (typeof id === "string" || typeof id === "number") {
226
+ const callback = this.pendingRequests.get(String(id));
227
+ if (callback) {
228
+ callback(message);
229
+ this.pendingRequests.delete(String(id));
230
+ }
231
+ }
232
+ }
233
+ }
234
+ });
235
+ this.logger = parser.logger;
236
+ this.addWorkflows();
237
+ await this.server.connect(this.transport);
238
+ if (this.onReady) {
239
+ this.onReady();
240
+ }
241
+ }
242
+ addWorkflows() {
243
+ if (!this.parser) {
244
+ this.logger?.log({
245
+ level: "error",
246
+ message: "FIXParser (MCP): -- FIXParser instance not initialized. Ignoring setup of workflows..."
247
+ });
248
+ return;
249
+ }
250
+ if (!this.server) {
251
+ this.logger?.log({
252
+ level: "error",
253
+ message: "FIXParser (MCP): -- MCP Server not initialized. Ignoring setup of workflows..."
254
+ });
255
+ return;
256
+ }
257
+ const validateArgs = (args, schema) => {
258
+ const result = {};
259
+ for (const [key, propSchema] of Object.entries(schema.properties || {})) {
260
+ const prop = propSchema;
261
+ const value = args?.[key];
262
+ if (prop.required && (value === void 0 || value === null)) {
263
+ throw new Error(`Required property '${key}' is missing`);
264
+ }
265
+ if (value !== void 0) {
266
+ result[key] = value;
267
+ } else if (prop.default !== void 0) {
268
+ result[key] = prop.default;
269
+ }
270
+ }
271
+ return result;
272
+ };
273
+ this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
274
+ return {
275
+ resources: []
276
+ };
277
+ });
278
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => {
279
+ return {
280
+ tools: [
281
+ {
282
+ name: "parse",
283
+ description: "Parses a FIX message and describes it in plain language",
284
+ inputSchema: parseInputSchema
285
+ },
286
+ {
287
+ name: "parseToJSON",
288
+ description: "Parses a FIX message into JSON",
289
+ inputSchema: parseToJSONInputSchema
290
+ },
291
+ {
292
+ name: "newOrderSingle",
293
+ description: "Creates and sends a New Order Single",
294
+ inputSchema: newOrderSingleInputSchema
295
+ },
296
+ {
297
+ name: "marketDataRequest",
298
+ description: "Sends a request for Market Data with the given symbol",
299
+ inputSchema: marketDataRequestInputSchema
300
+ }
301
+ ]
302
+ };
303
+ });
304
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
305
+ const { name, arguments: args } = request.params;
306
+ switch (name) {
307
+ case "parse": {
308
+ try {
309
+ const { fixString } = validateArgs(args, parseInputSchema);
310
+ const parsedMessage = this.parser?.parse(fixString);
311
+ if (!parsedMessage || parsedMessage.length === 0) {
312
+ return {
313
+ isError: true,
314
+ content: [{ type: "text", text: "Error: Failed to parse FIX string" }]
315
+ };
316
+ }
317
+ return {
318
+ content: [
319
+ {
320
+ type: "text",
321
+ text: `${parsedMessage[0].description}
322
+ ${parsedMessage[0].messageTypeDescription}`
323
+ }
324
+ ]
325
+ };
326
+ } catch (error) {
327
+ return {
328
+ isError: true,
329
+ content: [
330
+ {
331
+ type: "text",
332
+ text: `Error: ${error instanceof Error ? error.message : "Failed to parse FIX string"}`
333
+ }
334
+ ]
335
+ };
336
+ }
337
+ }
338
+ case "parseToJSON": {
339
+ try {
340
+ const { fixString } = validateArgs(args, parseToJSONInputSchema);
341
+ const parsedMessage = this.parser?.parse(fixString);
342
+ if (!parsedMessage || parsedMessage.length === 0) {
343
+ return {
344
+ isError: true,
345
+ content: [{ type: "text", text: "Error: Failed to parse FIX string" }]
346
+ };
347
+ }
348
+ return {
349
+ content: [
350
+ {
351
+ type: "text",
352
+ text: `${parsedMessage[0].toFIXJSON()}`
353
+ }
354
+ ]
355
+ };
356
+ } catch (error) {
357
+ return {
358
+ isError: true,
359
+ content: [
360
+ {
361
+ type: "text",
362
+ text: `Error: ${error instanceof Error ? error.message : "Failed to parse FIX string"}`
363
+ }
364
+ ]
365
+ };
366
+ }
367
+ }
368
+ case "newOrderSingle": {
369
+ try {
370
+ const { clOrdID, handlInst, quantity, price, ordType, side, symbol, timeInForce } = validateArgs(args, newOrderSingleInputSchema);
371
+ const response = new Promise((resolve) => {
372
+ this.pendingRequests.set(clOrdID, resolve);
373
+ });
374
+ const order = this.parser?.createMessage(
375
+ new Field(Fields.MsgType, Messages.NewOrderSingle),
376
+ new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),
377
+ new Field(Fields.SenderCompID, this.parser?.sender),
378
+ new Field(Fields.TargetCompID, this.parser?.target),
379
+ new Field(Fields.SendingTime, this.parser?.getTimestamp()),
380
+ new Field(Fields.ClOrdID, clOrdID),
381
+ new Field(Fields.Side, side),
382
+ new Field(Fields.Symbol, symbol),
383
+ new Field(Fields.OrderQty, quantity),
384
+ new Field(Fields.Price, price),
385
+ new Field(Fields.OrdType, ordType),
386
+ new Field(Fields.HandlInst, handlInst),
387
+ new Field(Fields.TimeInForce, timeInForce),
388
+ new Field(Fields.TransactTime, this.parser?.getTimestamp())
389
+ );
390
+ if (!this.parser?.connected) {
391
+ this.logger?.log({
392
+ level: "error",
393
+ message: "FIXParser (MCP): -- Not connected. Ignoring message."
394
+ });
395
+ return {
396
+ isError: true,
397
+ content: [
398
+ {
399
+ type: "text",
400
+ text: "Error: Not connected. Ignoring message."
401
+ }
402
+ ]
403
+ };
404
+ }
405
+ this.parser?.send(order);
406
+ this.logger?.log({
407
+ level: "info",
408
+ message: `FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${order?.description}`
409
+ });
410
+ const fixData = await response;
411
+ return {
412
+ content: [
413
+ {
414
+ type: "text",
415
+ text: `Execution Report for order ${clOrdID}: ${JSON.stringify(fixData.toFIXJSON())}`
416
+ }
417
+ ]
418
+ };
419
+ } catch (error) {
420
+ return {
421
+ isError: true,
422
+ content: [
423
+ {
424
+ type: "text",
425
+ text: `Error: ${error instanceof Error ? error.message : "Failed to create order"}`
426
+ }
427
+ ]
428
+ };
429
+ }
430
+ }
431
+ case "marketDataRequest": {
432
+ try {
433
+ const { mdUpdateType, symbol, mdReqID, subscriptionRequestType, mdEntryType } = validateArgs(
434
+ args,
435
+ marketDataRequestInputSchema
436
+ );
437
+ const response = new Promise((resolve) => {
438
+ this.pendingRequests.set(mdReqID, resolve);
439
+ });
440
+ const marketDataRequest = this.parser?.createMessage(
441
+ new Field(Fields.MsgType, Messages.MarketDataRequest),
442
+ new Field(Fields.SenderCompID, this.parser?.sender),
443
+ new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),
444
+ new Field(Fields.TargetCompID, this.parser?.target),
445
+ new Field(Fields.SendingTime, this.parser?.getTimestamp()),
446
+ new Field(Fields.MarketDepth, 0),
447
+ new Field(Fields.MDUpdateType, mdUpdateType),
448
+ new Field(Fields.NoRelatedSym, 1),
449
+ new Field(Fields.Symbol, symbol),
450
+ new Field(Fields.MDReqID, mdReqID),
451
+ new Field(Fields.SubscriptionRequestType, subscriptionRequestType),
452
+ new Field(Fields.NoMDEntryTypes, 1),
453
+ new Field(Fields.MDEntryType, mdEntryType)
454
+ );
455
+ if (!this.parser?.connected) {
456
+ this.logger?.log({
457
+ level: "error",
458
+ message: "FIXParser (MCP): -- Not connected. Ignoring message."
459
+ });
460
+ return {
461
+ isError: true,
462
+ content: [
463
+ {
464
+ type: "text",
465
+ text: "Error: Not connected. Ignoring message."
466
+ }
467
+ ]
468
+ };
469
+ }
470
+ this.parser?.send(marketDataRequest);
471
+ this.logger?.log({
472
+ level: "info",
473
+ message: `FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${marketDataRequest?.description}`
474
+ });
475
+ const fixData = await response;
476
+ return {
477
+ content: [
478
+ {
479
+ type: "text",
480
+ text: `Market data for ${symbol}: ${JSON.stringify(fixData.toFIXJSON())}`
481
+ }
482
+ ]
483
+ };
484
+ } catch (error) {
485
+ return {
486
+ isError: true,
487
+ content: [
488
+ {
489
+ type: "text",
490
+ text: `Error: ${error instanceof Error ? error.message : "Failed to request market data"}`
491
+ }
492
+ ]
493
+ };
494
+ }
495
+ }
496
+ default:
497
+ throw new Error(`Unknown tool: ${name}`);
498
+ }
499
+ });
500
+ this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
501
+ return {
502
+ prompts: [
503
+ {
504
+ name: "parse",
505
+ description: "Parses a FIX message and describes it in plain language",
506
+ arguments: [
507
+ {
508
+ name: "fixString",
509
+ description: "FIX message string to parse",
510
+ required: true
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ name: "parseToJSON",
516
+ description: "Parses a FIX message into JSON",
517
+ arguments: [
518
+ {
519
+ name: "fixString",
520
+ description: "FIX message string to parse",
521
+ required: true
522
+ }
523
+ ]
524
+ },
525
+ {
526
+ name: "newOrderSingle",
527
+ description: "Creates and sends a New Order Single",
528
+ arguments: [
529
+ {
530
+ name: "clOrdID",
531
+ description: "Client Order ID",
532
+ required: true
533
+ },
534
+ {
535
+ name: "handlInst",
536
+ description: "Handling instruction",
537
+ required: false
538
+ },
539
+ {
540
+ name: "quantity",
541
+ description: "Order quantity",
542
+ required: true
543
+ },
544
+ {
545
+ name: "price",
546
+ description: "Order price",
547
+ required: true
548
+ },
549
+ {
550
+ name: "ordType",
551
+ description: "Order type",
552
+ required: false
553
+ },
554
+ {
555
+ name: "side",
556
+ description: "Order 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)",
557
+ required: true
558
+ },
559
+ {
560
+ name: "symbol",
561
+ description: "Trading symbol",
562
+ required: true
563
+ },
564
+ {
565
+ name: "timeInForce",
566
+ description: "Time in force",
567
+ required: false
568
+ }
569
+ ]
570
+ },
571
+ {
572
+ name: "marketDataRequest",
573
+ description: "Sends a request for Market Data with the given symbol",
574
+ arguments: [
575
+ {
576
+ name: "mdUpdateType",
577
+ description: "Market data update type",
578
+ required: false
579
+ },
580
+ {
581
+ name: "symbol",
582
+ description: "Trading symbol",
583
+ required: true
584
+ },
585
+ {
586
+ name: "mdReqID",
587
+ description: "Market data request ID",
588
+ required: true
589
+ },
590
+ {
591
+ name: "subscriptionRequestType",
592
+ description: "Subscription request type",
593
+ required: false
594
+ },
595
+ {
596
+ name: "mdEntryType",
597
+ description: "Market data entry type",
598
+ required: false
599
+ }
600
+ ]
601
+ }
602
+ ]
603
+ };
604
+ });
605
+ this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
606
+ const { name, arguments: args } = request.params;
607
+ switch (name) {
608
+ case "parse": {
609
+ const fixString = args?.fixString || "";
610
+ return {
611
+ messages: [
612
+ {
613
+ role: "user",
614
+ content: {
615
+ type: "text",
616
+ text: `Please parse and explain this FIX message: ${fixString}`
617
+ }
618
+ }
619
+ ]
620
+ };
621
+ }
622
+ case "parseToJSON": {
623
+ const fixString = args?.fixString || "";
624
+ return {
625
+ messages: [
626
+ {
627
+ role: "user",
628
+ content: {
629
+ type: "text",
630
+ text: `Please parse the FIX message to JSON: ${fixString}`
631
+ }
632
+ }
633
+ ]
634
+ };
635
+ }
636
+ case "newOrderSingle": {
637
+ const { clOrdID, handlInst, quantity, price, ordType, side, symbol, timeInForce } = args || {};
638
+ return {
639
+ messages: [
640
+ {
641
+ role: "user",
642
+ content: {
643
+ type: "text",
644
+ text: [
645
+ "Create a New Order Single FIX message with the following parameters:",
646
+ `- ClOrdID: ${clOrdID}`,
647
+ `- HandlInst: ${handlInst ?? "3"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '1' for Manual, '2' for Automated, '3' for AutomatedNoIntervention)`,
648
+ `- Quantity: ${quantity}`,
649
+ `- Price: ${price}`,
650
+ `- OrdType: ${ordType ?? "1"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '1' for Market, '2' for Limit, '3' for Stop)`,
651
+ `- Side: ${side} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '1' for Buy, '2' for Sell)`,
652
+ `- Symbol: ${symbol}`,
653
+ `- TimeInForce: ${timeInForce ?? "0"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '0' for Day, '1' for Good Till Cancel, '2' for At Opening, '3' for Immediate or Cancel, '4' for Fill or Kill, '5' for Good Till Crossing, '6' for Good Till Date)`,
654
+ "",
655
+ "Format the response as a JSON object with FIX tag numbers as keys and their corresponding values.",
656
+ "",
657
+ 'Note: For the Side parameter, always use the numeric/alphabetic value (e.g., "1" for Buy, "2" for Sell) as defined in the FIX protocol, not the descriptive name.',
658
+ 'Note: For the HandlInst parameter, always use the numeric/alphabetic value (e.g., "1" for Manual, "2" for Automated, "3" for AutomatedNoIntervention) as defined in the FIX protocol, not the descriptive name.',
659
+ 'Note: For the OrdType parameter, always use the numeric/alphabetic value (e.g., "1" for Market, "2" for Limit, "3" for Stop) as defined in the FIX protocol, not the descriptive name.',
660
+ 'Note: For the TimeInForce parameter, always use the numeric/alphabetic value (e.g., "0" for Day, "1" for Good Till Cancel, "2" for At Opening) as defined in the FIX protocol, not the descriptive name.'
661
+ ].join("\n")
662
+ }
663
+ }
664
+ ]
665
+ };
666
+ }
667
+ case "marketDataRequest": {
668
+ const { mdUpdateType, symbol, mdReqID, subscriptionRequestType, mdEntryType } = args || {};
669
+ return {
670
+ messages: [
671
+ {
672
+ role: "user",
673
+ content: {
674
+ type: "text",
675
+ text: [
676
+ "Create a Market Data Request FIX message with the following parameters:",
677
+ `- MDUpdateType: ${mdUpdateType ?? "0"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '0' for FullRefresh, '1' for IncrementalRefresh)`,
678
+ `- Symbol: ${symbol}`,
679
+ `- MDReqID: ${mdReqID}`,
680
+ `- SubscriptionRequestType: ${subscriptionRequestType ?? "0"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '0' for Snapshot + Updates, '1' for Snapshot, '2' for Unsubscribe)`,
681
+ `- MDEntryType: ${mdEntryType ?? "0"} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '0' for Bid, '1' for Offer, '2' for Trade, '3' for Index Value, '4' for Opening Price)`,
682
+ "",
683
+ "Format the response as a JSON object with FIX tag numbers as keys and their corresponding values.",
684
+ "",
685
+ 'Note: For the MDUpdateType parameter, always use the numeric/alphabetic value (e.g., "0" for FullRefresh, "1" for IncrementalRefresh) as defined in the FIX protocol, not the descriptive name.',
686
+ 'Note: For the SubscriptionRequestType parameter, always use the numeric/alphabetic value (e.g., "0" for Snapshot + Updates, "1" for Snapshot, "2" for Unsubscribe) as defined in the FIX protocol, not the descriptive name.',
687
+ 'Note: For the MDEntryType parameter, always use the numeric/alphabetic value (e.g., "0" for Bid, "1" for Offer, "2" for Trade, "3" for Index Value, "4" for Opening Price) as defined in the FIX protocol, not the descriptive name.'
688
+ ].join("\n")
689
+ }
690
+ }
691
+ ]
692
+ };
693
+ }
694
+ default:
695
+ throw new Error(`Unknown prompt: ${name}`);
696
+ }
697
+ });
698
+ process.on("SIGINT", async () => {
699
+ await this.server.close();
700
+ process.exit(0);
701
+ });
702
+ }
703
+ };
704
+ export {
705
+ MCPLocal
706
+ };
707
+ //# sourceMappingURL=MCPLocal.mjs.map