fixparser-plugin-mcp 9.1.7-dde631c6 → 9.1.7-e016b83b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/MCPLocal.js +882 -1891
- package/build/cjs/MCPLocal.js.map +4 -4
- package/build/esm/MCPLocal.mjs +882 -1906
- package/build/esm/MCPLocal.mjs.map +4 -4
- package/build-examples/cjs/example_mcp_local.js +49 -7
- package/build-examples/cjs/example_mcp_local.js.map +4 -4
- package/build-examples/esm/example_mcp_local.mjs +49 -7
- package/build-examples/esm/example_mcp_local.mjs.map +4 -4
- package/package.json +11 -11
- package/types/MCPLocal.d.ts +3 -1
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
])
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
]`;continue}a+=r[o],r[o]==="\\"?s=!0:u&&r[o]==="]"?u=!1:!u&&r[o]==="["&&(u=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return a}function $(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===P.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((r,a)=>({...r,[a]:d(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",a]})??{}}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:d(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===P.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.checks?.length){let{type:r,...a}=E(t.keyType._def,e);return{...n,propertyNames:a}}else{if(t.keyType?._def.typeName===P.ZodFirstPartyTypeKind.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===P.ZodFirstPartyTypeKind.ZodBranded&&t.keyType._def.type._def.typeName===P.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.type._def.checks?.length){let{type:r,...a}=R(t.keyType._def,e);return{...n,propertyNames:a}}}return n}function se(t,e){if(e.mapStrategy==="record")return $(t,e);let n=d(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},r=d(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function oe(t){let e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}function ue(){return{not:{}}}function ce(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var I={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function pe(t,e){if(e.target==="openApi3")return A(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in I&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((a,s)=>{let u=I[s._def.typeName];return u&&!a.includes(u)?[...a,u]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((a,s)=>{let u=typeof s._def.value;switch(u){case"string":case"number":case"boolean":return[...a,u];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(r.length===n.length){let a=r.filter((s,u,p)=>p.indexOf(s)===u);return{type:a.length>1?a:a[0],enum:n.reduce((s,u)=>s.includes(u._def.value)?s:[...s,u._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return A(t,e)}var A=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,a)=>d(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${a}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function le(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:I[t.innerType._def.typeName],nullable:!0}:{type:[I[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let r=d(t.innerType._def,{...e,currentPath:[...e.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}let n=d(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function de(t,e){let n={type:"number"};if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",_(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?m(n,"minimum",r.value,r.message,e):m(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),m(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?m(n,"maximum",r.value,r.message,e):m(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),m(n,"maximum",r.value,r.message,e));break;case"multipleOf":m(n,"multipleOf",r.value,r.message,e);break}return n}function me(t,e){let n=e.target==="openAi",r={type:"object",properties:{}},a=[],s=t.shape();for(let p in s){let o=s[p];if(o===void 0||o._def===void 0)continue;let f=ye(o);f&&n&&(o instanceof C.ZodOptional&&(o=o._def.innerType),o.isNullable()||(o=o.nullable()),f=!1);let v=d(o._def,{...e,currentPath:[...e.currentPath,"properties",p],propertyPath:[...e.currentPath,"properties",p]});v!==void 0&&(r.properties[p]=v,f||a.push(p))}a.length&&(r.required=a);let u=ge(t,e);return u!==void 0&&(r.additionalProperties=u),r}function ge(t,e){if(t.catchall._def.typeName!=="ZodNever")return d(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function ye(t){try{return t.isOptional()}catch{return!0}}var fe=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return d(t.innerType._def,e);let n=d(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},he=(t,e)=>{if(e.pipeStrategy==="input")return d(t.in._def,e);if(e.pipeStrategy==="output")return d(t.out._def,e);let n=d(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=d(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(a=>a!==void 0)}};function be(t,e){return d(t.type._def,e)}function ve(t,e){let r={type:"array",uniqueItems:!0,items:d(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&m(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&m(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function Se(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>d(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:d(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>d(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Pe(){return{not:{}}}function Te(){return{}}var Ie=(t,e)=>d(t.innerType._def,e),ke=(t,e,n)=>{switch(e){case l.ZodFirstPartyTypeKind.ZodString:return E(t,n);case l.ZodFirstPartyTypeKind.ZodNumber:return de(t,n);case l.ZodFirstPartyTypeKind.ZodObject:return me(t,n);case l.ZodFirstPartyTypeKind.ZodBigInt:return K(t,n);case l.ZodFirstPartyTypeKind.ZodBoolean:return G();case l.ZodFirstPartyTypeKind.ZodDate:return Z(t,n);case l.ZodFirstPartyTypeKind.ZodUndefined:return Pe();case l.ZodFirstPartyTypeKind.ZodNull:return ce(n);case l.ZodFirstPartyTypeKind.ZodArray:return H(t,n);case l.ZodFirstPartyTypeKind.ZodUnion:case l.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return pe(t,n);case l.ZodFirstPartyTypeKind.ZodIntersection:return re(t,n);case l.ZodFirstPartyTypeKind.ZodTuple:return Se(t,n);case l.ZodFirstPartyTypeKind.ZodRecord:return $(t,n);case l.ZodFirstPartyTypeKind.ZodLiteral:return ne(t,n);case l.ZodFirstPartyTypeKind.ZodEnum:return ee(t);case l.ZodFirstPartyTypeKind.ZodNativeEnum:return oe(t);case l.ZodFirstPartyTypeKind.ZodNullable:return le(t,n);case l.ZodFirstPartyTypeKind.ZodOptional:return fe(t,n);case l.ZodFirstPartyTypeKind.ZodMap:return se(t,n);case l.ZodFirstPartyTypeKind.ZodSet:return ve(t,n);case l.ZodFirstPartyTypeKind.ZodLazy:return()=>t.getter()._def;case l.ZodFirstPartyTypeKind.ZodPromise:return be(t,n);case l.ZodFirstPartyTypeKind.ZodNaN:case l.ZodFirstPartyTypeKind.ZodNever:return ue();case l.ZodFirstPartyTypeKind.ZodEffects:return Y(t,n);case l.ZodFirstPartyTypeKind.ZodAny:return J();case l.ZodFirstPartyTypeKind.ZodUnknown:return Te();case l.ZodFirstPartyTypeKind.ZodDefault:return Q(t,n);case l.ZodFirstPartyTypeKind.ZodBranded:return R(t,n);case l.ZodFirstPartyTypeKind.ZodReadonly:return Ie(t,n);case l.ZodFirstPartyTypeKind.ZodCatch:return V(t,n);case l.ZodFirstPartyTypeKind.ZodPipeline:return he(t,n);case l.ZodFirstPartyTypeKind.ZodFunction:case l.ZodFirstPartyTypeKind.ZodVoid:case l.ZodFirstPartyTypeKind.ZodSymbol:return;default:return(r=>{})(e)}};function d(t,e,n=!1){let r=e.seen.get(t);if(e.override){let p=e.override?.(t,e,r,n);if(p!==z)return p}if(r&&!n){let p=Oe(r,e);if(p!==void 0)return p}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=ke(t,t.typeName,e),u=typeof s=="function"?d(s(),e):s;if(u&&Me(t,e,u),e.postProcess){let p=e.postProcess(u,t,e);return a.jsonSchema=u,p}return a.jsonSchema=u,u}var Oe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:we(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},we=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},Me=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n),T=(t,e)=>{let n=B(e),r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((o,[f,v])=>({...o,[f]:d(v._def,{...n,currentPath:[...n.basePath,n.definitionPath,f]},!0)??{}}),{}):void 0,a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=d(t._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1)??{},u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);let p=a===void 0?r?{...s,[n.definitionPath]:r}:s:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,a].join("/"),[n.definitionPath]:{...r,[a]:s}};return n.target==="jsonSchema7"?p.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(p.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in p||"oneOf"in p||"allOf"in p||"type"in p&&Array.isArray(p.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),p},j=class{logger;parser;server=new F.Server({name:"fixparser",version:"1.0.0"},{capabilities:{tools:{listChanged:!0},prompts:{listChanged:!0},resources:{listChanged:!0}}});transport=new N.StdioServerTransport;onReady=void 0;pendingRequests=new Map;constructor({logger:t,onReady:e}){t&&(this.logger=t),e&&(this.onReady=e)}async register(t){this.parser=t,this.parser.addOnMessageCallback(e=>{this.logger?.log({level:"info",message:`FIXParser (MCP): (${t.protocol?.toUpperCase()}): << received ${e.description}`});let n=e.messageType;if(n===i.Messages.MarketDataSnapshotFullRefresh||n===i.Messages.ExecutionReport){let r=n===i.Messages.MarketDataSnapshotFullRefresh?e.getField(i.Fields.MDReqID):e.getField(i.Fields.ClOrdID);if(r){let a=r.value;if(typeof a=="string"||typeof a=="number"){let s=this.pendingRequests.get(String(a));s&&(s(e),this.pendingRequests.delete(String(a)))}}}}),this.logger=t.logger,this.addWorkflows(),await this.server.connect(this.transport),this.onReady&&this.onReady()}addWorkflows(){if(!this.parser){this.logger?.log({level:"error",message:"FIXParser (MCP): -- FIXParser instance not initialized. Ignoring setup of workflows..."});return}if(!this.server){this.logger?.log({level:"error",message:"FIXParser (MCP): -- MCP Server not initialized. Ignoring setup of workflows..."});return}this.server.setRequestHandler(S.ListResourcesRequestSchema,async()=>({resources:[]})),this.server.setRequestHandler(S.ListToolsRequestSchema,async()=>({tools:[{name:"parse",description:"Parses a FIX message and describes it in plain language",inputSchema:T(c.z.object({fixString:c.z.string().describe("FIX message string to parse")}),{name:"ParseInput"})},{name:"parseToJSON",description:"Parses a FIX message into JSON",inputSchema:T(c.z.object({fixString:c.z.string().describe("FIX message string to parse")}),{name:"ParseToJSONInput"})},{name:"newOrderSingle",description:"Creates and sends a New Order Single",inputSchema:T(c.z.object({clOrdID:c.z.string().describe("Client Order ID"),handlInst:c.z.enum(["1","2","3"]).default(i.HandlInst.AutomatedExecutionNoIntervention).optional().describe("Handling instruction"),quantity:c.z.number().describe("Order quantity"),price:c.z.number().describe("Order price"),ordType:c.z.enum(["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"]).default("1").optional().describe("Order type"),side:c.z.enum(["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"]).describe("Order side (1=Buy, 2=Sell)"),symbol:c.z.string().describe("Trading symbol"),timeInForce:c.z.enum(["0","1","2","3","4","5","6","7","8","9","A","B","C"]).default(i.TimeInForce.Day).optional().describe("Time in force")}),{name:"NewOrderSingleInput"})},{name:"marketDataRequest",description:"Sends a request for Market Data with the given symbol",inputSchema:T(c.z.object({mdUpdateType:c.z.enum(["0","1"]).default("0").optional().describe("Market data update type"),symbol:c.z.string().describe("Trading symbol"),mdReqID:c.z.string().describe("Market data request ID"),subscriptionRequestType:c.z.enum(["0","1","2"]).default(i.SubscriptionRequestType.SnapshotAndUpdates).optional().describe("Subscription request type"),mdEntryType:c.z.enum(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","S","R","T","U","V","W","X","Y","Z","a","b","c","d","e","g","h","i","t"]).default(i.MDEntryType.Bid).optional().describe("Market data entry type")}),{name:"MarketDataRequestInput"})}]})),this.server.setRequestHandler(S.CallToolRequestSchema,async t=>{let{name:e,arguments:n}=t.params;switch(e){case"parse":{let{fixString:r}=c.z.object({fixString:c.z.string().describe("FIX message string to parse")}).parse(n||{});try{let a=this.parser?.parse(r);return!a||a.length===0?{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}:{content:[{type:"text",text:`Parsed FIX message: ${r} (placeholder implementation)`}]}}catch{return{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}}}case"parseToJSON":{let{fixString:r}=c.z.object({fixString:c.z.string().describe("FIX message string to parse")}).parse(n||{});try{let a=this.parser?.parse(r);return!a||a.length===0?{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}:{content:[{type:"text",text:JSON.stringify({fixString:r,parsed:"placeholder"})}]}}catch{return{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}}}case"newOrderSingle":{let{clOrdID:r,handlInst:a,quantity:s,price:u,ordType:p,side:o,symbol:f,timeInForce:v}=c.z.object({clOrdID:c.z.string().describe("Client Order ID"),handlInst:c.z.enum(["1","2","3"]).default(i.HandlInst.AutomatedExecutionNoIntervention).optional().describe("Handling instruction"),quantity:c.z.number().describe("Order quantity"),price:c.z.number().describe("Order price"),ordType:c.z.enum(["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"]).default(i.OrdType.Market).optional().describe("Order type"),side:c.z.enum(["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"]).describe("Order side (1=Buy, 2=Sell)"),symbol:c.z.string().describe("Trading symbol"),timeInForce:c.z.enum(["0","1","2","3","4","5","6","7","8","9","A","B","C"]).default(i.TimeInForce.Day).optional().describe("Time in force")}).parse(n||{}),k=new Promise(X=>{this.pendingRequests.set(r,X)}),M=this.parser?.createMessage(new i.Field(i.Fields.MsgType,i.Messages.NewOrderSingle),new i.Field(i.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new i.Field(i.Fields.SenderCompID,this.parser?.sender),new i.Field(i.Fields.TargetCompID,this.parser?.target),new i.Field(i.Fields.SendingTime,this.parser?.getTimestamp()),new i.Field(i.Fields.ClOrdID,r),new i.Field(i.Fields.Side,o),new i.Field(i.Fields.Symbol,f),new i.Field(i.Fields.OrderQty,s),new i.Field(i.Fields.Price,u),new i.Field(i.Fields.OrdType,p),new i.Field(i.Fields.HandlInst,a),new i.Field(i.Fields.TimeInForce,v),new i.Field(i.Fields.TransactTime,this.parser?.getTimestamp()));if(!this.parser?.connected)return this.logger?.log({level:"error",message:"FIXParser (MCP): -- Not connected. Ignoring message."}),{isError:!0,content:[{type:"text",text:"Error: Not connected. Ignoring message."}]};this.parser?.send(M),this.logger?.log({level:"info",message:`FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${M?.description}`});let L=await k;return{content:[{type:"text",text:`Execution Report for order ${r}: ${JSON.stringify(L.toFIXJSON())}`}]}}case"marketDataRequest":{let{mdUpdateType:r,symbol:a,mdReqID:s,subscriptionRequestType:u,mdEntryType:p}=c.z.object({mdUpdateType:c.z.enum(["0","1"]).default("0").optional().describe("Market data update type"),symbol:c.z.string().describe("Trading symbol"),mdReqID:c.z.string().describe("Market data request ID"),subscriptionRequestType:c.z.enum(["0","1","2"]).default(i.SubscriptionRequestType.SnapshotAndUpdates).optional().describe("Subscription request type"),mdEntryType:c.z.enum(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","S","R","T","U","V","W","X","Y","Z","a","b","c","d","e","g","h","i","t"]).default(i.MDEntryType.Bid).optional().describe("Market data entry type")}).parse(n||{}),o=new Promise(k=>{this.pendingRequests.set(s,k)}),f=this.parser?.createMessage(new i.Field(i.Fields.MsgType,i.Messages.MarketDataRequest),new i.Field(i.Fields.SenderCompID,this.parser?.sender),new i.Field(i.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new i.Field(i.Fields.TargetCompID,this.parser?.target),new i.Field(i.Fields.SendingTime,this.parser?.getTimestamp()),new i.Field(i.Fields.MarketDepth,0),new i.Field(i.Fields.MDUpdateType,r),new i.Field(i.Fields.NoRelatedSym,1),new i.Field(i.Fields.Symbol,a),new i.Field(i.Fields.MDReqID,s),new i.Field(i.Fields.SubscriptionRequestType,u),new i.Field(i.Fields.NoMDEntryTypes,1),new i.Field(i.Fields.MDEntryType,p));if(!this.parser?.connected)return this.logger?.log({level:"error",message:"FIXParser (MCP): -- Not connected. Ignoring message."}),{isError:!0,content:[{type:"text",text:"Error: Not connected. Ignoring message."}]};this.parser?.send(f),this.logger?.log({level:"info",message:`FIXParser (MCP): (${this.parser?.protocol?.toUpperCase()}): >> sent ${f?.description}`});let v=await o;return{content:[{type:"text",text:`Market data for ${a}: ${JSON.stringify(v.toFIXJSON())}`}]}}default:throw new Error(`Unknown tool: ${e}`)}}),this.server.setRequestHandler(S.ListPromptsRequestSchema,async()=>({prompts:[{name:"parse",description:"Parses a FIX message and describes it in plain language",arguments:[{name:"fixString",description:"FIX message string to parse",required:!0}]},{name:"parseToJSON",description:"Parses a FIX message into JSON",arguments:[{name:"fixString",description:"FIX message string to parse",required:!0}]},{name:"newOrderSingle",description:"Creates and sends a New Order Single",arguments:[{name:"clOrdID",description:"Client Order ID",required:!0},{name:"handlInst",description:"Handling instruction",required:!1},{name:"quantity",description:"Order quantity",required:!0},{name:"price",description:"Order price",required:!0},{name:"ordType",description:"Order type",required:!1},{name:"side",description:"Order side (1=Buy, 2=Sell)",required:!0},{name:"symbol",description:"Trading symbol",required:!0},{name:"timeInForce",description:"Time in force",required:!1}]},{name:"marketDataRequest",description:"Sends a request for Market Data with the given symbol",arguments:[{name:"mdUpdateType",description:"Market data update type",required:!1},{name:"symbol",description:"Trading symbol",required:!0},{name:"mdReqID",description:"Market data request ID",required:!0},{name:"subscriptionRequestType",description:"Subscription request type",required:!1},{name:"mdEntryType",description:"Market data entry type",required:!1}]}]})),this.server.setRequestHandler(S.GetPromptRequestSchema,async t=>{let{name:e,arguments:n}=t.params;switch(e){case"parse":return{messages:[{role:"user",content:{type:"text",text:`Please parse and explain this FIX message: ${n?.fixString||""}`}}]};case"parseToJSON":return{messages:[{role:"user",content:{type:"text",text:`Please parse the FIX message to JSON: ${n?.fixString||""}`}}]};case"newOrderSingle":{let{clOrdID:r,handlInst:a,quantity:s,price:u,ordType:p,side:o,symbol:f,timeInForce:v}=n||{};return{messages:[{role:"user",content:{type:"text",text:["Create a New Order Single FIX message with the following parameters:",`- ClOrdID: ${r}`,`- HandlInst: ${a??"default"}`,`- Quantity: ${s}`,`- Price: ${u}`,`- OrdType: ${p??"default (Market)"}`,`- Side: ${o}`,`- Symbol: ${f}`,`- TimeInForce: ${v??"default (Day)"}`,"","Format the response as a JSON object with FIX tag numbers as keys and their corresponding values."].join(`
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"use strict";var n=require("fixparser");var I=class{format;constructor({format:c="json"}){this.format=c}configure(c){this.format=c.format||"json"}async send(c){if(this.format==="json")console.log(JSON.stringify(c));else if(this.format==="jsonrpc"){let{message:a,...o}=c,r={jsonrpc:"2.0",method:c.level,params:{message:a,...o},id:c.id||Date.now()};console.log(JSON.stringify(r))}else{let{name:a,id:o,message:r,level:t,...i}=c,d=Object.entries(i).map(([s,u])=>`${s}: ${u}`),p="";a&&(p+=`${a} `),p+=`${o}: ${r}`,console.log(p,d.join(", "))}}async flush(){}async close(){}status(){return"connected"}};var O=require("@modelcontextprotocol/sdk/server/index.js"),T=require("@modelcontextprotocol/sdk/server/stdio.js"),e=require("fixparser"),g=require("zod"),b=class{parser;server=new O.Server({name:"fixparser",version:"1.0.0"},{capabilities:{tools:{parse:{description:"Parses a FIX message and describes it in plain language",parameters:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},parseToJSON:{description:"Parses a FIX message into JSON",parameters:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},verifyOrder:{description:"Verifies order parameters before execution",parameters:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"]},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"]},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"]},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"]}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},executeOrder:{description:"Executes a verified order",parameters:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"]},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string"},side:{type:"string"},symbol:{type:"string"},timeInForce:{type:"string"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},marketDataRequest:{description:"Requests market data for specified symbols",parameters:{type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"]},symbols:{type:"array",items:{type:"string"}},mdReqID:{type:"string"},subscriptionRequestType:{type:"string",enum:["0","1","2"]},mdEntryTypes:{type:"array",items:{type:"string"}}},required:["mdUpdateType","symbols","mdReqID","subscriptionRequestType","mdEntryTypes"]}},getStockGraph:{description:"Generates a price chart for a given symbol",parameters:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},getStockPriceHistory:{description:"Returns price history for a given symbol",parameters:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}}}}});transport=new T.StdioServerTransport;onReady=void 0;pendingRequests=new Map;verifiedOrders=new Map;marketDataPrices=new Map;MAX_PRICE_HISTORY=1e5;constructor({logger:c,onReady:a}){a&&(this.onReady=a)}async register(c){this.parser=c,this.parser.addOnMessageCallback(a=>{this.parser?.logger.log({level:"info",message:`MCP Server received message: ${a.messageType}: ${a.description}`});let o=a.messageType;if(o===e.Messages.MarketDataSnapshotFullRefresh||o===e.Messages.ExecutionReport||o===e.Messages.Reject||o===e.Messages.MarketDataIncrementalRefresh){this.parser?.logger.log({level:"info",message:`MCP Server handling message type: ${o}`});let r;if(o===e.Messages.MarketDataIncrementalRefresh||o===e.Messages.MarketDataSnapshotFullRefresh){let t=a.getField(e.Fields.Symbol),i=a.getField(e.Fields.MDEntryPx),d=a.getField(e.Fields.MDEntryTime)?.value||Date.now();if(t?.value&&i?.value){let p=String(t.value),s=Number(i.value),u=this.marketDataPrices.get(p)||[];u.push({timestamp:Number(d),price:s}),u.length>this.MAX_PRICE_HISTORY&&u.shift(),this.marketDataPrices.set(p,u),this.parser?.logger.log({level:"info",message:`MCP Server added ${t}: ${s}`}),this.server.notification({method:"priceUpdate",params:{symbol:p,price:s,timestamp:Number(d)}})}}if(o===e.Messages.MarketDataSnapshotFullRefresh){let t=a.getField(e.Fields.MDReqID);t&&(r=String(t.value))}else if(o===e.Messages.ExecutionReport){let t=a.getField(e.Fields.ClOrdID);t&&(r=String(t.value))}else if(o===e.Messages.Reject){let t=a.getField(e.Fields.RefSeqNum);t&&(r=String(t.value))}if(r){let t=this.pendingRequests.get(r);t&&(t(a),this.pendingRequests.delete(r))}}}),this.addWorkflows(),await this.server.connect(this.transport),this.onReady&&this.onReady()}addWorkflows(){this.parser&&this.server&&(this.server.setRequestHandler(g.z.object({method:g.z.literal("tools/list")}),async(c,a)=>({tools:[{name:"parse",description:"Parses a FIX message and describes it in plain language",inputSchema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},{name:"parseToJSON",description:"Parses a FIX message into JSON",inputSchema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},{name:"verifyOrder",description:"Verifies order parameters before execution",inputSchema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"]},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"]},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"]},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"]}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},{name:"executeOrder",description:"Executes a verified order",inputSchema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"]},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string"},side:{type:"string"},symbol:{type:"string"},timeInForce:{type:"string"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},{name:"marketDataRequest",description:"Requests market data for specified symbols",inputSchema:{type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"]},symbols:{type:"array",items:{type:"string"}},mdReqID:{type:"string"},subscriptionRequestType:{type:"string",enum:["0","1","2"]},mdEntryTypes:{type:"array",items:{type:"string"}}},required:["mdUpdateType","symbols","mdReqID","subscriptionRequestType","mdEntryTypes"]}},{name:"getStockGraph",description:"Generates a price chart for a given symbol",inputSchema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},{name:"getStockPriceHistory",description:"Returns price history for a given symbol",inputSchema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}}]})),this.server.setRequestHandler(g.z.object({method:g.z.literal("tools/call"),params:g.z.object({name:g.z.string(),arguments:g.z.any(),_meta:g.z.object({progressToken:g.z.number()}).optional()})}),async(c,a)=>{let{name:o,arguments:r}=c.params;switch(o){case"parse":try{let t=this.parser?.parse(r.fixString);return!t||t.length===0?{contents:[{type:"text",text:"Error: Failed to parse FIX string",uri:"parse"}],isError:!0}:{contents:[{type:"text",text:`${t[0].description}
|
|
3
|
+
${t[0].messageTypeDescription}`,uri:"parse"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to parse FIX string"}`,uri:"parse"}],isError:!0}}case"parseToJSON":try{let t=this.parser?.parse(r.fixString);return!t||t.length===0?{contents:[{type:"text",text:"Error: Failed to parse FIX string",uri:"parseToJSON"}],isError:!0}:{contents:[{type:"text",text:`${t[0].toFIXJSON()}`,uri:"parseToJSON"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to parse FIX string"}`,uri:"parseToJSON"}],isError:!0}}case"verifyOrder":try{this.verifiedOrders.set(r.clOrdID,{clOrdID:r.clOrdID,handlInst:r.handlInst,quantity:Number.parseFloat(r.quantity),price:Number.parseFloat(r.price),ordType:r.ordType,side:r.side,symbol:r.symbol,timeInForce:r.timeInForce});let t={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"},i={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"},d={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"},p={1:"AutomatedExecutionNoIntervention",2:"AutomatedExecutionInterventionOK",3:"ManualOrder"};return{contents:[{type:"text",text:`VERIFICATION: All parameters valid. Ready to proceed with order execution.
|
|
4
|
+
|
|
5
|
+
Parameters verified:
|
|
6
|
+
- ClOrdID: ${r.clOrdID}
|
|
7
|
+
- HandlInst: ${r.handlInst} (${p[r.handlInst]})
|
|
8
|
+
- Quantity: ${r.quantity}
|
|
9
|
+
- Price: ${r.price}
|
|
10
|
+
- OrdType: ${r.ordType} (${t[r.ordType]})
|
|
11
|
+
- Side: ${r.side} (${i[r.side]})
|
|
12
|
+
- Symbol: ${r.symbol}
|
|
13
|
+
- TimeInForce: ${r.timeInForce} (${d[r.timeInForce]})
|
|
14
|
+
|
|
15
|
+
To execute this order, call the executeOrder tool with these exact same parameters.`,uri:"verifyOrder"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to verify order parameters"}`,uri:"verifyOrder"}],isError:!0}}case"executeOrder":try{let t=this.verifiedOrders.get(r.clOrdID);if(!t)return{contents:[{type:"text",text:`Error: Order ${r.clOrdID} has not been verified. Please call verifyOrder first.`,uri:"executeOrder"}],isError:!0};if(t.handlInst!==r.handlInst||t.quantity!==Number.parseFloat(r.quantity)||t.price!==Number.parseFloat(r.price)||t.ordType!==r.ordType||t.side!==r.side||t.symbol!==r.symbol||t.timeInForce!==r.timeInForce)return{contents:[{type:"text",text:"Error: Order parameters do not match the verified order. Please use the exact same parameters that were verified.",uri:"executeOrder"}],isError:!0};let i=new Promise(s=>{this.pendingRequests.set(r.clOrdID,s)}),d=this.parser?.createMessage(new e.Field(e.Fields.MsgType,e.Messages.NewOrderSingle),new e.Field(e.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new e.Field(e.Fields.SenderCompID,this.parser?.sender),new e.Field(e.Fields.TargetCompID,this.parser?.target),new e.Field(e.Fields.SendingTime,this.parser?.getTimestamp()),new e.Field(e.Fields.ClOrdID,r.clOrdID),new e.Field(e.Fields.Side,r.side),new e.Field(e.Fields.Symbol,r.symbol),new e.Field(e.Fields.OrderQty,Number.parseFloat(r.quantity)),new e.Field(e.Fields.Price,Number.parseFloat(r.price)),new e.Field(e.Fields.OrdType,r.ordType),new e.Field(e.Fields.HandlInst,r.handlInst),new e.Field(e.Fields.TimeInForce,r.timeInForce),new e.Field(e.Fields.TransactTime,this.parser?.getTimestamp()));if(!this.parser?.connected)return{contents:[{type:"text",text:"Error: Not connected. Ignoring message.",uri:"executeOrder"}],isError:!0};this.parser?.send(d);let p=await i;return this.verifiedOrders.delete(r.clOrdID),{contents:[{type:"text",text:p.messageType===e.Messages.Reject?`Reject message for order ${r.clOrdID}: ${JSON.stringify(p.toFIXJSON())}`:`Execution Report for order ${r.clOrdID}: ${JSON.stringify(p.toFIXJSON())}`,uri:"executeOrder"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to execute order"}`,uri:"executeOrder"}],isError:!0}}case"marketDataRequest":try{let t=new Promise(s=>{this.pendingRequests.set(r.mdReqID,s)}),i=[new e.Field(e.Fields.MsgType,e.Messages.MarketDataRequest),new e.Field(e.Fields.SenderCompID,this.parser?.sender),new e.Field(e.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new e.Field(e.Fields.TargetCompID,this.parser?.target),new e.Field(e.Fields.SendingTime,this.parser?.getTimestamp()),new e.Field(e.Fields.MDReqID,r.mdReqID),new e.Field(e.Fields.SubscriptionRequestType,r.subscriptionRequestType),new e.Field(e.Fields.MarketDepth,0),new e.Field(e.Fields.MDUpdateType,r.mdUpdateType)];i.push(new e.Field(e.Fields.NoRelatedSym,r.symbols.length)),r.symbols.forEach(s=>{i.push(new e.Field(e.Fields.Symbol,s))}),i.push(new e.Field(e.Fields.NoMDEntryTypes,r.mdEntryTypes.length)),r.mdEntryTypes.forEach(s=>{i.push(new e.Field(e.Fields.MDEntryType,s))});let d=this.parser?.createMessage(...i);if(!this.parser?.connected)return{contents:[{type:"text",text:"Error: Not connected. Ignoring message.",uri:"marketDataRequest"}],isError:!0};this.parser?.send(d);let p=await t;return{contents:[{type:"text",text:`Market data for ${r.symbols.join(", ")}: ${JSON.stringify(p.toFIXJSON())}`,uri:"marketDataRequest"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to request market data"}`,uri:"marketDataRequest"}],isError:!0}}case"getStockGraph":try{let t=r.symbol,i=this.marketDataPrices.get(t)||[];if(i.length===0)return{contents:[{type:"text",text:`No price data available for ${t}`,uri:"getStockGraph"}]};let d=600,p=300,s=40,u=(d-2*s)/(i.length-1),f=Math.min(...i.map(m=>m.price)),S=Math.max(...i.map(m=>m.price)),x=(p-2*s)/(S-f),F=i.map((m,l)=>{let y=s+l*u,h=p-s-(m.price-f)*x;return`${y},${h}`}).join(" L ");return{contents:[{type:"text",text:`<?xml version="1.0" encoding="UTF-8"?>
|
|
16
|
+
<svg width="${d}" height="${p}" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<!-- Background -->
|
|
18
|
+
<rect width="100%" height="100%" fill="#f8f9fa"/>
|
|
19
|
+
|
|
20
|
+
<!-- Grid lines -->
|
|
21
|
+
<g stroke="#e9ecef" stroke-width="1">
|
|
22
|
+
${Array.from({length:5},(m,l)=>{let y=s+(p-2*s)*l/4;return`<line x1="${s}" y1="${y}" x2="${d-s}" y2="${y}"/>`}).join(`
|
|
23
|
+
`)}
|
|
24
|
+
</g>
|
|
25
|
+
|
|
26
|
+
<!-- Price line -->
|
|
27
|
+
<path d="M ${F}"
|
|
28
|
+
fill="none"
|
|
29
|
+
stroke="#007bff"
|
|
30
|
+
stroke-width="2"/>
|
|
31
|
+
|
|
32
|
+
<!-- Data points -->
|
|
33
|
+
${i.map((m,l)=>{let y=s+l*u,h=p-s-(m.price-f)*x;return`<circle cx="${y}" cy="${h}" r="3" fill="#007bff"/>`}).join(`
|
|
34
|
+
`)}
|
|
35
|
+
|
|
36
|
+
<!-- Labels -->
|
|
37
|
+
<g font-family="Arial" font-size="12" fill="#495057">
|
|
38
|
+
${Array.from({length:5},(m,l)=>{let y=s+(d-2*s)*l/4,h=Math.floor((i.length-1)*l/4),E=new Date(i[h].timestamp).toLocaleTimeString();return`<text x="${y+s}" y="${p-s+20}" text-anchor="middle">${E}</text>`}).join(`
|
|
39
|
+
`)}
|
|
40
|
+
${Array.from({length:5},(m,l)=>{let y=s+(p-2*s)*l/4,h=S-(S-f)*l/4;return`<text x="${s-5}" y="${y+4}" text-anchor="end">$${h.toFixed(2)}</text>`}).join(`
|
|
41
|
+
`)}
|
|
42
|
+
</g>
|
|
43
|
+
|
|
44
|
+
<!-- Title -->
|
|
45
|
+
<text x="${d/2}" y="${s/2}"
|
|
46
|
+
font-family="Arial" font-size="16" font-weight="bold"
|
|
47
|
+
text-anchor="middle" fill="#212529">
|
|
48
|
+
${t} - Price Chart (${i.length} points)
|
|
49
|
+
</text>
|
|
50
|
+
</svg>`,uri:"getStockGraph"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to generate stock graph"}`,uri:"getStockGraph"}],isError:!0}}case"getStockPriceHistory":try{let t=r.symbol,i=this.marketDataPrices.get(t)||[];return i.length===0?{contents:[{type:"text",text:`No price data available for ${t}`,uri:"getStockPriceHistory"}]}:{contents:[{type:"text",text:JSON.stringify({symbol:t,count:i.length,prices:i.map(d=>({timestamp:new Date(d.timestamp).toISOString(),price:d.price}))},null,2),uri:"getStockPriceHistory"}]}}catch(t){return{contents:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to get stock price history"}`,uri:"getStockPriceHistory"}],isError:!0}}default:return{contents:[{type:"text",text:`Tool not found: ${o}`,uri:o}],isError:!0}}}),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)}))}};var R=async()=>{await n.LicenseManager.setLicenseKey(process.env.FIXPARSER_LICENSE_KEY);let c=process.env.FIXPARSER_SENDER||"SENDER",a=process.env.FIXPARSER_TARGET||"TARGET",o=new n.FIXParser({logging:!0,logOptions:{level:"info",format:"jsonrpc",transport:new I({format:"jsonrpc"})},plugins:[new b({port:3099,onReady:()=>{}})]}),r=()=>{let i=o.createMessage(new n.Field(n.Fields.MsgType,n.Messages.Logon),new n.Field(n.Fields.MsgSeqNum,o.getNextTargetMsgSeqNum()),new n.Field(n.Fields.SenderCompID,c),new n.Field(n.Fields.SendingTime,o.getTimestamp()),new n.Field(n.Fields.TargetCompID,a),new n.Field(n.Fields.ResetSeqNumFlag,n.ResetSeqNumFlag.Yes),new n.Field(n.Fields.EncryptMethod,n.EncryptMethod.None),new n.Field(n.Fields.HeartBtInt,10));o.send(i)},t={host:process.env.FIXPARSER_HOST||"10.0.1.42",port:process.env.FIXPARSER_PORT?Number.parseInt(process.env.FIXPARSER_PORT,10):5001,protocol:"tcp",sender:c,target:a,fixVersion:"FIX.4.4",onOpen:()=>{o.logger.log({level:"info",message:"FIXParser logging in..."}),r()},onClose:()=>{o.logger.log({level:"info",message:"FIXParser disconnected. Reconnecting in 1 second..."}),setTimeout(()=>{o.connect(t)},1e3)}};o.connect(t)};R().catch(c=>console.error("Error initializing server:",c));
|
|
9
51
|
//# sourceMappingURL=example_mcp_local.js.map
|