@alpic80/rivet-core 1.24.2-aidon.8 → 1.24.2-aidon.9
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/cjs/bundle.cjs +125 -33
- package/dist/cjs/bundle.cjs.map +2 -2
- package/dist/esm/integrations/mcp/MCPBase.js +13 -0
- package/dist/esm/model/nodes/HttpCallNode.js +2 -2
- package/dist/esm/model/nodes/MCPDiscoveryNode.js +33 -4
- package/dist/esm/model/nodes/MCPGetPromptNode.js +33 -4
- package/dist/esm/model/nodes/MCPToolCallNode.js +34 -5
- package/dist/types/integrations/mcp/MCPBase.d.ts +2 -0
- package/dist/types/integrations/mcp/MCPProvider.d.ts +4 -4
- package/package.json +2 -2
|
@@ -23,6 +23,13 @@ export const getMCPBaseInputs = (data) => {
|
|
|
23
23
|
description: 'The endpoint URL for the MCP server',
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
if (data.transportType === 'http' && data.useHeadersInput) {
|
|
27
|
+
inputs.push({
|
|
28
|
+
dataType: 'object',
|
|
29
|
+
id: 'headers',
|
|
30
|
+
title: 'Headers',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
26
33
|
return inputs;
|
|
27
34
|
};
|
|
28
35
|
export const getMCPBaseEditors = async (context, data) => {
|
|
@@ -71,6 +78,12 @@ export const getMCPBaseEditors = async (context, data) => {
|
|
|
71
78
|
dataKey: 'serverUrl',
|
|
72
79
|
useInputToggleDataKey: 'useServerUrlInput',
|
|
73
80
|
helperMessage: 'The endpoint URL for the MCP server to connect',
|
|
81
|
+
}, {
|
|
82
|
+
type: 'code',
|
|
83
|
+
label: 'Headers',
|
|
84
|
+
dataKey: 'headers',
|
|
85
|
+
useInputToggleDataKey: 'useHeadersInput',
|
|
86
|
+
language: 'json',
|
|
74
87
|
});
|
|
75
88
|
}
|
|
76
89
|
else if (data.transportType === 'stdio') {
|
|
@@ -141,7 +141,7 @@ export class HttpCallNodeImpl extends NodeImpl {
|
|
|
141
141
|
return dedent `
|
|
142
142
|
${this.data.useMethodInput ? '(Method Using Input)' : this.data.method} ${this.data.useUrlInput ? '(URL Using Input)' : this.data.url} ${this.data.useHeadersInput
|
|
143
143
|
? '\nHeaders: (Using Input)'
|
|
144
|
-
: this.data.headers
|
|
144
|
+
: this.data.headers?.trim()
|
|
145
145
|
? `\nHeaders: ${this.data.headers}`
|
|
146
146
|
: ''}${this.data.useBodyInput ? '\nBody: (Using Input)' : this.data.body.trim() ? `\nBody: ${this.data.body}` : ''}${this.data.errorOnNon200 ? '\nError on non-200' : ''}
|
|
147
147
|
`;
|
|
@@ -179,7 +179,7 @@ export class HttpCallNodeImpl extends NodeImpl {
|
|
|
179
179
|
headers = coerceType(headersInput, 'object');
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
else if (this.data.headers
|
|
182
|
+
else if (this.data.headers?.trim()) {
|
|
183
183
|
headers = JSON.parse(this.data.headers);
|
|
184
184
|
}
|
|
185
185
|
let body;
|
|
@@ -2,7 +2,7 @@ import { nanoid } from 'nanoid';
|
|
|
2
2
|
import { NodeImpl } from '../NodeImpl.js';
|
|
3
3
|
import {} from '../../index.js';
|
|
4
4
|
import { MCPError, MCPErrorType } from '../../integrations/mcp/MCPProvider.js';
|
|
5
|
-
import { dedent, getInputOrData } from '../../utils/index.js';
|
|
5
|
+
import { coerceType, dedent, getInputOrData } from '../../utils/index.js';
|
|
6
6
|
import { nodeDefinition } from '../NodeDefinition.js';
|
|
7
7
|
import { getServerHelperMessage, getServerOptions, loadMCPConfiguration } from '../../integrations/mcp/MCPUtils.js';
|
|
8
8
|
import { getMCPBaseInputs } from '../../integrations/mcp/MCPBase.js';
|
|
@@ -22,6 +22,7 @@ class MCPDiscoveryNodeImpl extends NodeImpl {
|
|
|
22
22
|
version: '1.0.0',
|
|
23
23
|
transportType: 'stdio',
|
|
24
24
|
serverUrl: 'http://localhost:8080/mcp',
|
|
25
|
+
headers: '',
|
|
25
26
|
serverId: '',
|
|
26
27
|
useNameInput: false,
|
|
27
28
|
useVersionInput: false,
|
|
@@ -100,6 +101,12 @@ class MCPDiscoveryNodeImpl extends NodeImpl {
|
|
|
100
101
|
dataKey: 'serverUrl',
|
|
101
102
|
useInputToggleDataKey: 'useServerUrlInput',
|
|
102
103
|
helperMessage: 'The base URL endpoint for the MCP server with `/mcp`',
|
|
104
|
+
}, {
|
|
105
|
+
type: 'code',
|
|
106
|
+
label: 'Headers',
|
|
107
|
+
dataKey: 'headers',
|
|
108
|
+
useInputToggleDataKey: 'useHeadersInput',
|
|
109
|
+
language: 'json',
|
|
103
110
|
});
|
|
104
111
|
}
|
|
105
112
|
else if (this.data.transportType === 'stdio') {
|
|
@@ -116,15 +123,21 @@ class MCPDiscoveryNodeImpl extends NodeImpl {
|
|
|
116
123
|
}
|
|
117
124
|
getBody(context) {
|
|
118
125
|
let base;
|
|
126
|
+
let headers = '';
|
|
119
127
|
if (this.data.transportType === 'http') {
|
|
120
128
|
base = this.data.useServerUrlInput ? '(Using Server URL Input)' : this.data.serverUrl;
|
|
129
|
+
headers = this.data.useHeadersInput
|
|
130
|
+
? '\nHeaders: (Using Input)'
|
|
131
|
+
: this.data.headers?.trim()
|
|
132
|
+
? `\nHeaders: ${this.data.headers}`
|
|
133
|
+
: '';
|
|
121
134
|
}
|
|
122
135
|
else {
|
|
123
136
|
base = `Server ID: ${this.data.serverId || '(None)'}`;
|
|
124
137
|
}
|
|
125
138
|
const namePart = `Name: ${this.data.name}`;
|
|
126
139
|
const versionPart = `Version: ${this.data.version}`;
|
|
127
|
-
const parts = [namePart, versionPart, base];
|
|
140
|
+
const parts = [namePart, versionPart, base, headers];
|
|
128
141
|
if (context.executor !== 'nodejs') {
|
|
129
142
|
parts.push('(Requires Node Executor)');
|
|
130
143
|
}
|
|
@@ -158,8 +171,24 @@ class MCPDiscoveryNodeImpl extends NodeImpl {
|
|
|
158
171
|
if (!serverUrl.includes('/mcp')) {
|
|
159
172
|
throw new MCPError(MCPErrorType.SERVER_COMMUNICATION_FAILED, 'Include /mcp in your server URL. For example: http://localhost:8080/mcp');
|
|
160
173
|
}
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
let headers;
|
|
175
|
+
if (this.data.useHeadersInput) {
|
|
176
|
+
const headersInput = inputs['headers'];
|
|
177
|
+
if (headersInput?.type === 'string') {
|
|
178
|
+
headers = JSON.parse(headersInput.value);
|
|
179
|
+
}
|
|
180
|
+
else if (headersInput?.type === 'object') {
|
|
181
|
+
headers = headersInput.value;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
headers = coerceType(headersInput, 'object');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (this.data.headers?.trim()) {
|
|
188
|
+
headers = JSON.parse(this.data.headers);
|
|
189
|
+
}
|
|
190
|
+
tools = await context.mcpProvider.getHTTPTools({ name, version }, serverUrl, headers);
|
|
191
|
+
prompts = await context.mcpProvider.getHTTPrompts({ name, version }, serverUrl, headers);
|
|
163
192
|
}
|
|
164
193
|
else if (transportType === 'stdio') {
|
|
165
194
|
const serverId = this.data.serverId ?? '';
|
|
@@ -3,7 +3,7 @@ import { nanoid } from 'nanoid/non-secure';
|
|
|
3
3
|
import { NodeImpl } from '../NodeImpl.js';
|
|
4
4
|
import { nodeDefinition } from '../NodeDefinition.js';
|
|
5
5
|
import {} from '../GraphProcessor.js';
|
|
6
|
-
import {} from '../../index.js';
|
|
6
|
+
import { coerceType } from '../../index.js';
|
|
7
7
|
import { MCPError, MCPErrorType } from '../../integrations/mcp/MCPProvider.js';
|
|
8
8
|
import { coerceTypeOptional } from '../../utils/coerceType.js';
|
|
9
9
|
import { dedent, getInputOrData } from '../../utils/index.js';
|
|
@@ -28,6 +28,7 @@ export class MCPGetPromptNodeImpl extends NodeImpl {
|
|
|
28
28
|
version: '1.0.0',
|
|
29
29
|
transportType: 'stdio',
|
|
30
30
|
serverUrl: 'http://localhost:8080/mcp',
|
|
31
|
+
headers: '',
|
|
31
32
|
serverId: '',
|
|
32
33
|
promptName: '',
|
|
33
34
|
promptArguments: dedent `
|
|
@@ -117,7 +118,13 @@ export class MCPGetPromptNodeImpl extends NodeImpl {
|
|
|
117
118
|
label: 'Server URL',
|
|
118
119
|
dataKey: 'serverUrl',
|
|
119
120
|
useInputToggleDataKey: 'useServerUrlInput',
|
|
120
|
-
helperMessage: 'The
|
|
121
|
+
helperMessage: 'The base URL endpoint for the MCP server with `/mcp`',
|
|
122
|
+
}, {
|
|
123
|
+
type: 'code',
|
|
124
|
+
label: 'Headers',
|
|
125
|
+
dataKey: 'headers',
|
|
126
|
+
useInputToggleDataKey: 'useHeadersInput',
|
|
127
|
+
language: 'json',
|
|
121
128
|
});
|
|
122
129
|
}
|
|
123
130
|
else if (this.data.transportType === 'stdio') {
|
|
@@ -134,15 +141,21 @@ export class MCPGetPromptNodeImpl extends NodeImpl {
|
|
|
134
141
|
}
|
|
135
142
|
getBody(context) {
|
|
136
143
|
let base;
|
|
144
|
+
let headers = '';
|
|
137
145
|
if (this.data.transportType === 'http') {
|
|
138
146
|
base = this.data.useServerUrlInput ? '(Using Server URL Input)' : this.data.serverUrl;
|
|
147
|
+
headers = this.data.useHeadersInput
|
|
148
|
+
? '\nHeaders: (Using Input)'
|
|
149
|
+
: this.data.headers?.trim()
|
|
150
|
+
? `\nHeaders: ${this.data.headers}`
|
|
151
|
+
: '';
|
|
139
152
|
}
|
|
140
153
|
else {
|
|
141
154
|
base = `Server ID: ${this.data.serverId || '(None)'}`;
|
|
142
155
|
}
|
|
143
156
|
const namePart = `Name: ${this.data.name}`;
|
|
144
157
|
const versionPart = `Version: ${this.data.version}`;
|
|
145
|
-
const parts = [namePart, versionPart, base];
|
|
158
|
+
const parts = [namePart, versionPart, base, headers];
|
|
146
159
|
if (context.executor !== 'nodejs') {
|
|
147
160
|
parts.push('(Requires Node Executor)');
|
|
148
161
|
}
|
|
@@ -199,7 +212,23 @@ export class MCPGetPromptNodeImpl extends NodeImpl {
|
|
|
199
212
|
if (!serverUrl.includes('/mcp')) {
|
|
200
213
|
throw new MCPError(MCPErrorType.SERVER_COMMUNICATION_FAILED, 'Include /mcp in your server URL. For example: http://localhost:8080/mcp');
|
|
201
214
|
}
|
|
202
|
-
|
|
215
|
+
let headers;
|
|
216
|
+
if (this.data.useHeadersInput) {
|
|
217
|
+
const headersInput = inputs['headers'];
|
|
218
|
+
if (headersInput?.type === 'string') {
|
|
219
|
+
headers = JSON.parse(headersInput.value);
|
|
220
|
+
}
|
|
221
|
+
else if (headersInput?.type === 'object') {
|
|
222
|
+
headers = headersInput.value;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
headers = coerceType(headersInput, 'object');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (this.data.headers?.trim()) {
|
|
229
|
+
headers = JSON.parse(this.data.headers);
|
|
230
|
+
}
|
|
231
|
+
getPromptResponse = await context.mcpProvider.getHTTPrompt({ name, version }, serverUrl, headers, getPromptRequest);
|
|
203
232
|
}
|
|
204
233
|
else if (transportType === 'stdio') {
|
|
205
234
|
const serverId = this.data.serverId ?? '';
|
|
@@ -3,7 +3,7 @@ import { nanoid } from 'nanoid/non-secure';
|
|
|
3
3
|
import { NodeImpl } from '../NodeImpl.js';
|
|
4
4
|
import { nodeDefinition } from '../NodeDefinition.js';
|
|
5
5
|
import {} from '../GraphProcessor.js';
|
|
6
|
-
import {} from '../../index.js';
|
|
6
|
+
import { coerceType } from '../../index.js';
|
|
7
7
|
import { MCPError, MCPErrorType } from '../../integrations/mcp/MCPProvider.js';
|
|
8
8
|
import { coerceTypeOptional } from '../../utils/coerceType.js';
|
|
9
9
|
import { getInputOrData } from '../../utils/index.js';
|
|
@@ -30,6 +30,7 @@ export class MCPToolCallNodeImpl extends NodeImpl {
|
|
|
30
30
|
version: '1.0.0',
|
|
31
31
|
transportType: 'stdio',
|
|
32
32
|
serverUrl: 'http://localhost:8080/mcp',
|
|
33
|
+
headers: '',
|
|
33
34
|
serverId: '',
|
|
34
35
|
toolName: '',
|
|
35
36
|
toolArguments: dedent `
|
|
@@ -131,7 +132,7 @@ export class MCPToolCallNodeImpl extends NodeImpl {
|
|
|
131
132
|
label: 'Tool ID',
|
|
132
133
|
dataKey: 'toolCallId',
|
|
133
134
|
useInputToggleDataKey: 'useToolCallIdInput',
|
|
134
|
-
helperMessage: 'The
|
|
135
|
+
helperMessage: 'The ID associated with the tool call',
|
|
135
136
|
},
|
|
136
137
|
];
|
|
137
138
|
if (this.data.transportType === 'http') {
|
|
@@ -140,7 +141,13 @@ export class MCPToolCallNodeImpl extends NodeImpl {
|
|
|
140
141
|
label: 'Server URL',
|
|
141
142
|
dataKey: 'serverUrl',
|
|
142
143
|
useInputToggleDataKey: 'useServerUrlInput',
|
|
143
|
-
helperMessage: 'The
|
|
144
|
+
helperMessage: 'The base URL endpoint for the MCP server with `/mcp`',
|
|
145
|
+
}, {
|
|
146
|
+
type: 'code',
|
|
147
|
+
label: 'Headers',
|
|
148
|
+
dataKey: 'headers',
|
|
149
|
+
useInputToggleDataKey: 'useHeadersInput',
|
|
150
|
+
language: 'json',
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
else if (this.data.transportType === 'stdio') {
|
|
@@ -157,15 +164,21 @@ export class MCPToolCallNodeImpl extends NodeImpl {
|
|
|
157
164
|
}
|
|
158
165
|
getBody(context) {
|
|
159
166
|
let base;
|
|
167
|
+
let headers = '';
|
|
160
168
|
if (this.data.transportType === 'http') {
|
|
161
169
|
base = this.data.useServerUrlInput ? '(Using Server URL Input)' : this.data.serverUrl;
|
|
170
|
+
headers = this.data.useHeadersInput
|
|
171
|
+
? '\nHeaders: (Using Input)'
|
|
172
|
+
: this.data.headers?.trim()
|
|
173
|
+
? `\nHeaders: ${this.data.headers}`
|
|
174
|
+
: '';
|
|
162
175
|
}
|
|
163
176
|
else {
|
|
164
177
|
base = `Server ID: ${this.data.serverId || '(None)'}`;
|
|
165
178
|
}
|
|
166
179
|
const namePart = `Name: ${this.data.name}`;
|
|
167
180
|
const versionPart = `Version: ${this.data.version}`;
|
|
168
|
-
const parts = [namePart, versionPart, base];
|
|
181
|
+
const parts = [namePart, versionPart, base, headers];
|
|
169
182
|
if (context.executor !== 'nodejs') {
|
|
170
183
|
parts.push('(Requires Node Executor)');
|
|
171
184
|
}
|
|
@@ -223,7 +236,23 @@ export class MCPToolCallNodeImpl extends NodeImpl {
|
|
|
223
236
|
if (!serverUrl.includes('/mcp')) {
|
|
224
237
|
throw new MCPError(MCPErrorType.SERVER_COMMUNICATION_FAILED, 'Include /mcp in your server URL. For example: http://localhost:8080/mcp');
|
|
225
238
|
}
|
|
226
|
-
|
|
239
|
+
let headers;
|
|
240
|
+
if (this.data.useHeadersInput) {
|
|
241
|
+
const headersInput = inputs['headers'];
|
|
242
|
+
if (headersInput?.type === 'string') {
|
|
243
|
+
headers = JSON.parse(headersInput.value);
|
|
244
|
+
}
|
|
245
|
+
else if (headersInput?.type === 'object') {
|
|
246
|
+
headers = headersInput.value;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
headers = coerceType(headersInput, 'object');
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else if (this.data.headers?.trim()) {
|
|
253
|
+
headers = JSON.parse(this.data.headers);
|
|
254
|
+
}
|
|
255
|
+
toolResponse = await context.mcpProvider.httpToolCall({ name, version }, serverUrl, headers, toolCall);
|
|
227
256
|
}
|
|
228
257
|
else if (transportType === 'stdio') {
|
|
229
258
|
const serverId = this.data.serverId ?? '';
|
|
@@ -121,7 +121,7 @@ export interface MCPProvider {
|
|
|
121
121
|
getHTTPTools(clientConfig: {
|
|
122
122
|
name: string;
|
|
123
123
|
version: string;
|
|
124
|
-
}, serverUrl: string): Promise<MCP.Tool[]>;
|
|
124
|
+
}, serverUrl: string, headers: Record<string, string> | undefined): Promise<MCP.Tool[]>;
|
|
125
125
|
getStdioTools(clientConfig: {
|
|
126
126
|
name: string;
|
|
127
127
|
version: string;
|
|
@@ -129,7 +129,7 @@ export interface MCPProvider {
|
|
|
129
129
|
getHTTPrompts(clientConfig: {
|
|
130
130
|
name: string;
|
|
131
131
|
version: string;
|
|
132
|
-
}, serverUrl: string): Promise<MCP.Prompt[]>;
|
|
132
|
+
}, serverUrl: string, headers: Record<string, string> | undefined): Promise<MCP.Prompt[]>;
|
|
133
133
|
getStdioPrompts(clientConfig: {
|
|
134
134
|
name: string;
|
|
135
135
|
version: string;
|
|
@@ -137,7 +137,7 @@ export interface MCPProvider {
|
|
|
137
137
|
httpToolCall(clientConfig: {
|
|
138
138
|
name: string;
|
|
139
139
|
version: string;
|
|
140
|
-
}, serverUrl: string, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
140
|
+
}, serverUrl: string, headers: Record<string, string> | undefined, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
141
141
|
stdioToolCall(clientConfig: {
|
|
142
142
|
name: string;
|
|
143
143
|
version: string;
|
|
@@ -145,7 +145,7 @@ export interface MCPProvider {
|
|
|
145
145
|
getHTTPrompt(clientConfig: {
|
|
146
146
|
name: string;
|
|
147
147
|
version: string;
|
|
148
|
-
}, serverUrl: string, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
148
|
+
}, serverUrl: string, headers: Record<string, string> | undefined, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
149
149
|
getStdioPrompt(clientConfig: {
|
|
150
150
|
name: string;
|
|
151
151
|
version: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@alpic80/rivet-core",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"repository": "https://github.com/castortech/rivet",
|
|
5
|
-
"version": "1.24.2-aidon.
|
|
5
|
+
"version": "1.24.2-aidon.9",
|
|
6
6
|
"packageManager": "yarn@3.5.0",
|
|
7
7
|
"main": "dist/cjs/bundle.cjs",
|
|
8
8
|
"module": "dist/esm/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@google-cloud/vertexai": "^0.1.3",
|
|
49
49
|
"@google/genai": "^0.12.0",
|
|
50
50
|
"@huggingface/inference": "^4.13.0",
|
|
51
|
-
"@ironclad/rivet-core": "npm:@alpic80/rivet-core@1.24.2-aidon.
|
|
51
|
+
"@ironclad/rivet-core": "npm:@alpic80/rivet-core@1.24.2-aidon.9",
|
|
52
52
|
"assemblyai": "^4.6.0",
|
|
53
53
|
"autoevals": "^0.0.26",
|
|
54
54
|
"cron-parser": "^4.9.0",
|