fixparser-plugin-mcp 9.1.7-c415bb75 → 9.1.7-c6228661
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 +422 -10
- package/build/cjs/MCPLocal.js.map +4 -4
- package/build/cjs/MCPRemote.js +422 -66
- package/build/cjs/MCPRemote.js.map +4 -4
- package/build/cjs/index.js +422 -66
- package/build/cjs/index.js.map +4 -4
- package/build/esm/MCPLocal.mjs +422 -10
- package/build/esm/MCPLocal.mjs.map +4 -4
- package/build/esm/MCPRemote.mjs +422 -66
- package/build/esm/MCPRemote.mjs.map +4 -4
- package/build/esm/index.mjs +422 -66
- package/build/esm/index.mjs.map +4 -4
- package/build-examples/cjs/example_mcp_local.js +9 -7
- package/build-examples/cjs/example_mcp_local.js.map +4 -4
- package/build-examples/cjs/example_mcp_remote.js +9 -7
- package/build-examples/cjs/example_mcp_remote.js.map +4 -4
- package/build-examples/esm/example_mcp_local.mjs +9 -7
- package/build-examples/esm/example_mcp_local.mjs.map +4 -4
- package/build-examples/esm/example_mcp_remote.mjs +9 -7
- package/build-examples/esm/example_mcp_remote.mjs.map +4 -4
- package/package.json +2 -2
- package/types/MCPBase.d.ts +0 -49
- package/types/MCPLocal.d.ts +0 -32
- package/types/MCPRemote.d.ts +0 -58
- package/types/PluginOptions.d.ts +0 -6
- package/types/index.d.ts +0 -3
- package/types/schemas/index.d.ts +0 -15
- package/types/schemas/marketData.d.ts +0 -48
- package/types/schemas/schemas.d.ts +0 -168
- package/types/tools/index.d.ts +0 -17
- package/types/tools/marketData.d.ts +0 -40
- package/types/tools/order.d.ts +0 -12
- package/types/tools/parse.d.ts +0 -5
- package/types/tools/parseToJSON.d.ts +0 -5
- package/types/utils/messageHandler.d.ts +0 -12
package/types/MCPBase.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { IFIXParser, Logger } from 'fixparser';
|
|
2
|
-
import type { IPlugin } from 'fixparser-common';
|
|
3
|
-
import type { VerifiedOrder } from './schemas';
|
|
4
|
-
import type { MarketDataPrices, PendingRequests } from './utils/messageHandler';
|
|
5
|
-
export declare abstract class MCPBase implements IPlugin<IFIXParser> {
|
|
6
|
-
/**
|
|
7
|
-
* Optional logger instance for diagnostics and output.
|
|
8
|
-
* @protected
|
|
9
|
-
*/
|
|
10
|
-
protected logger: Logger | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* FIXParser instance, set during plugin register().
|
|
13
|
-
* @protected
|
|
14
|
-
*/
|
|
15
|
-
protected parser: IFIXParser | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Called when server is setup and listening.
|
|
18
|
-
* @protected
|
|
19
|
-
*/
|
|
20
|
-
protected onReady: (() => void) | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Map to store verified orders before execution
|
|
23
|
-
* @protected
|
|
24
|
-
*/
|
|
25
|
-
protected verifiedOrders: Map<string, VerifiedOrder>;
|
|
26
|
-
/**
|
|
27
|
-
* Map to store pending market data requests
|
|
28
|
-
* @protected
|
|
29
|
-
*/
|
|
30
|
-
protected pendingRequests: PendingRequests;
|
|
31
|
-
/**
|
|
32
|
-
* Map to store market data prices
|
|
33
|
-
* @protected
|
|
34
|
-
*/
|
|
35
|
-
protected marketDataPrices: MarketDataPrices;
|
|
36
|
-
/**
|
|
37
|
-
* Maximum number of price history entries to keep per symbol
|
|
38
|
-
* @protected
|
|
39
|
-
*/
|
|
40
|
-
protected readonly MAX_PRICE_HISTORY = 100000;
|
|
41
|
-
constructor({
|
|
42
|
-
logger,
|
|
43
|
-
onReady,
|
|
44
|
-
}: {
|
|
45
|
-
logger?: Logger;
|
|
46
|
-
onReady?: () => void;
|
|
47
|
-
});
|
|
48
|
-
abstract register(parser: IFIXParser): Promise<void>;
|
|
49
|
-
}
|
package/types/MCPLocal.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IFIXParser, Message } from 'fixparser';
|
|
2
|
-
import { MCPBase } from './MCPBase';
|
|
3
|
-
import type { PluginOptions } from './PluginOptions';
|
|
4
|
-
import type { VerifiedOrder } from './schemas';
|
|
5
|
-
import type { MarketDataEntry } from './schemas/marketData.ts';
|
|
6
|
-
export declare class MCPLocal extends MCPBase {
|
|
7
|
-
/**
|
|
8
|
-
* Map to store verified orders before execution
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
protected verifiedOrders: Map<string, VerifiedOrder>;
|
|
12
|
-
/**
|
|
13
|
-
* Map to store pending requests and their callbacks
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
protected pendingRequests: Map<string, (data: Message) => void>;
|
|
17
|
-
/**
|
|
18
|
-
* Map to store market data prices for each symbol
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
protected marketDataPrices: Map<string, MarketDataEntry[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Maximum number of price history entries to keep per symbol
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
protected readonly MAX_PRICE_HISTORY = 100000;
|
|
27
|
-
private server;
|
|
28
|
-
private transport;
|
|
29
|
-
constructor({ logger, onReady }: PluginOptions);
|
|
30
|
-
register(parser: IFIXParser): Promise<void>;
|
|
31
|
-
private addWorkflows;
|
|
32
|
-
}
|
package/types/MCPRemote.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { IFIXParser, Message } from 'fixparser';
|
|
2
|
-
import { MCPBase } from './MCPBase';
|
|
3
|
-
import type { PluginOptions } from './PluginOptions';
|
|
4
|
-
import type { VerifiedOrder } from './schemas';
|
|
5
|
-
import type { MarketDataEntry } from './schemas/marketData.ts';
|
|
6
|
-
export type RemotePluginOptions = PluginOptions & {
|
|
7
|
-
port: number;
|
|
8
|
-
};
|
|
9
|
-
export declare class MCPRemote extends MCPBase {
|
|
10
|
-
/**
|
|
11
|
-
* Port number the server will listen on.
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
private port;
|
|
15
|
-
/**
|
|
16
|
-
* Node.js HTTP server instance created internally.
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
private httpServer;
|
|
20
|
-
/**
|
|
21
|
-
* MCP server instance handling MCP protocol logic.
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
private mcpServer;
|
|
25
|
-
/**
|
|
26
|
-
* Optional name of the plugin/server instance.
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
private serverName;
|
|
30
|
-
/**
|
|
31
|
-
* Optional version string of the plugin/server.
|
|
32
|
-
* @private
|
|
33
|
-
*/
|
|
34
|
-
private serverVersion;
|
|
35
|
-
/**
|
|
36
|
-
* Map to store verified orders before execution
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
protected verifiedOrders: Map<string, VerifiedOrder>;
|
|
40
|
-
/**
|
|
41
|
-
* Map to store pending requests and their callbacks
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
protected pendingRequests: Map<string, (data: Message) => void>;
|
|
45
|
-
/**
|
|
46
|
-
* Map to store market data prices for each symbol
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
protected marketDataPrices: Map<string, MarketDataEntry[]>;
|
|
50
|
-
/**
|
|
51
|
-
* Maximum number of price history entries to keep per symbol
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
protected readonly MAX_PRICE_HISTORY = 100000;
|
|
55
|
-
constructor({ port, logger, onReady }: RemotePluginOptions);
|
|
56
|
-
register(parser: IFIXParser): Promise<void>;
|
|
57
|
-
private setupTools;
|
|
58
|
-
}
|
package/types/PluginOptions.d.ts
DELETED
package/types/index.d.ts
DELETED
package/types/schemas/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
export interface VerifiedOrder {
|
|
3
|
-
clOrdID: string;
|
|
4
|
-
handlInst: string;
|
|
5
|
-
quantity: number;
|
|
6
|
-
price: number;
|
|
7
|
-
ordType: string;
|
|
8
|
-
side: string;
|
|
9
|
-
symbol: string;
|
|
10
|
-
timeInForce: string;
|
|
11
|
-
}
|
|
12
|
-
export type ToolHandler = (args: any) => Promise<CallToolResult>;
|
|
13
|
-
export interface ToolHandlers {
|
|
14
|
-
[key: string]: ToolHandler;
|
|
15
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export type MarketDataEntry = {
|
|
2
|
-
timestamp: number;
|
|
3
|
-
bid: number;
|
|
4
|
-
offer: number;
|
|
5
|
-
spread: number;
|
|
6
|
-
volume: number;
|
|
7
|
-
trade: number;
|
|
8
|
-
indexValue: number;
|
|
9
|
-
openingPrice: number;
|
|
10
|
-
closingPrice: number;
|
|
11
|
-
settlementPrice: number;
|
|
12
|
-
tradingSessionHighPrice: number;
|
|
13
|
-
tradingSessionLowPrice: number;
|
|
14
|
-
vwap: number;
|
|
15
|
-
imbalance: number;
|
|
16
|
-
openInterest: number;
|
|
17
|
-
compositeUnderlyingPrice: number;
|
|
18
|
-
simulatedSellPrice: number;
|
|
19
|
-
simulatedBuyPrice: number;
|
|
20
|
-
marginRate: number;
|
|
21
|
-
midPrice: number;
|
|
22
|
-
emptyBook: number;
|
|
23
|
-
settleHighPrice: number;
|
|
24
|
-
settleLowPrice: number;
|
|
25
|
-
priorSettlePrice: number;
|
|
26
|
-
sessionHighBid: number;
|
|
27
|
-
sessionLowOffer: number;
|
|
28
|
-
earlyPrices: number;
|
|
29
|
-
auctionClearingPrice: number;
|
|
30
|
-
swapValueFactor: number;
|
|
31
|
-
dailyValueAdjustmentForLongPositions: number;
|
|
32
|
-
cumulativeValueAdjustmentForLongPositions: number;
|
|
33
|
-
dailyValueAdjustmentForShortPositions: number;
|
|
34
|
-
cumulativeValueAdjustmentForShortPositions: number;
|
|
35
|
-
fixingPrice: number;
|
|
36
|
-
cashRate: number;
|
|
37
|
-
recoveryRate: number;
|
|
38
|
-
recoveryRateForLong: number;
|
|
39
|
-
recoveryRateForShort: number;
|
|
40
|
-
marketBid: number;
|
|
41
|
-
marketOffer: number;
|
|
42
|
-
shortSaleMinPrice: number;
|
|
43
|
-
previousClosingPrice: number;
|
|
44
|
-
thresholdLimitPriceBanding: number;
|
|
45
|
-
dailyFinancingValue: number;
|
|
46
|
-
accruedFinancingValue: number;
|
|
47
|
-
twap: number;
|
|
48
|
-
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
export declare const toolSchemas: {
|
|
2
|
-
parse: {
|
|
3
|
-
description: string;
|
|
4
|
-
schema: {
|
|
5
|
-
type: string;
|
|
6
|
-
properties: {
|
|
7
|
-
fixString: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
required: string[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
parseToJSON: {
|
|
15
|
-
description: string;
|
|
16
|
-
schema: {
|
|
17
|
-
type: string;
|
|
18
|
-
properties: {
|
|
19
|
-
fixString: {
|
|
20
|
-
type: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
required: string[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
verifyOrder: {
|
|
27
|
-
description: string;
|
|
28
|
-
schema: {
|
|
29
|
-
type: string;
|
|
30
|
-
properties: {
|
|
31
|
-
clOrdID: {
|
|
32
|
-
type: string;
|
|
33
|
-
};
|
|
34
|
-
handlInst: {
|
|
35
|
-
type: string;
|
|
36
|
-
enum: string[];
|
|
37
|
-
description: string;
|
|
38
|
-
};
|
|
39
|
-
quantity: {
|
|
40
|
-
type: string;
|
|
41
|
-
};
|
|
42
|
-
price: {
|
|
43
|
-
type: string;
|
|
44
|
-
};
|
|
45
|
-
ordType: {
|
|
46
|
-
type: string;
|
|
47
|
-
enum: string[];
|
|
48
|
-
description: string;
|
|
49
|
-
};
|
|
50
|
-
side: {
|
|
51
|
-
type: string;
|
|
52
|
-
enum: string[];
|
|
53
|
-
description: string;
|
|
54
|
-
};
|
|
55
|
-
symbol: {
|
|
56
|
-
type: string;
|
|
57
|
-
};
|
|
58
|
-
timeInForce: {
|
|
59
|
-
type: string;
|
|
60
|
-
enum: string[];
|
|
61
|
-
description: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
required: string[];
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
executeOrder: {
|
|
68
|
-
description: string;
|
|
69
|
-
schema: {
|
|
70
|
-
type: string;
|
|
71
|
-
properties: {
|
|
72
|
-
clOrdID: {
|
|
73
|
-
type: string;
|
|
74
|
-
};
|
|
75
|
-
handlInst: {
|
|
76
|
-
type: string;
|
|
77
|
-
enum: string[];
|
|
78
|
-
description: string;
|
|
79
|
-
};
|
|
80
|
-
quantity: {
|
|
81
|
-
type: string;
|
|
82
|
-
};
|
|
83
|
-
price: {
|
|
84
|
-
type: string;
|
|
85
|
-
};
|
|
86
|
-
ordType: {
|
|
87
|
-
type: string;
|
|
88
|
-
enum: string[];
|
|
89
|
-
description: string;
|
|
90
|
-
};
|
|
91
|
-
side: {
|
|
92
|
-
type: string;
|
|
93
|
-
enum: string[];
|
|
94
|
-
description: string;
|
|
95
|
-
};
|
|
96
|
-
symbol: {
|
|
97
|
-
type: string;
|
|
98
|
-
};
|
|
99
|
-
timeInForce: {
|
|
100
|
-
type: string;
|
|
101
|
-
enum: string[];
|
|
102
|
-
description: string;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
required: string[];
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
marketDataRequest: {
|
|
109
|
-
description: string;
|
|
110
|
-
schema: {
|
|
111
|
-
type: string;
|
|
112
|
-
properties: {
|
|
113
|
-
mdUpdateType: {
|
|
114
|
-
type: string;
|
|
115
|
-
enum: string[];
|
|
116
|
-
description: string;
|
|
117
|
-
};
|
|
118
|
-
symbols: {
|
|
119
|
-
type: string;
|
|
120
|
-
items: {
|
|
121
|
-
type: string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
mdReqID: {
|
|
125
|
-
type: string;
|
|
126
|
-
};
|
|
127
|
-
subscriptionRequestType: {
|
|
128
|
-
type: string;
|
|
129
|
-
enum: string[];
|
|
130
|
-
description: string;
|
|
131
|
-
};
|
|
132
|
-
mdEntryTypes: {
|
|
133
|
-
type: string;
|
|
134
|
-
items: {
|
|
135
|
-
type: string;
|
|
136
|
-
enum: string[];
|
|
137
|
-
};
|
|
138
|
-
description: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
required: string[];
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
getStockGraph: {
|
|
145
|
-
description: string;
|
|
146
|
-
schema: {
|
|
147
|
-
type: string;
|
|
148
|
-
properties: {
|
|
149
|
-
symbol: {
|
|
150
|
-
type: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
required: string[];
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
getStockPriceHistory: {
|
|
157
|
-
description: string;
|
|
158
|
-
schema: {
|
|
159
|
-
type: string;
|
|
160
|
-
properties: {
|
|
161
|
-
symbol: {
|
|
162
|
-
type: string;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
required: string[];
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
};
|
package/types/tools/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IFIXParser, Message } from 'fixparser';
|
|
2
|
-
import type { ToolHandlers, VerifiedOrder } from '../schemas';
|
|
3
|
-
export declare const createToolHandlers: (
|
|
4
|
-
parser: IFIXParser,
|
|
5
|
-
verifiedOrders: Map<string, VerifiedOrder>,
|
|
6
|
-
pendingRequests: Map<string, (data: Message) => void>,
|
|
7
|
-
marketDataPrices: Map<
|
|
8
|
-
string,
|
|
9
|
-
{
|
|
10
|
-
timestamp: number;
|
|
11
|
-
bid: number;
|
|
12
|
-
offer: number;
|
|
13
|
-
spread: number;
|
|
14
|
-
volume: number;
|
|
15
|
-
}[]
|
|
16
|
-
>,
|
|
17
|
-
) => ToolHandlers;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { type IFIXParser, type Message } from 'fixparser';
|
|
3
|
-
export declare const createMarketDataRequestHandler: (
|
|
4
|
-
parser: IFIXParser,
|
|
5
|
-
pendingRequests: Map<string, (data: Message) => void>,
|
|
6
|
-
) => (args: {
|
|
7
|
-
mdUpdateType: string;
|
|
8
|
-
symbols: string[];
|
|
9
|
-
mdReqID: string;
|
|
10
|
-
subscriptionRequestType: string;
|
|
11
|
-
mdEntryTypes?: string[];
|
|
12
|
-
}) => Promise<CallToolResult>;
|
|
13
|
-
export declare const createGetStockGraphHandler: (
|
|
14
|
-
marketDataPrices: Map<
|
|
15
|
-
string,
|
|
16
|
-
Array<{
|
|
17
|
-
timestamp: number;
|
|
18
|
-
bid: number;
|
|
19
|
-
offer: number;
|
|
20
|
-
spread: number;
|
|
21
|
-
volume: number;
|
|
22
|
-
}>
|
|
23
|
-
>,
|
|
24
|
-
) => (args: {
|
|
25
|
-
symbol: string;
|
|
26
|
-
}) => Promise<CallToolResult>;
|
|
27
|
-
export declare const createGetStockPriceHistoryHandler: (
|
|
28
|
-
marketDataPrices: Map<
|
|
29
|
-
string,
|
|
30
|
-
Array<{
|
|
31
|
-
timestamp: number;
|
|
32
|
-
bid: number;
|
|
33
|
-
offer: number;
|
|
34
|
-
spread: number;
|
|
35
|
-
volume: number;
|
|
36
|
-
}>
|
|
37
|
-
>,
|
|
38
|
-
) => (args: {
|
|
39
|
-
symbol: string;
|
|
40
|
-
}) => Promise<CallToolResult>;
|
package/types/tools/order.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { type IFIXParser, type Message } from 'fixparser';
|
|
3
|
-
import type { VerifiedOrder } from '../schemas';
|
|
4
|
-
export declare const createVerifyOrderHandler: (
|
|
5
|
-
parser: IFIXParser,
|
|
6
|
-
verifiedOrders: Map<string, VerifiedOrder>,
|
|
7
|
-
) => (args: VerifiedOrder) => Promise<CallToolResult>;
|
|
8
|
-
export declare const createExecuteOrderHandler: (
|
|
9
|
-
parser: IFIXParser,
|
|
10
|
-
verifiedOrders: Map<string, VerifiedOrder>,
|
|
11
|
-
pendingRequests: Map<string, (data: Message) => void>,
|
|
12
|
-
) => (args: VerifiedOrder) => Promise<CallToolResult>;
|
package/types/tools/parse.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type IFIXParser, type Message } from 'fixparser';
|
|
2
|
-
import type { MarketDataEntry } from '../schemas/marketData.ts';
|
|
3
|
-
export type PendingRequests = Map<string, (data: Message) => void>;
|
|
4
|
-
export type MarketDataPrices = Map<string, MarketDataEntry[]>;
|
|
5
|
-
export declare function handleMessage(
|
|
6
|
-
message: Message,
|
|
7
|
-
parser: IFIXParser,
|
|
8
|
-
pendingRequests: PendingRequests,
|
|
9
|
-
marketDataPrices: MarketDataPrices,
|
|
10
|
-
maxPriceHistory: number,
|
|
11
|
-
onPriceUpdate?: (symbol: string, data: MarketDataEntry) => void,
|
|
12
|
-
): void;
|