fixparser-plugin-mcp 9.1.7-a24bdbec → 9.1.7-a9d84740

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../examples/example_mcp_local.ts", "../../src/MCPLocal.ts"],
4
- "sourcesContent": ["import {\n EncryptMethod,\n FIXParser,\n Field,\n Fields,\n LicenseManager,\n type Message,\n Messages,\n type Options,\n ResetSeqNumFlag,\n} from 'fixparser';\nimport { MCPLocal } from 'fixparser-plugin-mcp';\n\nconst SENDER = 'CLIENT2';\nconst TARGET = 'EXECUTOR';\n\nconst initializeServer = async () => {\n await LicenseManager.setLicenseKey(process.env.FIXPARSER_LICENSE_KEY);\n\n const fixParser: FIXParser = new FIXParser({\n logging: false,\n // logOptions: {\n // name: SENDER,\n // level: 'info',\n // format: 'jsonrpc',\n // transport: new ConsoleLogTransport({ format: 'jsonrpc' }),\n // },\n plugins: [new MCPLocal({ port: 3099, onReady: () => {} })],\n });\n\n const sendLogon = () => {\n const logon = fixParser.createMessage(\n new Field(Fields.MsgType, Messages.Logon),\n new Field(Fields.MsgSeqNum, fixParser.getNextTargetMsgSeqNum()),\n new Field(Fields.SenderCompID, SENDER),\n new Field(Fields.SendingTime, fixParser.getTimestamp()),\n new Field(Fields.TargetCompID, TARGET),\n new Field(Fields.ResetSeqNumFlag, ResetSeqNumFlag.Yes),\n new Field(Fields.EncryptMethod, EncryptMethod.None),\n new Field(Fields.HeartBtInt, 10),\n );\n fixParser.send(logon);\n };\n\n const CONNECT_PARAMS: Options = {\n host: process.env.FIXPARSER_HOST || '10.0.1.42',\n port: process.env.FIXPARSER_PORT ? Number.parseInt(process.env.FIXPARSER_PORT, 10) : 5001,\n protocol: 'tcp',\n sender: process.env.FIXPARSER_SENDER || SENDER,\n target: process.env.FIXPARSER_TARGET || TARGET,\n fixVersion: process.env.FIXPARSER_TARGET || 'FIX.4.4',\n onOpen: () => {\n sendLogon();\n },\n onMessage: (message: Message) => {},\n onClose: () => {\n // console.log(\n // JSON.stringify(\n // {\n // event: 'FIX Connection closed',\n // action: 'Attempting to reconnect in 1 second',\n // },\n // null,\n // 2,\n // ),\n // );\n setTimeout(() => {\n // console.log(\n // JSON.stringify(\n // {\n // event: 'Reconnecting',\n // },\n // null,\n // 2,\n // ),\n // );\n fixParser.connect(CONNECT_PARAMS);\n }, 1000);\n },\n };\n\n fixParser.connect(CONNECT_PARAMS);\n};\n\ninitializeServer().catch((err) => console.error('Error initializing server:', err));\n", "import { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport {\n CallToolRequestSchema,\n GetPromptRequestSchema,\n ListPromptsRequestSchema,\n ListResourcesRequestSchema,\n ListToolsRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\n\nimport { Field, Fields, type IFIXParser, type Message, Messages } from 'fixparser';\nimport type { IPlugin } from 'fixparser-common';\nimport type { PluginOptions } from './PluginOptions';\n\n// Define JSON Schemas\nconst parseInputSchema = {\n type: 'object',\n properties: {\n fixString: {\n type: 'string',\n description: 'FIX message string to parse',\n },\n },\n required: ['fixString'],\n};\n\nconst parseToJSONInputSchema = {\n type: 'object',\n properties: {\n fixString: {\n type: 'string',\n description: 'FIX message string to parse',\n },\n },\n required: ['fixString'],\n};\n\nconst newOrderSingleInputSchema = {\n type: 'object',\n properties: {\n clOrdID: {\n type: 'string',\n description: 'Client Order ID',\n },\n handlInst: {\n type: 'string',\n enum: ['1', '2', '3'],\n description:\n 'Handling instruction (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use \"1\" for Manual, \"2\" for Automated, \"3\" for AutomatedNoIntervention)',\n },\n quantity: {\n type: 'number',\n description: 'Order quantity',\n },\n price: {\n type: 'number',\n description: 'Order price',\n },\n ordType: {\n type: 'string',\n enum: [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'P',\n 'Q',\n 'R',\n 'S',\n ],\n description:\n 'Order type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use \"1\" for Market, \"2\" for Limit, \"3\" for Stop)',\n },\n side: {\n type: 'string',\n enum: ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],\n description:\n '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)',\n },\n symbol: {\n type: 'string',\n description: 'Trading symbol',\n },\n timeInForce: {\n type: 'string',\n enum: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'],\n description:\n '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)',\n },\n },\n required: ['clOrdID', 'quantity', 'price', 'side', 'symbol', 'handlInst', 'ordType', 'timeInForce'],\n};\n\nconst marketDataRequestInputSchema = {\n type: 'object',\n properties: {\n mdUpdateType: {\n type: 'string',\n enum: ['0', '1'],\n description:\n 'Market data update type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use \"0\" for FullRefresh, \"1\" for IncrementalRefresh)',\n },\n symbol: {\n type: 'string',\n description: 'Trading symbol',\n },\n mdReqID: {\n type: 'string',\n description: 'Market data request ID',\n },\n subscriptionRequestType: {\n type: 'string',\n enum: ['0', '1', '2'],\n description:\n '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)',\n },\n mdEntryType: {\n type: 'string',\n enum: [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'J',\n 'K',\n 'L',\n 'M',\n 'N',\n 'O',\n 'P',\n 'Q',\n 'S',\n 'R',\n 'T',\n 'U',\n 'V',\n 'W',\n 'X',\n 'Y',\n 'Z',\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'g',\n 'h',\n 'i',\n 't',\n ],\n description:\n '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)',\n },\n },\n required: ['symbol', 'mdReqID'],\n};\n\nexport class MCPLocal implements IPlugin<IFIXParser> {\n // private logger: Logger | undefined;\n private parser: IFIXParser | undefined;\n private server: Server = new Server(\n {\n name: 'fixparser',\n version: '1.0.0',\n },\n {\n capabilities: {\n tools: {},\n prompts: {},\n resources: {},\n },\n },\n );\n private transport: StdioServerTransport = new StdioServerTransport();\n private onReady: (() => void) | undefined = undefined;\n\n private pendingRequests: Map<string, (data: Message) => void> = new Map();\n\n constructor({ logger, onReady }: PluginOptions) {\n if (onReady) this.onReady = onReady;\n }\n\n public async register(parser: IFIXParser): Promise<void> {\n this.parser = parser;\n this.parser.addOnMessageCallback((message: Message) => {\n // this.logger?.log({\n // level: 'info',\n // message: `FIXParser (MCP): (${parser.protocol?.toUpperCase()}): << received ${message.description}`,\n // });\n const msgType = message.messageType;\n if (\n msgType === Messages.MarketDataSnapshotFullRefresh ||\n msgType === Messages.ExecutionReport ||\n msgType === Messages.Reject\n ) {\n const idField =\n msgType === Messages.MarketDataSnapshotFullRefresh\n ? message.getField(Fields.MDReqID)\n : msgType === Messages.Reject\n ? message.getField(Fields.RefSeqNum)\n : message.getField(Fields.ClOrdID);\n if (idField) {\n const id = idField.value;\n if (typeof id === 'string' || typeof id === 'number') {\n // For Reject messages, check if it's related to a New Order Single\n if (msgType === Messages.Reject) {\n const refMsgType = message.getField(Fields.RefMsgType);\n if (refMsgType && refMsgType.value === Messages.NewOrderSingle) {\n const callback = this.pendingRequests.get(String(id));\n if (callback) {\n callback(message);\n this.pendingRequests.delete(String(id));\n }\n }\n } else {\n const callback = this.pendingRequests.get(String(id));\n if (callback) {\n callback(message);\n this.pendingRequests.delete(String(id));\n }\n }\n }\n }\n }\n });\n\n this.addWorkflows();\n\n await this.server.connect(this.transport);\n\n if (this.onReady) {\n this.onReady();\n }\n }\n\n private addWorkflows() {\n if (!this.parser) {\n // this.logger?.log({\n // level: 'error',\n // message: 'FIXParser (MCP): -- FIXParser instance not initialized. Ignoring setup of workflows...',\n // });\n return;\n }\n\n if (!this.server) {\n // this.logger?.log({\n // level: 'error',\n // message: 'FIXParser (MCP): -- MCP Server not initialized. Ignoring setup of workflows...',\n // });\n return;\n }\n\n // Helper function to validate and parse arguments\n const validateArgs = (args: any, schema: any): any => {\n // Basic validation - in a real implementation, you might want to use a proper JSON Schema validator\n const result: any = {};\n\n for (const [key, propSchema] of Object.entries(schema.properties || {})) {\n const prop = propSchema as any;\n const value = args?.[key];\n\n if (prop.required && (value === undefined || value === null)) {\n throw new Error(`Required property '${key}' is missing`);\n }\n\n if (value !== undefined) {\n // Apply defaults\n result[key] = value;\n } else if (prop.default !== undefined) {\n result[key] = prop.default;\n }\n }\n\n return result;\n };\n\n // Empty handler for resources\n this.server.setRequestHandler(ListResourcesRequestSchema, async () => {\n return {\n resources: [],\n };\n });\n\n // Handler for listing available tools\n this.server.setRequestHandler(ListToolsRequestSchema, async () => {\n return {\n tools: [\n {\n name: 'parse',\n description: 'Parses a FIX message and describes it in plain language',\n inputSchema: parseInputSchema,\n },\n {\n name: 'parseToJSON',\n description: 'Parses a FIX message into JSON',\n inputSchema: parseToJSONInputSchema,\n },\n {\n name: 'newOrderSingle',\n description: 'Creates and sends a New Order Single',\n inputSchema: newOrderSingleInputSchema,\n },\n {\n name: 'marketDataRequest',\n description: 'Sends a request for Market Data with the given symbol',\n inputSchema: marketDataRequestInputSchema,\n },\n ],\n };\n });\n\n // Handler for tool calls\n this.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n\n switch (name) {\n case 'parse': {\n try {\n const { fixString } = validateArgs(args, parseInputSchema);\n const parsedMessage: Message[] | undefined = this.parser?.parse(fixString);\n if (!parsedMessage || parsedMessage.length === 0) {\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: Failed to parse FIX string' }],\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `${parsedMessage[0].description}\n${parsedMessage[0].messageTypeDescription}`,\n },\n ],\n };\n } catch (error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to parse FIX string'}`,\n },\n ],\n };\n }\n }\n\n case 'parseToJSON': {\n try {\n const { fixString } = validateArgs(args, parseToJSONInputSchema);\n const parsedMessage = this.parser?.parse(fixString);\n if (!parsedMessage || parsedMessage.length === 0) {\n return {\n isError: true,\n content: [{ type: 'text', text: 'Error: Failed to parse FIX string' }],\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `${parsedMessage[0].toFIXJSON()}`,\n },\n ],\n };\n } catch (error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to parse FIX string'}`,\n },\n ],\n };\n }\n }\n\n case 'newOrderSingle': {\n try {\n const { clOrdID, handlInst, quantity, price, ordType, side, symbol, timeInForce } =\n validateArgs(args, newOrderSingleInputSchema);\n\n const response = new Promise((resolve) => {\n this.pendingRequests.set(clOrdID, resolve);\n });\n\n const order: Message | undefined = this.parser?.createMessage(\n new Field(Fields.MsgType, Messages.NewOrderSingle),\n new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),\n new Field(Fields.SenderCompID, this.parser?.sender),\n new Field(Fields.TargetCompID, this.parser?.target),\n new Field(Fields.SendingTime, this.parser?.getTimestamp()),\n new Field(Fields.ClOrdID, clOrdID),\n new Field(Fields.Side, side),\n new Field(Fields.Symbol, symbol),\n new Field(Fields.OrderQty, quantity),\n new Field(Fields.Price, price),\n new Field(Fields.OrdType, ordType),\n new Field(Fields.HandlInst, handlInst),\n new Field(Fields.TimeInForce, timeInForce),\n new Field(Fields.TransactTime, this.parser?.getTimestamp()),\n );\n\n if (!this.parser?.connected) {\n // this.logger?.log({\n // level: 'error',\n // message: 'FIXParser (MCP): -- Not connected. Ignoring message.',\n // });\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: 'Error: Not connected. Ignoring message.',\n },\n ],\n };\n }\n\n this.parser?.send(order!);\n // this.logger?.log({\n // level: 'info',\n // message: `FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${order?.description}`,\n // });\n\n const fixData = await response;\n\n return {\n content: [\n {\n type: 'text',\n text:\n (fixData as Message).messageType === Messages.Reject\n ? `Reject message for order ${clOrdID}: ${JSON.stringify((fixData as Message).toFIXJSON())}`\n : `Execution Report for order ${clOrdID}: ${JSON.stringify((fixData as Message).toFIXJSON())}`,\n },\n ],\n };\n } catch (error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to create order'}`,\n },\n ],\n };\n }\n }\n\n case 'marketDataRequest': {\n try {\n const { mdUpdateType, symbol, mdReqID, subscriptionRequestType, mdEntryType } = validateArgs(\n args,\n marketDataRequestInputSchema,\n );\n\n const response = new Promise((resolve) => {\n this.pendingRequests.set(mdReqID, resolve);\n });\n\n const marketDataRequest = this.parser?.createMessage(\n new Field(Fields.MsgType, Messages.MarketDataRequest),\n new Field(Fields.SenderCompID, this.parser?.sender),\n new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),\n new Field(Fields.TargetCompID, this.parser?.target),\n new Field(Fields.SendingTime, this.parser?.getTimestamp()),\n new Field(Fields.MarketDepth, 0),\n new Field(Fields.MDUpdateType, mdUpdateType),\n new Field(Fields.NoRelatedSym, 1),\n new Field(Fields.Symbol, symbol),\n new Field(Fields.MDReqID, mdReqID),\n new Field(Fields.SubscriptionRequestType, subscriptionRequestType),\n new Field(Fields.NoMDEntryTypes, 1),\n new Field(Fields.MDEntryType, mdEntryType),\n );\n\n if (!this.parser?.connected) {\n // this.logger?.log({\n // level: 'error',\n // message: 'FIXParser (MCP): -- Not connected. Ignoring message.',\n // });\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: 'Error: Not connected. Ignoring message.',\n },\n ],\n };\n }\n\n this.parser?.send(marketDataRequest!);\n // this.logger?.log({\n // level: 'info',\n // message: `FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${marketDataRequest?.description}`,\n // });\n\n const fixData = await response;\n\n return {\n content: [\n {\n type: 'text',\n text: `Market data for ${symbol}: ${JSON.stringify((fixData as Message).toFIXJSON())}`,\n },\n ],\n };\n } catch (error) {\n return {\n isError: true,\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to request market data'}`,\n },\n ],\n };\n }\n }\n\n default:\n throw new Error(`Unknown tool: ${name}`);\n }\n });\n\n this.server.setRequestHandler(ListPromptsRequestSchema, async () => {\n return {\n prompts: [\n {\n name: 'parse',\n description: 'Parses a FIX message and describes it in plain language',\n arguments: [\n {\n name: 'fixString',\n description: 'FIX message string to parse',\n required: true,\n },\n ],\n },\n {\n name: 'parseToJSON',\n description: 'Parses a FIX message into JSON',\n arguments: [\n {\n name: 'fixString',\n description: 'FIX message string to parse',\n required: true,\n },\n ],\n },\n {\n name: 'newOrderSingle',\n description:\n 'Creates and sends a New Order Single. IMPORTANT: All parameters must be explicitly provided by the user - no assumptions will be made.',\n arguments: [\n {\n name: 'clOrdID',\n description: 'Client Order ID',\n required: true,\n },\n {\n name: 'handlInst',\n description: 'Handling instruction (1=Manual, 2=Automated, 3=AutomatedNoIntervention)',\n required: true,\n },\n {\n name: 'quantity',\n description: 'Order quantity',\n required: true,\n },\n {\n name: 'price',\n description: 'Order price',\n required: true,\n },\n {\n name: 'ordType',\n description: 'Order type (1=Market, 2=Limit, 3=Stop)',\n required: true,\n },\n {\n name: 'side',\n description:\n '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)',\n required: true,\n },\n {\n name: 'symbol',\n description: 'Trading symbol',\n required: true,\n },\n {\n name: 'timeInForce',\n description:\n 'Time in force (0=Day, 1=Good Till Cancel, 2=At Opening, 3=Immediate or Cancel, 4=Fill or Kill, 5=Good Till Crossing, 6=Good Till Date)',\n required: true,\n },\n ],\n },\n {\n name: 'marketDataRequest',\n description:\n 'Sends a request for Market Data with the given symbol. IMPORTANT: All parameters must be explicitly provided by the user - no assumptions will be made.',\n arguments: [\n {\n name: 'mdUpdateType',\n description: 'Market data update type (0=FullRefresh, 1=IncrementalRefresh)',\n required: true,\n },\n {\n name: 'symbol',\n description: 'Trading symbol',\n required: true,\n },\n {\n name: 'mdReqID',\n description: 'Market data request ID',\n required: true,\n },\n {\n name: 'subscriptionRequestType',\n description:\n 'Subscription request type (0=Snapshot + Updates, 1=Snapshot, 2=Unsubscribe)',\n required: true,\n },\n {\n name: 'mdEntryType',\n description:\n 'Market data entry type (0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price)',\n required: true,\n },\n ],\n },\n ],\n };\n });\n\n // Handler for getting specific prompts\n this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n\n switch (name) {\n case 'parse': {\n const fixString = args?.fixString || '';\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Please parse and explain this FIX message: ${fixString}`,\n },\n },\n ],\n };\n }\n\n case 'parseToJSON': {\n const fixString = args?.fixString || '';\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Please parse the FIX message to JSON: ${fixString}`,\n },\n },\n ],\n };\n }\n\n case 'newOrderSingle': {\n const { clOrdID, handlInst, quantity, price, ordType, side, symbol, timeInForce } = args || {};\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: [\n 'Create a New Order Single FIX message with the following parameters:',\n `- ClOrdID: ${clOrdID}`,\n `- 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)`,\n `- Quantity: ${quantity}`,\n `- Price: ${price}`,\n `- 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)`,\n `- Side: ${side} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '1' for Buy, '2' for Sell)`,\n `- Symbol: ${symbol}`,\n `- 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)`,\n '',\n '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.',\n '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.',\n '',\n 'IMPORTANT: All parameters must be set before sending the order. Missing or invalid parameters will result in a Reject message.',\n '',\n 'IMPORTANT: The response will be either:',\n '1. An Execution Report (MsgType=8) if the order was successfully placed',\n '2. A Reject message (MsgType=3) if the order failed to execute (e.g., due to missing or invalid parameters)',\n ].join('\\n'),\n },\n },\n ],\n };\n }\n\n case 'marketDataRequest': {\n const { mdUpdateType, symbol, mdReqID, subscriptionRequestType, mdEntryType } = args || {};\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: [\n 'Create a Market Data Request FIX message with the following parameters:',\n `- MDUpdateType: ${mdUpdateType ?? '0'} (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use '0' for FullRefresh, '1' for IncrementalRefresh)`,\n `- Symbol: ${symbol}`,\n `- MDReqID: ${mdReqID}`,\n `- 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)`,\n `- 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)`,\n '',\n 'Format the response as a JSON object with FIX tag numbers as keys and their corresponding values.',\n '',\n '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.',\n '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.',\n '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.',\n ].join('\\n'),\n },\n },\n ],\n };\n }\n\n default:\n throw new Error(`Unknown prompt: ${name}`);\n }\n });\n\n process.on('SIGINT', async () => {\n await this.server.close();\n process.exit(0);\n });\n }\n}\n"],
5
- "mappings": ";AAAA,OACI,iBAAAA,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EACA,kBAAAC,EAEA,YAAAC,EAEA,mBAAAC,MACG,YCVP,OAAS,UAAAC,MAAc,4CACvB,OAAS,wBAAAC,MAA4B,4CACrC,OACI,yBAAAC,EACA,0BAAAC,EACA,4BAAAC,EACA,8BAAAC,EACA,0BAAAC,MACG,qCAEP,OAAS,SAAAC,EAAO,UAAAC,EAAuC,YAAAC,MAAgB,YAKvE,IAAMC,EAAmB,CACrB,KAAM,SACN,WAAY,CACR,UAAW,CACP,KAAM,SACN,YAAa,6BACjB,CACJ,EACA,SAAU,CAAC,WAAW,CAC1B,EAEMC,EAAyB,CAC3B,KAAM,SACN,WAAY,CACR,UAAW,CACP,KAAM,SACN,YAAa,6BACjB,CACJ,EACA,SAAU,CAAC,WAAW,CAC1B,EAEMC,EAA4B,CAC9B,KAAM,SACN,WAAY,CACR,QAAS,CACL,KAAM,SACN,YAAa,iBACjB,EACA,UAAW,CACP,KAAM,SACN,KAAM,CAAC,IAAK,IAAK,GAAG,EACpB,YACI,mLACR,EACA,SAAU,CACN,KAAM,SACN,YAAa,gBACjB,EACA,MAAO,CACH,KAAM,SACN,YAAa,aACjB,EACA,QAAS,CACL,KAAM,SACN,KAAM,CACF,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACJ,EACA,YACI,kJACR,EACA,KAAM,CACF,KAAM,SACN,KAAM,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EAC1F,YACI,iaACR,EACA,OAAQ,CACJ,KAAM,SACN,YAAa,gBACjB,EACA,YAAa,CACT,KAAM,SACN,KAAM,CAAC,IAAK,IAAK,IAAK,IAA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,EAAMC,EAAO,WAAY,EAAE,CACnC,EACAN,EAAU,KAAKI,CAAK,CACxB,EAEMM,EAA0B,CAC5B,KAAM,QAAQ,IAAI,gBAAkB,YACpC,KAAM,QAAQ,IAAI,eAAiB,OAAO,SAAS,QAAQ,IAAI,eAAgB,EAAE,EAAI,KACrF,SAAU,MACV,OAAQ,QAAQ,IAAI,kBAAoBd,EACxC,OAAQ,QAAQ,IAAI,kBAAoBC,EACxC,WAAY,QAAQ,IAAI,kBAAoB,UAC5C,OAAQ,IAAM,CACVM,EAAU,CACd,EACA,UAAYQ,GAAqB,CAAC,EAClC,QAAS,IAAM,CAWX,WAAW,IAAM,CAUbX,EAAU,QAAQU,CAAc,CACpC,EAAG,GAAI,CACX,CACJ,EAEAV,EAAU,QAAQU,CAAc,CACpC,EAEAZ,EAAiB,EAAE,MAAOc,GAAQ,QAAQ,MAAM,6BAA8BA,CAAG,CAAC",
6
- "names": ["EncryptMethod", "FIXParser", "Field", "Fields", "LicenseManager", "Messages", "ResetSeqNumFlag", "Server", "StdioServerTransport", "CallToolRequestSchema", "GetPromptRequestSchema", "ListPromptsRequestSchema", "ListResourcesRequestSchema", "ListToolsRequestSchema", "Field", "Fields", "Messages", "parseInputSchema", "parseToJSONInputSchema", "newOrderSingleInputSchema", "marketDataRequestInputSchema", "MCPLocal", "logger", "onReady", "parser", "message", "msgType", "idField", "id", "refMsgType", "callback", "validateArgs", "args", "schema", "result", "key", "propSchema", "prop", "value", "request", "name", "fixString", "parsedMessage", "error", "clOrdID", "handlInst", "quantity", "price", "ordType", "side", "symbol", "timeInForce", "response", "resolve", "order", "fixData", "mdUpdateType", "mdReqID", "subscriptionRequestType", "mdEntryType", "marketDataRequest", "SENDER", "TARGET", "initializeServer", "LicenseManager", "fixParser", "FIXParser", "MCPLocal", "sendLogon", "logon", "Field", "Fields", "Messages", "ResetSeqNumFlag", "EncryptMethod", "CONNECT_PARAMS", "message", "err"]
3
+ "sources": ["../../examples/example_mcp_local.ts", "../../node_modules/fixparser-plugin-log-console/src/ConsoleLogTransport.ts", "../../src/MCPLocal.ts"],
4
+ "sourcesContent": ["import {\n EncryptMethod,\n FIXParser,\n Field,\n Fields,\n LicenseManager,\n Messages,\n type Options,\n ResetSeqNumFlag,\n} from 'fixparser';\nimport { ConsoleLogTransport } from 'fixparser-plugin-log-console';\nimport { MCPLocal } from 'fixparser-plugin-mcp';\n\nconst initializeServer = async () => {\n await LicenseManager.setLicenseKey(process.env.FIXPARSER_LICENSE_KEY);\n const SENDER = process.env.FIXPARSER_SENDER || 'SENDER';\n const TARGET = process.env.FIXPARSER_TARGET || 'TARGET';\n\n const fixParser: FIXParser = new FIXParser({\n logging: true,\n logOptions: {\n level: 'info',\n format: 'jsonrpc',\n transport: new ConsoleLogTransport({ format: 'jsonrpc' }),\n },\n plugins: [new MCPLocal({ port: 3099, onReady: () => {} })],\n });\n\n const sendLogon = () => {\n const logon = fixParser.createMessage(\n new Field(Fields.MsgType, Messages.Logon),\n new Field(Fields.MsgSeqNum, fixParser.getNextTargetMsgSeqNum()),\n new Field(Fields.SenderCompID, SENDER),\n new Field(Fields.SendingTime, fixParser.getTimestamp()),\n new Field(Fields.TargetCompID, TARGET),\n new Field(Fields.ResetSeqNumFlag, ResetSeqNumFlag.Yes),\n new Field(Fields.EncryptMethod, EncryptMethod.None),\n new Field(Fields.HeartBtInt, 10),\n );\n fixParser.send(logon);\n };\n\n const CONNECT_PARAMS: Options = {\n host: process.env.FIXPARSER_HOST || '10.0.1.42',\n port: process.env.FIXPARSER_PORT ? Number.parseInt(process.env.FIXPARSER_PORT, 10) : 5001,\n protocol: 'tcp',\n sender: SENDER,\n target: TARGET,\n fixVersion: 'FIX.4.4',\n onOpen: () => {\n fixParser.logger.log({\n level: 'info',\n message: 'FIXParser logging in...',\n });\n sendLogon();\n },\n onClose: () => {\n fixParser.logger.log({\n level: 'info',\n message: 'FIXParser disconnected. Reconnecting in 1 second...',\n });\n setTimeout(() => {\n fixParser.connect(CONNECT_PARAMS);\n }, 1000);\n },\n };\n\n fixParser.connect(CONNECT_PARAMS);\n};\n\ninitializeServer().catch((err) => console.error('Error initializing server:', err));\n", "import type { ILogTransporter, LogMessage } from 'fixparser-common';\n\n/**\n * Logger output format options.\n *\n * - 'console': Output log in plain text format\n * - 'json': Output log in JSON format\n * - 'jsonrpc': Output log in JSON-RPC 2.0 format\n *\n * @public\n */\nexport type ConsoleFormat = 'console' | 'json' | 'jsonrpc';\n\n/**\n * A LogTransporter implementation for logging to the console.\n * It supports text (console), JSON, and JSON-RPC 2.0 formats.\n */\nexport class ConsoleLogTransport implements ILogTransporter {\n private format: ConsoleFormat;\n\n constructor({ format = 'json' }: { format: ConsoleFormat }) {\n this.format = format;\n }\n\n /**\n * Configures the format for console logging (either 'console' for text, 'json', or 'jsonrpc').\n */\n configure(config: { format: 'console' | 'json' | 'jsonrpc' }): void {\n this.format = config.format || 'json';\n }\n\n /**\n * Sends the log message to the console in the configured format.\n */\n async send(log: LogMessage): Promise<void> {\n if (this.format === 'json') {\n console.log(JSON.stringify(log));\n } else if (this.format === 'jsonrpc') {\n const { message, ...rest } = log;\n const jsonrpcMessage = {\n jsonrpc: '2.0',\n method: log.level,\n params: {\n message,\n ...rest,\n },\n id: log.id || Date.now(),\n };\n console.log(JSON.stringify(jsonrpcMessage));\n } else {\n const { name, id, message, level, ...additionalProperties } = log;\n const kv = Object.entries(additionalProperties).map(([key, value]) => `${key}: ${value}`);\n let logMessage = '';\n if (name) {\n logMessage += `${name} `;\n }\n logMessage += `${id}: ${message}`;\n void kv;\n console.log(logMessage, kv.join(', '));\n }\n }\n\n /**\n * Flushes the log buffer (if any buffering mechanism exists).\n */\n async flush(): Promise<void> {\n // No flushing needed for console transport\n }\n\n /**\n * Closes the transport (not needed for console, but keeping the method for consistency).\n */\n async close(): Promise<void> {\n // No close logic needed for console transport\n }\n\n /**\n * Returns the status of the transport (always \"connected\" for console).\n */\n status(): string {\n return 'connected';\n }\n}\n", "import { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport type { Request } from '@modelcontextprotocol/sdk/types.js';\nimport { Field, Fields, type IFIXParser, type Message, Messages } from 'fixparser';\nimport type { IPlugin } from 'fixparser-common';\nimport { z } from 'zod';\nimport type { PluginOptions } from './PluginOptions';\n\nexport class MCPLocal implements IPlugin<IFIXParser> {\n private parser: IFIXParser | undefined;\n private server: Server = new Server(\n {\n name: 'fixparser',\n version: '1.0.0',\n },\n {\n capabilities: {\n tools: {\n parse: {\n description: 'Parses a FIX message and describes it in plain language',\n parameters: {\n type: 'object',\n properties: {\n fixString: { type: 'string' },\n },\n required: ['fixString'],\n },\n },\n parseToJSON: {\n description: 'Parses a FIX message into JSON',\n parameters: {\n type: 'object',\n properties: {\n fixString: { type: 'string' },\n },\n required: ['fixString'],\n },\n },\n verifyOrder: {\n description: 'Verifies order parameters before execution',\n parameters: {\n type: 'object',\n properties: {\n clOrdID: { type: 'string' },\n handlInst: { type: 'string', enum: ['1', '2', '3'] },\n quantity: { type: 'string' },\n price: { type: 'string' },\n ordType: {\n type: 'string',\n enum: [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'P',\n 'Q',\n 'R',\n 'S',\n ],\n },\n side: {\n type: 'string',\n enum: [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n ],\n },\n symbol: { type: 'string' },\n timeInForce: {\n type: 'string',\n enum: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'],\n },\n },\n required: [\n 'clOrdID',\n 'handlInst',\n 'quantity',\n 'price',\n 'ordType',\n 'side',\n 'symbol',\n 'timeInForce',\n ],\n },\n },\n executeOrder: {\n description: 'Executes a verified order',\n parameters: {\n type: 'object',\n properties: {\n clOrdID: { type: 'string' },\n handlInst: { type: 'string', enum: ['1', '2', '3'] },\n quantity: { type: 'string' },\n price: { type: 'string' },\n ordType: { type: 'string' },\n side: { type: 'string' },\n symbol: { type: 'string' },\n timeInForce: { type: 'string' },\n },\n required: [\n 'clOrdID',\n 'handlInst',\n 'quantity',\n 'price',\n 'ordType',\n 'side',\n 'symbol',\n 'timeInForce',\n ],\n },\n },\n marketDataRequest: {\n description: 'Requests market data for specified symbols',\n parameters: {\n type: 'object',\n properties: {\n mdUpdateType: { type: 'string', enum: ['0', '1'] },\n symbols: { type: 'array', items: { type: 'string' } },\n mdReqID: { type: 'string' },\n subscriptionRequestType: { type: 'string', enum: ['0', '1', '2'] },\n mdEntryTypes: { type: 'array', items: { type: 'string' } },\n },\n required: ['mdUpdateType', 'symbols', 'mdReqID', 'subscriptionRequestType', 'mdEntryTypes'],\n },\n },\n },\n resources: {\n greeting: {\n description: 'A simple greeting resource',\n uri: 'greeting-resource',\n },\n stockGraph: {\n description: 'Generates a price chart for a given symbol',\n uri: 'stockGraph/{symbol}',\n },\n stockPriceHistory: {\n description: 'Returns price history for a given symbol',\n uri: 'stockPriceHistory/{symbol}',\n },\n },\n },\n },\n );\n private transport: StdioServerTransport = new StdioServerTransport();\n private onReady: (() => void) | undefined = undefined;\n\n private pendingRequests: Map<string, (data: Message) => void> = new Map();\n private verifiedOrders: Map<\n string,\n {\n clOrdID: string;\n handlInst: string;\n quantity: number;\n price: number;\n ordType: string;\n side: string;\n symbol: string;\n timeInForce: string;\n }\n > = new Map();\n\n // Store market data prices with timestamps\n private marketDataPrices: Map<string, Array<{ timestamp: number; price: number }>> = new Map();\n private readonly MAX_PRICE_HISTORY = 100000; // Maximum number of price points to store per symbol\n\n constructor({ logger, onReady }: PluginOptions) {\n if (onReady) this.onReady = onReady;\n }\n\n public async register(parser: IFIXParser): Promise<void> {\n this.parser = parser;\n this.parser.addOnMessageCallback((message: Message) => {\n this.parser?.logger.log({\n level: 'info',\n message: `MCP Server received message: ${message.messageType}: ${message.description}`,\n });\n const msgType = message.messageType;\n if (\n msgType === Messages.MarketDataSnapshotFullRefresh ||\n msgType === Messages.ExecutionReport ||\n msgType === Messages.Reject ||\n msgType === Messages.MarketDataIncrementalRefresh\n ) {\n this.parser?.logger.log({\n level: 'info',\n message: `MCP Server handling message type: ${msgType}`,\n });\n\n let id: string | undefined;\n\n // Handle market data messages\n if (\n msgType === Messages.MarketDataIncrementalRefresh ||\n msgType === Messages.MarketDataSnapshotFullRefresh\n ) {\n const symbol = message.getField(Fields.Symbol);\n const price = message.getField(Fields.MDEntryPx);\n const timestamp = message.getField(Fields.MDEntryTime)?.value || Date.now();\n\n if (symbol?.value && price?.value) {\n const symbolStr = String(symbol.value);\n const priceNum = Number(price.value);\n\n // Get or create price history array for this symbol\n const priceHistory = this.marketDataPrices.get(symbolStr) || [];\n\n // Add new price point\n priceHistory.push({\n timestamp: Number(timestamp),\n price: priceNum,\n });\n\n // Trim history if it exceeds maximum size\n if (priceHistory.length > this.MAX_PRICE_HISTORY) {\n priceHistory.shift(); // Remove oldest price\n }\n\n // Update the map\n this.marketDataPrices.set(symbolStr, priceHistory);\n\n this.parser?.logger.log({\n level: 'info',\n message: `MCP Server added ${symbol}: ${priceNum}`,\n });\n\n // Send notification about the new price\n this.server.notification({\n method: 'priceUpdate',\n params: {\n symbol: symbolStr,\n price: priceNum,\n timestamp: Number(timestamp),\n },\n });\n }\n }\n\n // Extract the appropriate ID based on message type\n if (msgType === Messages.MarketDataSnapshotFullRefresh) {\n const mdReqID = message.getField(Fields.MDReqID);\n if (mdReqID) id = String(mdReqID.value);\n } else if (msgType === Messages.ExecutionReport) {\n const clOrdID = message.getField(Fields.ClOrdID);\n if (clOrdID) id = String(clOrdID.value);\n } else if (msgType === Messages.Reject) {\n const refSeqNum = message.getField(Fields.RefSeqNum);\n if (refSeqNum) id = String(refSeqNum.value);\n }\n\n // If we have an ID and it matches a pending request, resolve it\n if (id) {\n const callback = this.pendingRequests.get(id);\n if (callback) {\n callback(message);\n this.pendingRequests.delete(id);\n }\n }\n }\n });\n\n this.addWorkflows();\n\n await this.server.connect(this.transport);\n\n if (this.onReady) {\n this.onReady();\n }\n }\n\n private addWorkflows() {\n if (!this.parser) {\n return;\n }\n\n if (!this.server) {\n return;\n }\n\n // Add handler for resources/list\n this.server.setRequestHandler(\n z.object({ method: z.literal('resources/list') }),\n async (request: Request, extra) => {\n return {\n resources: [\n {\n name: 'greeting',\n description: 'A simple greeting resource',\n uri: 'greeting-resource',\n },\n ],\n };\n },\n );\n\n // Add handler for resources/templates/list\n this.server.setRequestHandler(\n z.object({ method: z.literal('resources/templates/list') }),\n async (request: Request, extra) => {\n return {\n resourceTemplates: [\n {\n name: 'stockGraph',\n description: 'Generates a price chart for a given symbol',\n uriTemplate: 'stockGraph/{symbol}',\n parameters: {\n type: 'object',\n properties: {\n symbol: { type: 'string' },\n },\n required: ['symbol'],\n },\n },\n {\n name: 'stockPriceHistory',\n description: 'Returns price history for a given symbol',\n uriTemplate: 'stockPriceHistory/{symbol}',\n parameters: {\n type: 'object',\n properties: {\n symbol: { type: 'string' },\n },\n required: ['symbol'],\n },\n },\n ],\n };\n },\n );\n\n // Add handler for tools/list\n this.server.setRequestHandler(\n z.object({ method: z.literal('tools/list') }),\n async (request: Request, extra) => {\n return {\n tools: [\n {\n name: 'parse',\n description: 'Parses a FIX message and describes it in plain language',\n inputSchema: {\n type: 'object',\n properties: {\n fixString: { type: 'string' },\n },\n required: ['fixString'],\n },\n },\n {\n name: 'parseToJSON',\n description: 'Parses a FIX message into JSON',\n inputSchema: {\n type: 'object',\n properties: {\n fixString: { type: 'string' },\n },\n required: ['fixString'],\n },\n },\n {\n name: 'verifyOrder',\n description: 'Verifies order parameters before execution',\n inputSchema: {\n type: 'object',\n properties: {\n clOrdID: { type: 'string' },\n handlInst: { type: 'string', enum: ['1', '2', '3'] },\n quantity: { type: 'string' },\n price: { type: 'string' },\n ordType: {\n type: 'string',\n enum: [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'P',\n 'Q',\n 'R',\n 'S',\n ],\n },\n side: {\n type: 'string',\n enum: [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n ],\n },\n symbol: { type: 'string' },\n timeInForce: {\n type: 'string',\n enum: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'],\n },\n },\n required: [\n 'clOrdID',\n 'handlInst',\n 'quantity',\n 'price',\n 'ordType',\n 'side',\n 'symbol',\n 'timeInForce',\n ],\n },\n },\n {\n name: 'executeOrder',\n description: 'Executes a verified order',\n inputSchema: {\n type: 'object',\n properties: {\n clOrdID: { type: 'string' },\n handlInst: { type: 'string', enum: ['1', '2', '3'] },\n quantity: { type: 'string' },\n price: { type: 'string' },\n ordType: { type: 'string' },\n side: { type: 'string' },\n symbol: { type: 'string' },\n timeInForce: { type: 'string' },\n },\n required: [\n 'clOrdID',\n 'handlInst',\n 'quantity',\n 'price',\n 'ordType',\n 'side',\n 'symbol',\n 'timeInForce',\n ],\n },\n },\n {\n name: 'marketDataRequest',\n description: 'Requests market data for specified symbols',\n inputSchema: {\n type: 'object',\n properties: {\n mdUpdateType: { type: 'string', enum: ['0', '1'] },\n symbols: { type: 'array', items: { type: 'string' } },\n mdReqID: { type: 'string' },\n subscriptionRequestType: { type: 'string', enum: ['0', '1', '2'] },\n mdEntryTypes: { type: 'array', items: { type: 'string' } },\n },\n required: [\n 'mdUpdateType',\n 'symbols',\n 'mdReqID',\n 'subscriptionRequestType',\n 'mdEntryTypes',\n ],\n },\n },\n ],\n };\n },\n );\n\n // Add handler for tools/call\n this.server.setRequestHandler(\n z.object({\n method: z.literal('tools/call'),\n params: z.object({\n name: z.string(),\n arguments: z.any(),\n _meta: z.object({\n progressToken: z.number(),\n }),\n }),\n }),\n async (request: Request, extra) => {\n const { name, arguments: args } = request.params as { name: string; arguments: any };\n\n switch (name) {\n case 'parse':\n try {\n const parsedMessage: Message[] | undefined = this.parser?.parse(args.fixString);\n if (!parsedMessage || parsedMessage.length === 0) {\n return {\n contents: [\n {\n type: 'text',\n text: 'Error: Failed to parse FIX string',\n uri: 'parse',\n },\n ],\n isError: true,\n };\n }\n\n return {\n contents: [\n {\n type: 'text',\n text: `${parsedMessage[0].description}\\n${parsedMessage[0].messageTypeDescription}`,\n uri: 'parse',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to parse FIX string'}`,\n uri: 'parse',\n },\n ],\n isError: true,\n };\n }\n case 'parseToJSON':\n try {\n const parsedMessage = this.parser?.parse(args.fixString);\n if (!parsedMessage || parsedMessage.length === 0) {\n return {\n contents: [\n {\n type: 'text',\n text: 'Error: Failed to parse FIX string',\n uri: 'parseToJSON',\n },\n ],\n isError: true,\n };\n }\n\n return {\n contents: [\n {\n type: 'text',\n text: `${parsedMessage[0].toFIXJSON()}`,\n uri: 'parseToJSON',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to parse FIX string'}`,\n uri: 'parseToJSON',\n },\n ],\n isError: true,\n };\n }\n case 'verifyOrder':\n try {\n // Store the verified order parameters\n this.verifiedOrders.set(args.clOrdID, {\n clOrdID: args.clOrdID,\n handlInst: args.handlInst,\n quantity: Number.parseFloat(args.quantity),\n price: Number.parseFloat(args.price),\n ordType: args.ordType,\n side: args.side,\n symbol: args.symbol,\n timeInForce: args.timeInForce,\n });\n\n const ordTypeNames: Record<string, string> = {\n '1': 'Market',\n '2': 'Limit',\n '3': 'Stop',\n '4': 'StopLimit',\n '5': 'MarketOnClose',\n '6': 'WithOrWithout',\n '7': 'LimitOrBetter',\n '8': 'LimitWithOrWithout',\n '9': 'OnBasis',\n A: 'OnClose',\n B: 'LimitOnClose',\n C: 'ForexMarket',\n D: 'PreviouslyQuoted',\n E: 'PreviouslyIndicated',\n F: 'ForexLimit',\n G: 'ForexSwap',\n H: 'ForexPreviouslyQuoted',\n I: 'Funari',\n J: 'MarketIfTouched',\n K: 'MarketWithLeftOverAsLimit',\n L: 'PreviousFundValuationPoint',\n M: 'NextFundValuationPoint',\n P: 'Pegged',\n Q: 'CounterOrderSelection',\n R: 'StopOnBidOrOffer',\n S: 'StopLimitOnBidOrOffer',\n };\n\n const sideNames: Record<string, string> = {\n '1': 'Buy',\n '2': 'Sell',\n '3': 'BuyMinus',\n '4': 'SellPlus',\n '5': 'SellShort',\n '6': 'SellShortExempt',\n '7': 'Undisclosed',\n '8': 'Cross',\n '9': 'CrossShort',\n A: 'CrossShortExempt',\n B: 'AsDefined',\n C: 'Opposite',\n D: 'Subscribe',\n E: 'Redeem',\n F: 'Lend',\n G: 'Borrow',\n H: 'SellUndisclosed',\n };\n\n const timeInForceNames: Record<string, string> = {\n '0': 'Day',\n '1': 'GoodTillCancel',\n '2': 'AtTheOpening',\n '3': 'ImmediateOrCancel',\n '4': 'FillOrKill',\n '5': 'GoodTillCrossing',\n '6': 'GoodTillDate',\n '7': 'AtTheClose',\n '8': 'GoodThroughCrossing',\n '9': 'AtCrossing',\n A: 'GoodForTime',\n B: 'GoodForAuction',\n C: 'GoodForMonth',\n };\n\n const handlInstNames: Record<string, string> = {\n '1': 'AutomatedExecutionNoIntervention',\n '2': 'AutomatedExecutionInterventionOK',\n '3': 'ManualOrder',\n };\n\n return {\n contents: [\n {\n type: 'text',\n text: `VERIFICATION: All parameters valid. Ready to proceed with order execution.\n \nParameters verified:\n- ClOrdID: ${args.clOrdID}\n- HandlInst: ${args.handlInst} (${handlInstNames[args.handlInst]})\n- Quantity: ${args.quantity}\n- Price: ${args.price}\n- OrdType: ${args.ordType} (${ordTypeNames[args.ordType]})\n- Side: ${args.side} (${sideNames[args.side]})\n- Symbol: ${args.symbol}\n- TimeInForce: ${args.timeInForce} (${timeInForceNames[args.timeInForce]})\n\nTo execute this order, call the executeOrder tool with these exact same parameters.`,\n uri: 'verifyOrder',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to verify order parameters'}`,\n uri: 'verifyOrder',\n },\n ],\n isError: true,\n };\n }\n case 'executeOrder':\n try {\n // Check if this order was previously verified\n const verifiedOrder = this.verifiedOrders.get(args.clOrdID);\n if (!verifiedOrder) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: Order ${args.clOrdID} has not been verified. Please call verifyOrder first.`,\n uri: 'executeOrder',\n },\n ],\n isError: true,\n };\n }\n\n // Verify that all parameters match the verified order\n if (\n verifiedOrder.handlInst !== args.handlInst ||\n verifiedOrder.quantity !== Number.parseFloat(args.quantity) ||\n verifiedOrder.price !== Number.parseFloat(args.price) ||\n verifiedOrder.ordType !== args.ordType ||\n verifiedOrder.side !== args.side ||\n verifiedOrder.symbol !== args.symbol ||\n verifiedOrder.timeInForce !== args.timeInForce\n ) {\n return {\n contents: [\n {\n type: 'text',\n text: 'Error: Order parameters do not match the verified order. Please use the exact same parameters that were verified.',\n uri: 'executeOrder',\n },\n ],\n isError: true,\n };\n }\n\n const response = new Promise((resolve) => {\n this.pendingRequests.set(args.clOrdID, resolve);\n });\n\n const order: Message | undefined = this.parser?.createMessage(\n new Field(Fields.MsgType, Messages.NewOrderSingle),\n new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),\n new Field(Fields.SenderCompID, this.parser?.sender),\n new Field(Fields.TargetCompID, this.parser?.target),\n new Field(Fields.SendingTime, this.parser?.getTimestamp()),\n new Field(Fields.ClOrdID, args.clOrdID),\n new Field(Fields.Side, args.side),\n new Field(Fields.Symbol, args.symbol),\n new Field(Fields.OrderQty, Number.parseFloat(args.quantity)),\n new Field(Fields.Price, Number.parseFloat(args.price)),\n new Field(Fields.OrdType, args.ordType),\n new Field(Fields.HandlInst, args.handlInst),\n new Field(Fields.TimeInForce, args.timeInForce),\n new Field(Fields.TransactTime, this.parser?.getTimestamp()),\n );\n\n if (!this.parser?.connected) {\n return {\n contents: [\n {\n type: 'text',\n text: 'Error: Not connected. Ignoring message.',\n uri: 'executeOrder',\n },\n ],\n isError: true,\n };\n }\n\n this.parser?.send(order!);\n\n const fixData = await response;\n\n // Remove the verified order after execution\n this.verifiedOrders.delete(args.clOrdID);\n\n return {\n contents: [\n {\n type: 'text',\n text:\n (fixData as Message).messageType === Messages.Reject\n ? `Reject message for order ${args.clOrdID}: ${JSON.stringify((fixData as Message).toFIXJSON())}`\n : `Execution Report for order ${args.clOrdID}: ${JSON.stringify((fixData as Message).toFIXJSON())}`,\n uri: 'executeOrder',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to execute order'}`,\n uri: 'executeOrder',\n },\n ],\n isError: true,\n };\n }\n case 'marketDataRequest':\n try {\n const response = new Promise((resolve) => {\n this.pendingRequests.set(args.mdReqID, resolve);\n });\n\n const messageFields = [\n new Field(Fields.MsgType, Messages.MarketDataRequest),\n new Field(Fields.SenderCompID, this.parser?.sender),\n new Field(Fields.MsgSeqNum, this.parser?.getNextTargetMsgSeqNum()),\n new Field(Fields.TargetCompID, this.parser?.target),\n new Field(Fields.SendingTime, this.parser?.getTimestamp()),\n new Field(Fields.MDReqID, args.mdReqID),\n new Field(Fields.SubscriptionRequestType, args.subscriptionRequestType),\n new Field(Fields.MarketDepth, 0),\n new Field(Fields.MDUpdateType, args.mdUpdateType),\n ];\n\n // Add each symbol to the message\n messageFields.push(new Field(Fields.NoRelatedSym, args.symbols.length));\n args.symbols.forEach((symbol: string) => {\n messageFields.push(new Field(Fields.Symbol, symbol));\n });\n\n // Add NoMDEntryTypes and each MDEntryType to the message\n messageFields.push(new Field(Fields.NoMDEntryTypes, args.mdEntryTypes.length));\n args.mdEntryTypes.forEach((entryType: string) => {\n messageFields.push(new Field(Fields.MDEntryType, entryType));\n });\n\n const mdr = this.parser?.createMessage(...messageFields);\n\n if (!this.parser?.connected) {\n return {\n contents: [\n {\n type: 'text',\n text: 'Error: Not connected. Ignoring message.',\n uri: 'marketDataRequest',\n },\n ],\n isError: true,\n };\n }\n\n this.parser?.send(mdr!);\n\n const fixData = await response;\n\n return {\n contents: [\n {\n type: 'text',\n text: `Market data for ${args.symbols.join(', ')}: ${JSON.stringify((fixData as Message).toFIXJSON())}`,\n uri: 'marketDataRequest',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : 'Failed to request market data'}`,\n uri: 'marketDataRequest',\n },\n ],\n isError: true,\n };\n }\n default:\n return {\n contents: [\n {\n type: 'text',\n text: `Tool not found: ${name}`,\n uri: name,\n },\n ],\n isError: true,\n };\n }\n },\n );\n\n // Add handler for resources/read\n this.server.setRequestHandler(\n z.object({\n method: z.literal('resources/read'),\n params: z.object({\n uri: z.string(),\n }),\n }),\n async (request: Request, extra) => {\n const { uri } = request.params as { uri: string };\n\n // Handle different resource URIs\n switch (uri) {\n case 'greeting-resource':\n return {\n contents: [\n {\n type: 'text',\n text: 'Hello, world!',\n uri: 'greeting-resource',\n },\n ],\n };\n\n case 'stockGraph':\n return {\n contents: [\n {\n type: 'text',\n text: 'This resource requires a symbol parameter. Please use the stockGraph/{symbol} resource.',\n uri: 'stockGraph',\n },\n ],\n };\n\n case 'stockPriceHistory':\n return {\n contents: [\n {\n type: 'text',\n text: 'This resource requires a symbol parameter. Please use the stockPriceHistory/{symbol} resource.',\n uri: 'stockPriceHistory',\n },\n ],\n };\n\n default:\n // Check if the URI matches a template pattern\n if (uri.startsWith('stockGraph/')) {\n const symbol = uri.split('/')[1];\n const priceHistory = this.marketDataPrices.get(symbol) || [];\n\n if (priceHistory.length === 0) {\n return {\n contents: [\n {\n type: 'text',\n text: `No price data available for ${symbol}`,\n uri: uri,\n },\n ],\n };\n }\n\n // Calculate dimensions and scaling\n const width = 600;\n const height = 300;\n const padding = 40;\n const xScale = (width - 2 * padding) / (priceHistory.length - 1);\n const yMin = Math.min(...priceHistory.map((d) => d.price));\n const yMax = Math.max(...priceHistory.map((d) => d.price));\n const yScale = (height - 2 * padding) / (yMax - yMin);\n\n // Generate SVG path\n const points = priceHistory\n .map((d, i) => {\n const x = padding + i * xScale;\n const y = height - padding - (d.price - yMin) * yScale;\n return `${x},${y}`;\n })\n .join(' L ');\n\n // Create SVG\n const svg = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"${width}\" height=\"${height}\" xmlns=\"http://www.w3.org/2000/svg\">\n <!-- Background -->\n <rect width=\"100%\" height=\"100%\" fill=\"#f8f9fa\"/>\n \n <!-- Grid lines -->\n <g stroke=\"#e9ecef\" stroke-width=\"1\">\n ${Array.from({ length: 5 }, (_, i) => {\n const y = padding + ((height - 2 * padding) * i) / 4;\n return `<line x1=\"${padding}\" y1=\"${y}\" x2=\"${width - padding}\" y2=\"${y}\"/>`;\n }).join('\\n')}\n </g>\n \n <!-- Price line -->\n <path d=\"M ${points}\" \n fill=\"none\" \n stroke=\"#007bff\" \n stroke-width=\"2\"/>\n \n <!-- Data points -->\n ${priceHistory\n .map((d, i) => {\n const x = padding + i * xScale;\n const y = height - padding - (d.price - yMin) * yScale;\n return `<circle cx=\"${x}\" cy=\"${y}\" r=\"3\" fill=\"#007bff\"/>`;\n })\n .join('\\n')}\n \n <!-- Labels -->\n <g font-family=\"Arial\" font-size=\"12\" fill=\"#495057\">\n ${Array.from({ length: 5 }, (_, i) => {\n const x = padding + ((width - 2 * padding) * i) / 4;\n const index = Math.floor(((priceHistory.length - 1) * i) / 4);\n const timestamp = new Date(priceHistory[index].timestamp).toLocaleTimeString();\n return `<text x=\"${x + padding}\" y=\"${height - padding + 20}\" text-anchor=\"middle\">${timestamp}</text>`;\n }).join('\\n')}\n ${Array.from({ length: 5 }, (_, i) => {\n const y = padding + ((height - 2 * padding) * i) / 4;\n const price = yMax - ((yMax - yMin) * i) / 4;\n return `<text x=\"${padding - 5}\" y=\"${y + 4}\" text-anchor=\"end\">$${price.toFixed(2)}</text>`;\n }).join('\\n')}\n </g>\n \n <!-- Title -->\n <text x=\"${width / 2}\" y=\"${padding / 2}\" \n font-family=\"Arial\" font-size=\"16\" font-weight=\"bold\" \n text-anchor=\"middle\" fill=\"#212529\">\n ${symbol} - Price Chart (${priceHistory.length} points)\n </text>\n</svg>`;\n\n return {\n contents: [\n {\n type: 'text',\n text: svg,\n uri: uri,\n },\n ],\n };\n }\n\n if (uri.startsWith('stockPriceHistory/')) {\n const symbol = uri.split('/')[1];\n const priceHistory = this.marketDataPrices.get(symbol) || [];\n\n if (priceHistory.length === 0) {\n return {\n contents: [\n {\n type: 'text',\n text: `No price data available for ${symbol}`,\n uri: uri,\n },\n ],\n };\n }\n\n return {\n contents: [\n {\n type: 'text',\n text: JSON.stringify(\n {\n symbol,\n count: priceHistory.length,\n prices: priceHistory.map((point) => ({\n timestamp: new Date(point.timestamp).toISOString(),\n price: point.price,\n })),\n },\n null,\n 2,\n ),\n uri: uri,\n },\n ],\n };\n }\n\n return {\n contents: [\n {\n type: 'text',\n text: `Resource not found: ${uri}`,\n uri: uri,\n },\n ],\n isError: true,\n };\n }\n },\n );\n\n process.on('SIGINT', async () => {\n await this.server.close();\n process.exit(0);\n });\n }\n}\n"],
5
+ "mappings": ";AAAA,OACI,iBAAAA,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,YAAAC,EAEA,mBAAAC,MACG,YCQA,IAAMC,EAAN,KAAqD,CAChD,OAER,YAAY,CAAE,OAAAC,EAAS,MAAO,EAA8B,CACxD,KAAK,OAASA,CAClB,CAKA,UAAUC,EAA0D,CAChE,KAAK,OAASA,EAAO,QAAU,MACnC,CAKA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AAO,OACP,QAAS,yBACb,CAAC,EACDI,EAAU,CACd,EACA,QAAS,IAAM,CACXJ,EAAU,OAAO,IAAI,CACjB,MAAO,OACP,QAAS,qDACb,CAAC,EACD,WAAW,IAAM,CACbA,EAAU,QAAQW,CAAc,CACpC,EAAG,GAAI,CACX,CACJ,EAEAX,EAAU,QAAQW,CAAc,CACpC,EAEAf,EAAiB,EAAE,MAAOgB,GAAQ,QAAQ,MAAM,6BAA8BA,CAAG,CAAC",
6
+ "names": ["EncryptMethod", "FIXParser", "Field", "Fields", "LicenseManager", "Messages", "ResetSeqNumFlag", "ConsoleLogTransport", "format", "config", "log", "message", "rest", "jsonrpcMessage", "name", "id", "level", "additionalProperties", "kv", "key", "value", "logMessage", "Server", "StdioServerTransport", "Field", "Fields", "Messages", "z", "MCPLocal", "logger", "onReady", "parser", "message", "msgType", "id", "symbol", "price", "timestamp", "symbolStr", "priceNum", "priceHistory", "mdReqID", "clOrdID", "refSeqNum", "callback", "request", "extra", "name", "args", "parsedMessage", "error", "ordTypeNames", "sideNames", "timeInForceNames", "handlInstNames", "verifiedOrder", "response", "resolve", "order", "fixData", "messageFields", "entryType", "mdr", "uri", "width", "height", "padding", "xScale", "yMin", "d", "yMax", "yScale", "points", "i", "x", "y", "_", "index", "point", "initializeServer", "LicenseManager", "SENDER", "TARGET", "fixParser", "FIXParser", "ConsoleLogTransport", "MCPLocal", "sendLogon", "logon", "Field", "Fields", "Messages", "ResetSeqNumFlag", "EncryptMethod", "CONNECT_PARAMS", "err"]
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fixparser-plugin-mcp",
3
- "version": "9.1.7-a24bdbec",
4
- "description": "FIXParser MCP plugin (Local / Remote)",
3
+ "version": "9.1.7-a9d84740",
4
+ "description": "FIXParser MCP Plugin (Local/Remote)",
5
5
  "files": [
6
6
  "./build/",
7
7
  "./build-examples/",
@@ -37,8 +37,7 @@
37
37
  "fixparser": "next",
38
38
  "fixparser-common": "next",
39
39
  "fixparser-plugin-log-console": "next",
40
- "zod": "3.25.49",
41
- "zod-to-json-schema": "3.24.5"
40
+ "zod": "3.25.62"
42
41
  },
43
42
  "keywords": [
44
43
  "FIXParser",
@@ -62,6 +61,6 @@
62
61
  }
63
62
  },
64
63
  "devDependencies": {
65
- "@types/express": "5.0.2"
64
+ "@types/express": "5.0.3"
66
65
  }
67
66
  }
@@ -7,6 +7,9 @@ export declare class MCPLocal implements IPlugin<IFIXParser> {
7
7
  private transport;
8
8
  private onReady;
9
9
  private pendingRequests;
10
+ private verifiedOrders;
11
+ private marketDataPrices;
12
+ private readonly MAX_PRICE_HISTORY;
10
13
  constructor({ logger, onReady }: PluginOptions);
11
14
  register(parser: IFIXParser): Promise<void>;
12
15
  private addWorkflows;