@memberjunction/core-actions 3.2.0 → 3.4.0
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/dist/custom/mcp/execute-mcp-tool.action.d.ts +50 -0
- package/dist/custom/mcp/execute-mcp-tool.action.d.ts.map +1 -0
- package/dist/custom/mcp/execute-mcp-tool.action.js +174 -0
- package/dist/custom/mcp/execute-mcp-tool.action.js.map +1 -0
- package/dist/custom/mcp/index.d.ts +20 -0
- package/dist/custom/mcp/index.d.ts.map +1 -0
- package/dist/custom/mcp/index.js +48 -0
- package/dist/custom/mcp/index.js.map +1 -0
- package/dist/custom/mcp/list-mcp-tools.action.d.ts +43 -0
- package/dist/custom/mcp/list-mcp-tools.action.d.ts.map +1 -0
- package/dist/custom/mcp/list-mcp-tools.action.js +135 -0
- package/dist/custom/mcp/list-mcp-tools.action.js.map +1 -0
- package/dist/custom/mcp/mcp-tool.action.d.ts +71 -0
- package/dist/custom/mcp/mcp-tool.action.d.ts.map +1 -0
- package/dist/custom/mcp/mcp-tool.action.js +230 -0
- package/dist/custom/mcp/mcp-tool.action.js.map +1 -0
- package/dist/custom/mcp/sync-mcp-tools.action.d.ts +44 -0
- package/dist/custom/mcp/sync-mcp-tools.action.d.ts.map +1 -0
- package/dist/custom/mcp/sync-mcp-tools.action.js +130 -0
- package/dist/custom/mcp/sync-mcp-tools.action.js.map +1 -0
- package/dist/custom/mcp/test-mcp-connection.action.d.ts +43 -0
- package/dist/custom/mcp/test-mcp-connection.action.d.ts.map +1 -0
- package/dist/custom/mcp/test-mcp-connection.action.js +125 -0
- package/dist/custom/mcp/test-mcp-connection.action.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +28 -27
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Generic driver class for MCP Tool Actions
|
|
4
|
+
*
|
|
5
|
+
* This class handles execution of auto-generated Actions that are linked to
|
|
6
|
+
* MCP Server Tools via the GeneratedActionID field. When an MCP tool is synced
|
|
7
|
+
* to an Action (under System/AI/MCP/{ServerName}), this driver class is used
|
|
8
|
+
* to execute it.
|
|
9
|
+
*
|
|
10
|
+
* The class:
|
|
11
|
+
* 1. Looks up the MCPServerTool using params.Action.ID (matching GeneratedActionID)
|
|
12
|
+
* 2. Finds an active connection for the tool's server
|
|
13
|
+
* 3. Maps Action parameters to tool arguments
|
|
14
|
+
* 4. Calls the tool via MCPClientManager
|
|
15
|
+
*
|
|
16
|
+
* @module @memberjunction/actions/mcp/mcp-tool
|
|
17
|
+
*/
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.LoadMCPToolAction = exports.MCPToolAction = void 0;
|
|
26
|
+
const global_1 = require("@memberjunction/global");
|
|
27
|
+
const actions_1 = require("@memberjunction/actions");
|
|
28
|
+
const core_1 = require("@memberjunction/core");
|
|
29
|
+
const ai_mcp_client_1 = require("@memberjunction/ai-mcp-client");
|
|
30
|
+
/**
|
|
31
|
+
* Generic driver class for all auto-generated MCP Tool Actions.
|
|
32
|
+
*
|
|
33
|
+
* When an MCP Server Tool is synced to an Action (via syncActionsForServer),
|
|
34
|
+
* the Action's DriverClass is set to 'MCPToolAction'. This class handles
|
|
35
|
+
* execution of all such actions by:
|
|
36
|
+
*
|
|
37
|
+
* 1. Looking up the MCPServerTool entity that has GeneratedActionID = Action.ID
|
|
38
|
+
* 2. Finding an active connection for the tool's server
|
|
39
|
+
* 3. Mapping ActionParams to tool arguments (using param Name as key)
|
|
40
|
+
* 4. Calling the MCP tool and returning the result
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // An Action with DriverClass='MCPToolAction' will be handled by this class
|
|
44
|
+
* // The tool is identified by looking up MCPServerTool.GeneratedActionID = Action.ID
|
|
45
|
+
*
|
|
46
|
+
* await runAction({
|
|
47
|
+
* ActionName: 'search_documentation', // Name matches ToolName from MCP Server
|
|
48
|
+
* Params: [
|
|
49
|
+
* { Name: 'query', Value: 'MemberJunction API' },
|
|
50
|
+
* { Name: 'maxResults', Value: 10 }
|
|
51
|
+
* ]
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* **Optional Parameter:**
|
|
55
|
+
* - `ConnectionID` (optional): Specific connection to use. If not provided,
|
|
56
|
+
* an active connection for the server will be automatically selected.
|
|
57
|
+
*/
|
|
58
|
+
let MCPToolAction = class MCPToolAction extends actions_1.BaseAction {
|
|
59
|
+
async InternalRunAction(params) {
|
|
60
|
+
try {
|
|
61
|
+
const actionId = params.Action.ID;
|
|
62
|
+
const actionName = params.Action.Name;
|
|
63
|
+
(0, core_1.LogStatus)(`[MCPToolAction] Executing action '${actionName}' (ID: ${actionId})`);
|
|
64
|
+
// Step 1: Look up the MCPServerTool by GeneratedActionID
|
|
65
|
+
const tool = await this.lookupMCPServerTool(actionId, params);
|
|
66
|
+
if (!tool) {
|
|
67
|
+
return {
|
|
68
|
+
Success: false,
|
|
69
|
+
ResultCode: 'TOOL_NOT_FOUND',
|
|
70
|
+
Message: `Could not find MCP Server Tool linked to action '${actionName}' (ID: ${actionId}). ` +
|
|
71
|
+
`Ensure the tool has been synced with GeneratedActionID set.`
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
(0, core_1.LogStatus)(`[MCPToolAction] Found tool '${tool.ToolName}' on server '${tool.MCPServer}'`);
|
|
75
|
+
// Step 2: Get the connection (either from params or find an active one)
|
|
76
|
+
const connectionId = await this.resolveConnectionId(tool, params);
|
|
77
|
+
if (!connectionId) {
|
|
78
|
+
return {
|
|
79
|
+
Success: false,
|
|
80
|
+
ResultCode: 'NO_CONNECTION',
|
|
81
|
+
Message: `No active connection available for MCP Server '${tool.MCPServer}'. ` +
|
|
82
|
+
`Please create an active connection or provide a ConnectionID parameter.`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// Step 3: Build arguments from ActionParams
|
|
86
|
+
const toolArguments = this.buildToolArguments(params);
|
|
87
|
+
(0, core_1.LogStatus)(`[MCPToolAction] Calling tool '${tool.ToolName}' via connection '${connectionId}'`);
|
|
88
|
+
// Step 4: Get the MCP Client Manager and ensure connected
|
|
89
|
+
const manager = ai_mcp_client_1.MCPClientManager.Instance;
|
|
90
|
+
if (!manager.isConnected(connectionId)) {
|
|
91
|
+
await manager.connect(connectionId, {
|
|
92
|
+
contextUser: params.ContextUser,
|
|
93
|
+
skipAutoSync: true
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// Step 5: Call the tool
|
|
97
|
+
const timeout = this.getNumericParam(params, 'Timeout', 60000);
|
|
98
|
+
const result = await manager.callTool(connectionId, tool.ToolName, {
|
|
99
|
+
arguments: toolArguments,
|
|
100
|
+
timeout
|
|
101
|
+
}, { contextUser: params.ContextUser });
|
|
102
|
+
// Step 6: Add output parameters
|
|
103
|
+
this.addOutputParam(params, 'ToolOutput', result.content);
|
|
104
|
+
this.addOutputParam(params, 'StructuredOutput', result.structuredContent);
|
|
105
|
+
this.addOutputParam(params, 'DurationMs', result.durationMs);
|
|
106
|
+
this.addOutputParam(params, 'IsToolError', result.isToolError);
|
|
107
|
+
this.addOutputParam(params, 'ToolName', tool.ToolName);
|
|
108
|
+
this.addOutputParam(params, 'ServerName', tool.MCPServer);
|
|
109
|
+
if (!result.success) {
|
|
110
|
+
return {
|
|
111
|
+
Success: false,
|
|
112
|
+
ResultCode: result.isToolError ? 'TOOL_ERROR' : 'EXECUTION_FAILED',
|
|
113
|
+
Message: result.error ?? `Tool '${tool.ToolName}' execution failed`,
|
|
114
|
+
Params: params.Params
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
// Format output message
|
|
118
|
+
const output = result.structuredContent ?? result.content;
|
|
119
|
+
const message = typeof output === 'string' ? output : JSON.stringify(output, null, 2);
|
|
120
|
+
return {
|
|
121
|
+
Success: true,
|
|
122
|
+
ResultCode: 'SUCCESS',
|
|
123
|
+
Message: message,
|
|
124
|
+
Params: params.Params
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
(0, core_1.LogError)(`[MCPToolAction] Error executing action '${params.Action?.Name}': ${error}`);
|
|
129
|
+
return {
|
|
130
|
+
Success: false,
|
|
131
|
+
ResultCode: 'UNEXPECTED_ERROR',
|
|
132
|
+
Message: error instanceof Error ? error.message : String(error)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Looks up the MCPServerTool entity that has GeneratedActionID matching the action ID.
|
|
138
|
+
*/
|
|
139
|
+
async lookupMCPServerTool(actionId, params) {
|
|
140
|
+
const rv = new core_1.RunView();
|
|
141
|
+
const result = await rv.RunView({
|
|
142
|
+
EntityName: 'MJ: MCP Server Tools',
|
|
143
|
+
ExtraFilter: `GeneratedActionID='${actionId}'`,
|
|
144
|
+
ResultType: 'entity_object'
|
|
145
|
+
}, params.ContextUser);
|
|
146
|
+
if (!result.Success || result.Results.length === 0) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return result.Results[0];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolves the connection ID to use for the tool execution.
|
|
153
|
+
* First checks for an explicit ConnectionID parameter, then finds an active connection.
|
|
154
|
+
*/
|
|
155
|
+
async resolveConnectionId(tool, params) {
|
|
156
|
+
// Check for explicit ConnectionID parameter
|
|
157
|
+
const explicitConnectionId = this.getStringParam(params, 'ConnectionID');
|
|
158
|
+
if (explicitConnectionId) {
|
|
159
|
+
return explicitConnectionId;
|
|
160
|
+
}
|
|
161
|
+
// Find an active connection for the tool's server
|
|
162
|
+
const rv = new core_1.RunView();
|
|
163
|
+
const result = await rv.RunView({
|
|
164
|
+
EntityName: 'MJ: MCP Server Connections',
|
|
165
|
+
ExtraFilter: `MCPServerID='${tool.MCPServerID}' AND Status='Active'`,
|
|
166
|
+
OrderBy: '__mj_CreatedAt ASC', // Use oldest connection as default
|
|
167
|
+
MaxRows: 1,
|
|
168
|
+
ResultType: 'entity_object'
|
|
169
|
+
}, params.ContextUser);
|
|
170
|
+
if (!result.Success || result.Results.length === 0) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return result.Results[0].ID;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Builds the tool arguments object from ActionParams.
|
|
177
|
+
* Excludes system parameters like ConnectionID and Timeout.
|
|
178
|
+
*/
|
|
179
|
+
buildToolArguments(params) {
|
|
180
|
+
const systemParams = new Set(['connectionid', 'timeout']);
|
|
181
|
+
const args = {};
|
|
182
|
+
for (const param of params.Params) {
|
|
183
|
+
// Skip output params and system params
|
|
184
|
+
if (param.Type === 'Output' || systemParams.has(param.Name.toLowerCase())) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
// Add to arguments using original param name
|
|
188
|
+
if (param.Value !== undefined && param.Value !== null) {
|
|
189
|
+
args[param.Name] = param.Value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return args;
|
|
193
|
+
}
|
|
194
|
+
// Helper methods for parameter extraction
|
|
195
|
+
getStringParam(params, name) {
|
|
196
|
+
const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
|
|
197
|
+
if (!param || param.Value === undefined || param.Value === null) {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
const value = String(param.Value).trim();
|
|
201
|
+
return value.length > 0 ? value : undefined;
|
|
202
|
+
}
|
|
203
|
+
getNumericParam(params, name, defaultValue) {
|
|
204
|
+
const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
|
|
205
|
+
if (!param || param.Value === undefined || param.Value === null) {
|
|
206
|
+
return defaultValue;
|
|
207
|
+
}
|
|
208
|
+
const parsed = Number(param.Value);
|
|
209
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
210
|
+
}
|
|
211
|
+
addOutputParam(params, name, value) {
|
|
212
|
+
params.Params.push({
|
|
213
|
+
Name: name,
|
|
214
|
+
Type: 'Output',
|
|
215
|
+
Value: value
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
exports.MCPToolAction = MCPToolAction;
|
|
220
|
+
exports.MCPToolAction = MCPToolAction = __decorate([
|
|
221
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "MCPToolAction")
|
|
222
|
+
], MCPToolAction);
|
|
223
|
+
/**
|
|
224
|
+
* Loader function to prevent tree-shaking
|
|
225
|
+
*/
|
|
226
|
+
function LoadMCPToolAction() {
|
|
227
|
+
// Intentionally empty - ensures decorator executes
|
|
228
|
+
}
|
|
229
|
+
exports.LoadMCPToolAction = LoadMCPToolAction;
|
|
230
|
+
//# sourceMappingURL=mcp-tool.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-tool.action.js","sourceRoot":"","sources":["../../../src/custom/mcp/mcp-tool.action.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;AAGH,mDAAuD;AACvD,qDAAqD;AACrD,+CAAoE;AACpE,iEAAiE;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAU;IAE/B,KAAK,CAAC,iBAAiB,CAAC,MAA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,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;IAEO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QACxE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA1MY,sCAAa;wBAAb,aAAa;IADzB,IAAA,sBAAa,EAAC,oBAAU,EAAE,eAAe,CAAC;GAC9B,aAAa,CA0MzB;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC7B,mDAAmD;AACvD,CAAC;AAFD,8CAEC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Action to synchronize tools from an MCP server to the database
|
|
3
|
+
*
|
|
4
|
+
* This action discovers tools from an MCP server and updates the local
|
|
5
|
+
* tool definitions in the database for discoverability and management.
|
|
6
|
+
*
|
|
7
|
+
* @module @memberjunction/actions/mcp/sync-mcp-tools
|
|
8
|
+
*/
|
|
9
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
10
|
+
import { BaseAction } from "@memberjunction/actions";
|
|
11
|
+
/**
|
|
12
|
+
* Action to synchronize MCP server tools to the database.
|
|
13
|
+
*
|
|
14
|
+
* This action connects to an MCP server, lists all available tools,
|
|
15
|
+
* and updates the local database cache. New tools are added, existing
|
|
16
|
+
* tools are updated, and tools no longer available are marked deprecated.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* await runAction({
|
|
21
|
+
* ActionName: 'Sync MCP Tools',
|
|
22
|
+
* Params: [
|
|
23
|
+
* { Name: 'ConnectionID', Value: 'connection-uuid' }
|
|
24
|
+
* ]
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* **Parameters:**
|
|
29
|
+
* - `ConnectionID` (required): UUID of the MCP Server Connection to sync
|
|
30
|
+
*
|
|
31
|
+
* **Result:**
|
|
32
|
+
* - Success: Sync summary in Message
|
|
33
|
+
* - Output params include: `Added`, `Updated`, `Deprecated`, `Total`
|
|
34
|
+
*/
|
|
35
|
+
export declare class SyncMCPToolsAction extends BaseAction {
|
|
36
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
37
|
+
private getStringParam;
|
|
38
|
+
private addOutputParam;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Loader function to prevent tree-shaking
|
|
42
|
+
*/
|
|
43
|
+
export declare function LoadSyncMCPToolsAction(): void;
|
|
44
|
+
//# sourceMappingURL=sync-mcp-tools.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-mcp-tools.action.d.ts","sourceRoot":"","sources":["../../../src/custom/mcp/sync-mcp-tools.action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,kBAAmB,SAAQ,UAAU;cAE9B,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkEvF,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,cAAc;CAOzB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Action to synchronize tools from an MCP server to the database
|
|
4
|
+
*
|
|
5
|
+
* This action discovers tools from an MCP server and updates the local
|
|
6
|
+
* tool definitions in the database for discoverability and management.
|
|
7
|
+
*
|
|
8
|
+
* @module @memberjunction/actions/mcp/sync-mcp-tools
|
|
9
|
+
*/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.LoadSyncMCPToolsAction = exports.SyncMCPToolsAction = void 0;
|
|
18
|
+
const global_1 = require("@memberjunction/global");
|
|
19
|
+
const actions_1 = require("@memberjunction/actions");
|
|
20
|
+
const core_1 = require("@memberjunction/core");
|
|
21
|
+
const ai_mcp_client_1 = require("@memberjunction/ai-mcp-client");
|
|
22
|
+
/**
|
|
23
|
+
* Action to synchronize MCP server tools to the database.
|
|
24
|
+
*
|
|
25
|
+
* This action connects to an MCP server, lists all available tools,
|
|
26
|
+
* and updates the local database cache. New tools are added, existing
|
|
27
|
+
* tools are updated, and tools no longer available are marked deprecated.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* await runAction({
|
|
32
|
+
* ActionName: 'Sync MCP Tools',
|
|
33
|
+
* Params: [
|
|
34
|
+
* { Name: 'ConnectionID', Value: 'connection-uuid' }
|
|
35
|
+
* ]
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* **Parameters:**
|
|
40
|
+
* - `ConnectionID` (required): UUID of the MCP Server Connection to sync
|
|
41
|
+
*
|
|
42
|
+
* **Result:**
|
|
43
|
+
* - Success: Sync summary in Message
|
|
44
|
+
* - Output params include: `Added`, `Updated`, `Deprecated`, `Total`
|
|
45
|
+
*/
|
|
46
|
+
let SyncMCPToolsAction = class SyncMCPToolsAction extends actions_1.BaseAction {
|
|
47
|
+
async InternalRunAction(params) {
|
|
48
|
+
try {
|
|
49
|
+
// Extract parameters
|
|
50
|
+
const connectionId = this.getStringParam(params, 'ConnectionID');
|
|
51
|
+
// Validate required parameters
|
|
52
|
+
if (!connectionId) {
|
|
53
|
+
return {
|
|
54
|
+
Success: false,
|
|
55
|
+
ResultCode: 'MISSING_PARAMETER',
|
|
56
|
+
Message: "Parameter 'ConnectionID' is required"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Get the MCP Client Manager
|
|
60
|
+
const manager = ai_mcp_client_1.MCPClientManager.Instance;
|
|
61
|
+
// Ensure we're connected
|
|
62
|
+
if (!manager.isConnected(connectionId)) {
|
|
63
|
+
await manager.connect(connectionId, {
|
|
64
|
+
contextUser: params.ContextUser,
|
|
65
|
+
skipAutoSync: true // We'll sync manually
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// Sync tools
|
|
69
|
+
const result = await manager.syncTools(connectionId, {
|
|
70
|
+
contextUser: params.ContextUser
|
|
71
|
+
});
|
|
72
|
+
// Add output parameters
|
|
73
|
+
this.addOutputParam(params, 'Added', result.added);
|
|
74
|
+
this.addOutputParam(params, 'Updated', result.updated);
|
|
75
|
+
this.addOutputParam(params, 'Deprecated', result.deprecated);
|
|
76
|
+
this.addOutputParam(params, 'Total', result.total);
|
|
77
|
+
if (!result.success) {
|
|
78
|
+
return {
|
|
79
|
+
Success: false,
|
|
80
|
+
ResultCode: 'SYNC_FAILED',
|
|
81
|
+
Message: result.error ?? 'Tool synchronization failed',
|
|
82
|
+
Params: params.Params
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const message = `Tool sync completed: ${result.added} added, ${result.updated} updated, ${result.deprecated} deprecated. Total: ${result.total} tools.`;
|
|
86
|
+
return {
|
|
87
|
+
Success: true,
|
|
88
|
+
ResultCode: 'SUCCESS',
|
|
89
|
+
Message: message,
|
|
90
|
+
Params: params.Params
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
(0, core_1.LogError)(`[SyncMCPToolsAction] Error: ${error}`);
|
|
95
|
+
return {
|
|
96
|
+
Success: false,
|
|
97
|
+
ResultCode: 'UNEXPECTED_ERROR',
|
|
98
|
+
Message: error instanceof Error ? error.message : String(error)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Helper methods for parameter extraction
|
|
103
|
+
getStringParam(params, name) {
|
|
104
|
+
const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
|
|
105
|
+
if (!param || param.Value === undefined || param.Value === null) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const value = String(param.Value).trim();
|
|
109
|
+
return value.length > 0 ? value : undefined;
|
|
110
|
+
}
|
|
111
|
+
addOutputParam(params, name, value) {
|
|
112
|
+
params.Params.push({
|
|
113
|
+
Name: name,
|
|
114
|
+
Type: 'Output',
|
|
115
|
+
Value: value
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.SyncMCPToolsAction = SyncMCPToolsAction;
|
|
120
|
+
exports.SyncMCPToolsAction = SyncMCPToolsAction = __decorate([
|
|
121
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "Sync MCP Tools")
|
|
122
|
+
], SyncMCPToolsAction);
|
|
123
|
+
/**
|
|
124
|
+
* Loader function to prevent tree-shaking
|
|
125
|
+
*/
|
|
126
|
+
function LoadSyncMCPToolsAction() {
|
|
127
|
+
// Intentionally empty - ensures decorator executes
|
|
128
|
+
}
|
|
129
|
+
exports.LoadSyncMCPToolsAction = LoadSyncMCPToolsAction;
|
|
130
|
+
//# sourceMappingURL=sync-mcp-tools.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-mcp-tools.action.js","sourceRoot":"","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KAAK,KAAK,IAAI,EAAE,CAAC;YAC9D,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,CAAC;IAEO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QACxE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AApFY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,sBAAa,EAAC,oBAAU,EAAE,gBAAgB,CAAC;GAC/B,kBAAkB,CAoF9B;AAED;;GAEG;AACH,SAAgB,sBAAsB;IAClC,mDAAmD;AACvD,CAAC;AAFD,wDAEC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Action to test an MCP server connection
|
|
3
|
+
*
|
|
4
|
+
* This action verifies connectivity to an MCP server and retrieves
|
|
5
|
+
* server information including name, version, and capabilities.
|
|
6
|
+
*
|
|
7
|
+
* @module @memberjunction/actions/mcp/test-mcp-connection
|
|
8
|
+
*/
|
|
9
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
10
|
+
import { BaseAction } from "@memberjunction/actions";
|
|
11
|
+
/**
|
|
12
|
+
* Action to test an MCP server connection.
|
|
13
|
+
*
|
|
14
|
+
* This action attempts to connect to an MCP server and validates
|
|
15
|
+
* the connection is working. It returns server information and latency.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* await runAction({
|
|
20
|
+
* ActionName: 'Test MCP Connection',
|
|
21
|
+
* Params: [
|
|
22
|
+
* { Name: 'ConnectionID', Value: 'connection-uuid' }
|
|
23
|
+
* ]
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* **Parameters:**
|
|
28
|
+
* - `ConnectionID` (required): UUID of the MCP Server Connection to test
|
|
29
|
+
*
|
|
30
|
+
* **Result:**
|
|
31
|
+
* - Success: Connection details in Message
|
|
32
|
+
* - Output params include: `ServerName`, `ServerVersion`, `LatencyMs`, `Capabilities`
|
|
33
|
+
*/
|
|
34
|
+
export declare class TestMCPConnectionAction extends BaseAction {
|
|
35
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
36
|
+
private getStringParam;
|
|
37
|
+
private addOutputParam;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Loader function to prevent tree-shaking
|
|
41
|
+
*/
|
|
42
|
+
export declare function LoadTestMCPConnectionAction(): void;
|
|
43
|
+
//# sourceMappingURL=test-mcp-connection.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-mcp-connection.action.d.ts","sourceRoot":"","sources":["../../../src/custom/mcp/test-mcp-connection.action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,uBAAwB,SAAQ,UAAU;cAEnC,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8DvF,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,cAAc;CAOzB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Action to test an MCP server connection
|
|
4
|
+
*
|
|
5
|
+
* This action verifies connectivity to an MCP server and retrieves
|
|
6
|
+
* server information including name, version, and capabilities.
|
|
7
|
+
*
|
|
8
|
+
* @module @memberjunction/actions/mcp/test-mcp-connection
|
|
9
|
+
*/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.LoadTestMCPConnectionAction = exports.TestMCPConnectionAction = void 0;
|
|
18
|
+
const global_1 = require("@memberjunction/global");
|
|
19
|
+
const actions_1 = require("@memberjunction/actions");
|
|
20
|
+
const core_1 = require("@memberjunction/core");
|
|
21
|
+
const ai_mcp_client_1 = require("@memberjunction/ai-mcp-client");
|
|
22
|
+
/**
|
|
23
|
+
* Action to test an MCP server connection.
|
|
24
|
+
*
|
|
25
|
+
* This action attempts to connect to an MCP server and validates
|
|
26
|
+
* the connection is working. It returns server information and latency.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* await runAction({
|
|
31
|
+
* ActionName: 'Test MCP Connection',
|
|
32
|
+
* Params: [
|
|
33
|
+
* { Name: 'ConnectionID', Value: 'connection-uuid' }
|
|
34
|
+
* ]
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* **Parameters:**
|
|
39
|
+
* - `ConnectionID` (required): UUID of the MCP Server Connection to test
|
|
40
|
+
*
|
|
41
|
+
* **Result:**
|
|
42
|
+
* - Success: Connection details in Message
|
|
43
|
+
* - Output params include: `ServerName`, `ServerVersion`, `LatencyMs`, `Capabilities`
|
|
44
|
+
*/
|
|
45
|
+
let TestMCPConnectionAction = class TestMCPConnectionAction extends actions_1.BaseAction {
|
|
46
|
+
async InternalRunAction(params) {
|
|
47
|
+
try {
|
|
48
|
+
// Extract parameters
|
|
49
|
+
const connectionId = this.getStringParam(params, 'ConnectionID');
|
|
50
|
+
// Validate required parameters
|
|
51
|
+
if (!connectionId) {
|
|
52
|
+
return {
|
|
53
|
+
Success: false,
|
|
54
|
+
ResultCode: 'MISSING_PARAMETER',
|
|
55
|
+
Message: "Parameter 'ConnectionID' is required"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Get the MCP Client Manager
|
|
59
|
+
const manager = ai_mcp_client_1.MCPClientManager.Instance;
|
|
60
|
+
// Test connection
|
|
61
|
+
const result = await manager.testConnection(connectionId, {
|
|
62
|
+
contextUser: params.ContextUser
|
|
63
|
+
});
|
|
64
|
+
// Add output parameters
|
|
65
|
+
this.addOutputParam(params, 'ServerName', result.serverName);
|
|
66
|
+
this.addOutputParam(params, 'ServerVersion', result.serverVersion);
|
|
67
|
+
this.addOutputParam(params, 'LatencyMs', result.latencyMs);
|
|
68
|
+
this.addOutputParam(params, 'Capabilities', result.capabilities);
|
|
69
|
+
if (!result.success) {
|
|
70
|
+
return {
|
|
71
|
+
Success: false,
|
|
72
|
+
ResultCode: 'CONNECTION_FAILED',
|
|
73
|
+
Message: result.error ?? 'Connection test failed',
|
|
74
|
+
Params: params.Params
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const serverInfo = result.serverName
|
|
78
|
+
? `${result.serverName}${result.serverVersion ? ` v${result.serverVersion}` : ''}`
|
|
79
|
+
: 'Unknown server';
|
|
80
|
+
const message = `Connection successful to ${serverInfo}. Latency: ${result.latencyMs}ms`;
|
|
81
|
+
return {
|
|
82
|
+
Success: true,
|
|
83
|
+
ResultCode: 'SUCCESS',
|
|
84
|
+
Message: message,
|
|
85
|
+
Params: params.Params
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
(0, core_1.LogError)(`[TestMCPConnectionAction] Error: ${error}`);
|
|
90
|
+
return {
|
|
91
|
+
Success: false,
|
|
92
|
+
ResultCode: 'UNEXPECTED_ERROR',
|
|
93
|
+
Message: error instanceof Error ? error.message : String(error)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Helper methods for parameter extraction
|
|
98
|
+
getStringParam(params, name) {
|
|
99
|
+
const param = params.Params.find(p => p.Name.trim().toLowerCase() === name.toLowerCase());
|
|
100
|
+
if (!param || param.Value === undefined || param.Value === null) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
const value = String(param.Value).trim();
|
|
104
|
+
return value.length > 0 ? value : undefined;
|
|
105
|
+
}
|
|
106
|
+
addOutputParam(params, name, value) {
|
|
107
|
+
params.Params.push({
|
|
108
|
+
Name: name,
|
|
109
|
+
Type: 'Output',
|
|
110
|
+
Value: value
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.TestMCPConnectionAction = TestMCPConnectionAction;
|
|
115
|
+
exports.TestMCPConnectionAction = TestMCPConnectionAction = __decorate([
|
|
116
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "Test MCP Connection")
|
|
117
|
+
], TestMCPConnectionAction);
|
|
118
|
+
/**
|
|
119
|
+
* Loader function to prevent tree-shaking
|
|
120
|
+
*/
|
|
121
|
+
function LoadTestMCPConnectionAction() {
|
|
122
|
+
// Intentionally empty - ensures decorator executes
|
|
123
|
+
}
|
|
124
|
+
exports.LoadTestMCPConnectionAction = LoadTestMCPConnectionAction;
|
|
125
|
+
//# sourceMappingURL=test-mcp-connection.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-mcp-connection.action.js","sourceRoot":"","sources":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M,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,CAAC;IAEO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QACxE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAhFY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,sBAAa,EAAC,oBAAU,EAAE,qBAAqB,CAAC;GACpC,uBAAuB,CAgFnC;AAED;;GAEG;AACH,SAAgB,2BAA2B;IACvC,mDAAmD;AACvD,CAAC;AAFD,kEAEC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -74,5 +74,6 @@ export * from './custom/visualization/shared/svg-types';
|
|
|
74
74
|
export * from './custom/visualization/shared/svg-utils';
|
|
75
75
|
export * from './custom/visualization/shared/svg-theming';
|
|
76
76
|
export * from './custom/visualization/shared/mermaid-types';
|
|
77
|
+
export * from './custom/mcp';
|
|
77
78
|
export declare function LoadAllCoreActions(): void;
|
|
78
79
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAG9C,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAG5D,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,C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AAC;AACpE,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,yDAAyD,CAAC;AACxE,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAG5D,cAAc,cAAc,CAAC;AA8F7B,wBAAgB,kBAAkB,SAgGjC"}
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,8 @@ __exportStar(require("./custom/visualization/shared/svg-types"), exports);
|
|
|
108
108
|
__exportStar(require("./custom/visualization/shared/svg-utils"), exports);
|
|
109
109
|
__exportStar(require("./custom/visualization/shared/svg-theming"), exports);
|
|
110
110
|
__exportStar(require("./custom/visualization/shared/mermaid-types"), exports);
|
|
111
|
+
// MCP Actions
|
|
112
|
+
__exportStar(require("./custom/mcp"), exports);
|
|
111
113
|
// Import Load functions to prevent tree shaking of @RegisterClass decorators
|
|
112
114
|
const send_single_message_action_1 = require("./custom/communication/send-single-message.action");
|
|
113
115
|
const slack_webhook_action_1 = require("./custom/communication/slack-webhook.action");
|
|
@@ -198,6 +200,7 @@ const core_entities_server_1 = require("@memberjunction/core-entities-server");
|
|
|
198
200
|
const crud_1 = require("./custom/crud");
|
|
199
201
|
const execute_code_action_1 = require("./custom/code-execution/execute-code.action");
|
|
200
202
|
const lists_1 = require("./custom/lists");
|
|
203
|
+
const mcp_1 = require("./custom/mcp");
|
|
201
204
|
function LoadAllCoreActions() {
|
|
202
205
|
(0, action_subclasses_1.LoadGeneratedActions)();
|
|
203
206
|
// Call all Load functions to ensure @RegisterClass decorators execute
|
|
@@ -290,6 +293,8 @@ function LoadAllCoreActions() {
|
|
|
290
293
|
(0, betty_action_1.LoadBettyAction)();
|
|
291
294
|
// List Management Actions
|
|
292
295
|
(0, lists_1.LoadListActions)();
|
|
296
|
+
// MCP Actions
|
|
297
|
+
(0, mcp_1.LoadAllMCPActions)();
|
|
293
298
|
}
|
|
294
299
|
exports.LoadAllCoreActions = LoadAllCoreActions;
|
|
295
300
|
// ensure that the core entities server sub-classes are loaded and not tree-shaken out
|