@cogenta/mcp 0.1.4 → 0.3.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/README.md +123 -0
- package/dist/client/sandbox.d.ts +17 -0
- package/dist/client/sandbox.d.ts.map +1 -0
- package/dist/client/sandbox.js +24 -0
- package/dist/client/sandbox.js.map +1 -0
- package/dist/client/stdio-client.d.ts +59 -2
- package/dist/client/stdio-client.d.ts.map +1 -1
- package/dist/client/stdio-client.js +201 -25
- package/dist/client/stdio-client.js.map +1 -1
- package/dist/client/types.d.ts +21 -4
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/watchdog.d.ts +41 -0
- package/dist/client/watchdog.d.ts.map +1 -0
- package/dist/client/watchdog.js +67 -0
- package/dist/client/watchdog.js.map +1 -0
- package/dist/client/wrap-tool.d.ts +20 -0
- package/dist/client/wrap-tool.d.ts.map +1 -1
- package/dist/client/wrap-tool.js +9 -2
- package/dist/client/wrap-tool.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/registry/discovery.d.ts +37 -0
- package/dist/registry/discovery.d.ts.map +1 -0
- package/dist/registry/discovery.js +68 -0
- package/dist/registry/discovery.js.map +1 -0
- package/dist/registry/store.d.ts +137 -0
- package/dist/registry/store.d.ts.map +1 -0
- package/dist/registry/store.js +272 -0
- package/dist/registry/store.js.map +1 -0
- package/dist/registry/tables.d.ts +24 -0
- package/dist/registry/tables.d.ts.map +1 -0
- package/dist/registry/tables.js +65 -0
- package/dist/registry/tables.js.map +1 -0
- package/dist/registry/tool-definitions.d.ts +53 -0
- package/dist/registry/tool-definitions.d.ts.map +1 -0
- package/dist/registry/tool-definitions.js +98 -0
- package/dist/registry/tool-definitions.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createCipheriv, createDecipheriv, randomBytes, scryptSync } from 'node:crypto';
|
|
2
|
+
import { CogentaError, identifier, newId, sql } from '@cogenta/core';
|
|
3
|
+
import { MCP_CONNECTION_TABLE } from './tables.js';
|
|
4
|
+
const KEY_DERIVATION_SALT = 'cogenta-mcp-connection-secrets-v1';
|
|
5
|
+
const ALGORITHM = 'aes-256-gcm';
|
|
6
|
+
function deriveKey(signingKey) {
|
|
7
|
+
return scryptSync(signingKey, KEY_DERIVATION_SALT, 32);
|
|
8
|
+
}
|
|
9
|
+
function connectionNotFound(id) {
|
|
10
|
+
return new CogentaError({
|
|
11
|
+
code: 'MCP_CONNECTION_NOT_FOUND',
|
|
12
|
+
message: `No MCP connection with id "${id}".`,
|
|
13
|
+
hint: 'Check the id against the admin\'s "MCP Clients" screen.',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function confirmationRequired() {
|
|
17
|
+
return new CogentaError({
|
|
18
|
+
code: 'MCP_CONNECTION_CONFIRMATION_REQUIRED',
|
|
19
|
+
message: 'A "stdio" MCP connection must explicitly confirm it runs an unsandboxed third-party executable with the full OS privileges of the Cogenta server process.',
|
|
20
|
+
hint: 'Pass confirmUnsandboxed: true only after the operator has actually seen and accepted that warning.',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function toolNotDiscovered(id, remoteName) {
|
|
24
|
+
return new CogentaError({
|
|
25
|
+
code: 'MCP_CONNECTION_TOOL_NOT_DISCOVERED',
|
|
26
|
+
message: `"${remoteName}" was not in the last discovered tool list for connection "${id}".`,
|
|
27
|
+
hint: 'Run "test connection" again, then choose only from the tools it actually returned.',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function toSummary(row) {
|
|
31
|
+
return {
|
|
32
|
+
id: row.id,
|
|
33
|
+
name: row.name,
|
|
34
|
+
transport: row.transport,
|
|
35
|
+
...(row.command === null ? {} : { command: row.command }),
|
|
36
|
+
args: row.args_json === null ? [] : JSON.parse(row.args_json),
|
|
37
|
+
...(row.url === null ? {} : { url: row.url }),
|
|
38
|
+
env: row.env_json === null ? {} : JSON.parse(row.env_json),
|
|
39
|
+
authKind: row.auth_kind,
|
|
40
|
+
hasSecret: row.secret_ciphertext !== null,
|
|
41
|
+
...(row.secret_env_var === null ? {} : { secretEnvVar: row.secret_env_var }),
|
|
42
|
+
confirmedUnsandboxed: Boolean(row.confirmed_unsandboxed),
|
|
43
|
+
enabled: Boolean(row.enabled),
|
|
44
|
+
status: row.status,
|
|
45
|
+
...(row.last_error === null ? {} : { lastError: row.last_error }),
|
|
46
|
+
discoveredTools: row.discovered_tools_json === null
|
|
47
|
+
? []
|
|
48
|
+
: JSON.parse(row.discovered_tools_json),
|
|
49
|
+
...(row.last_discovered_at === null ? {} : { lastDiscoveredAt: row.last_discovered_at }),
|
|
50
|
+
exposedTools: JSON.parse(row.exposed_tools_json),
|
|
51
|
+
createdAt: row.created_at,
|
|
52
|
+
updatedAt: row.updated_at,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function createMcpConnectionStore(db, options) {
|
|
56
|
+
const now = options.now ?? Date.now;
|
|
57
|
+
const key = deriveKey(options.signingKey);
|
|
58
|
+
const table = identifier(MCP_CONNECTION_TABLE, db.dialect);
|
|
59
|
+
function encrypt(plaintext) {
|
|
60
|
+
const iv = randomBytes(12);
|
|
61
|
+
const cipher = createCipheriv(ALGORITHM, key, iv);
|
|
62
|
+
const ciphertext = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
|
|
63
|
+
return {
|
|
64
|
+
iv: iv.toString('base64'),
|
|
65
|
+
authTag: cipher.getAuthTag().toString('base64'),
|
|
66
|
+
ciphertext: ciphertext.toString('base64'),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function decrypt(row) {
|
|
70
|
+
if (row.secret_iv === null || row.secret_auth_tag === null || row.secret_ciphertext === null) {
|
|
71
|
+
throw new CogentaError({
|
|
72
|
+
code: 'MCP_CONNECTION_AUTH_INVALID',
|
|
73
|
+
message: `Connection "${row.id}" has no saved secret.`,
|
|
74
|
+
hint: `Its authKind is "${row.auth_kind}" — save one from the admin's "MCP Clients" screen first.`,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const decipher = createDecipheriv(ALGORITHM, key, Buffer.from(row.secret_iv, 'base64'));
|
|
78
|
+
decipher.setAuthTag(Buffer.from(row.secret_auth_tag, 'base64'));
|
|
79
|
+
const plaintext = Buffer.concat([
|
|
80
|
+
decipher.update(Buffer.from(row.secret_ciphertext, 'base64')),
|
|
81
|
+
decipher.final(),
|
|
82
|
+
]);
|
|
83
|
+
return plaintext.toString('utf8');
|
|
84
|
+
}
|
|
85
|
+
async function findRow(id) {
|
|
86
|
+
const result = await db.query(sql `select * from ${table} where id = ${id}`);
|
|
87
|
+
return result.rows[0];
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
async list() {
|
|
91
|
+
const result = await db.query(sql `select * from ${table} order by created_at asc`);
|
|
92
|
+
return result.rows.map(toSummary);
|
|
93
|
+
},
|
|
94
|
+
async get(id) {
|
|
95
|
+
const row = await findRow(id);
|
|
96
|
+
return row === undefined ? undefined : toSummary(row);
|
|
97
|
+
},
|
|
98
|
+
async create(input) {
|
|
99
|
+
if (input.transport === 'stdio' && input.confirmUnsandboxed !== true) {
|
|
100
|
+
throw confirmationRequired();
|
|
101
|
+
}
|
|
102
|
+
const authKind = input.authKind ?? 'none';
|
|
103
|
+
let secretFields;
|
|
104
|
+
if (authKind !== 'none' && input.secret !== undefined) {
|
|
105
|
+
const encrypted = encrypt(input.secret);
|
|
106
|
+
secretFields = {
|
|
107
|
+
secret_iv: encrypted.iv,
|
|
108
|
+
secret_auth_tag: encrypted.authTag,
|
|
109
|
+
secret_ciphertext: encrypted.ciphertext,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
secretFields = { secret_iv: null, secret_auth_tag: null, secret_ciphertext: null };
|
|
114
|
+
}
|
|
115
|
+
const nowIso = new Date(now()).toISOString();
|
|
116
|
+
const row = {
|
|
117
|
+
id: newId(now),
|
|
118
|
+
name: input.name,
|
|
119
|
+
transport: input.transport,
|
|
120
|
+
command: input.command ?? null,
|
|
121
|
+
args_json: input.args === undefined ? null : JSON.stringify(input.args),
|
|
122
|
+
url: input.url ?? null,
|
|
123
|
+
env_json: input.env === undefined ? null : JSON.stringify(input.env),
|
|
124
|
+
auth_kind: authKind,
|
|
125
|
+
secret_env_var: input.secretEnvVar ?? null,
|
|
126
|
+
...secretFields,
|
|
127
|
+
// Reaching this point means either the transport is `http` (nothing
|
|
128
|
+
// is spawned, so there is nothing to confirm) or it is `stdio` and
|
|
129
|
+
// the guard above already required `confirmUnsandboxed === true`.
|
|
130
|
+
confirmed_unsandboxed: true,
|
|
131
|
+
enabled: true,
|
|
132
|
+
status: 'unverified',
|
|
133
|
+
last_error: null,
|
|
134
|
+
exposed_tools_json: '[]',
|
|
135
|
+
created_at: nowIso,
|
|
136
|
+
updated_at: nowIso,
|
|
137
|
+
};
|
|
138
|
+
await db.query(sql `
|
|
139
|
+
insert into ${table} (
|
|
140
|
+
id, name, transport, command, args_json, url, env_json, auth_kind,
|
|
141
|
+
secret_env_var, secret_iv, secret_auth_tag, secret_ciphertext,
|
|
142
|
+
confirmed_unsandboxed, enabled, status, last_error,
|
|
143
|
+
discovered_tools_json, last_discovered_at, exposed_tools_json,
|
|
144
|
+
created_at, updated_at
|
|
145
|
+
) values (
|
|
146
|
+
${row.id}, ${row.name}, ${row.transport}, ${row.command}, ${row.args_json}, ${row.url}, ${row.env_json}, ${row.auth_kind},
|
|
147
|
+
${row.secret_env_var}, ${row.secret_iv}, ${row.secret_auth_tag}, ${row.secret_ciphertext},
|
|
148
|
+
${row.confirmed_unsandboxed}, ${row.enabled}, ${row.status}, ${row.last_error},
|
|
149
|
+
${null}, ${null}, ${row.exposed_tools_json},
|
|
150
|
+
${row.created_at}, ${row.updated_at}
|
|
151
|
+
)`);
|
|
152
|
+
const saved = await findRow(row.id);
|
|
153
|
+
if (saved === undefined)
|
|
154
|
+
throw connectionNotFound(row.id);
|
|
155
|
+
return toSummary(saved);
|
|
156
|
+
},
|
|
157
|
+
async remove(id) {
|
|
158
|
+
await db.query(sql `delete from ${table} where id = ${id}`);
|
|
159
|
+
},
|
|
160
|
+
async setEnabled(id, enabled) {
|
|
161
|
+
const row = await findRow(id);
|
|
162
|
+
if (row === undefined)
|
|
163
|
+
throw connectionNotFound(id);
|
|
164
|
+
const updatedAt = new Date(now()).toISOString();
|
|
165
|
+
await db.query(sql `update ${table} set enabled = ${enabled}, updated_at = ${updatedAt} where id = ${id}`);
|
|
166
|
+
return toSummary({ ...row, enabled, updated_at: updatedAt });
|
|
167
|
+
},
|
|
168
|
+
async update(id, patch) {
|
|
169
|
+
const row = await findRow(id);
|
|
170
|
+
if (row === undefined)
|
|
171
|
+
throw connectionNotFound(id);
|
|
172
|
+
const name = patch.name ?? row.name;
|
|
173
|
+
const command = patch.command === undefined ? row.command : patch.command;
|
|
174
|
+
const args_json = patch.args === undefined ? row.args_json : JSON.stringify(patch.args);
|
|
175
|
+
const url = patch.url === undefined ? row.url : patch.url;
|
|
176
|
+
const env_json = patch.env === undefined ? row.env_json : JSON.stringify(patch.env);
|
|
177
|
+
const authKind = patch.authKind ?? row.auth_kind;
|
|
178
|
+
const secretEnvVar = patch.secretEnvVar === undefined ? row.secret_env_var : patch.secretEnvVar;
|
|
179
|
+
let secretFields;
|
|
180
|
+
if (authKind === 'none') {
|
|
181
|
+
secretFields = { secret_iv: null, secret_auth_tag: null, secret_ciphertext: null };
|
|
182
|
+
}
|
|
183
|
+
else if (patch.secret !== undefined) {
|
|
184
|
+
const encrypted = encrypt(patch.secret);
|
|
185
|
+
secretFields = {
|
|
186
|
+
secret_iv: encrypted.iv,
|
|
187
|
+
secret_auth_tag: encrypted.authTag,
|
|
188
|
+
secret_ciphertext: encrypted.ciphertext,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
secretFields = {
|
|
193
|
+
secret_iv: row.secret_iv,
|
|
194
|
+
secret_auth_tag: row.secret_auth_tag,
|
|
195
|
+
secret_ciphertext: row.secret_ciphertext,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
const updatedAt = new Date(now()).toISOString();
|
|
199
|
+
await db.query(sql `
|
|
200
|
+
update ${table}
|
|
201
|
+
set name = ${name}, command = ${command}, args_json = ${args_json}, url = ${url},
|
|
202
|
+
env_json = ${env_json}, auth_kind = ${authKind}, secret_env_var = ${secretEnvVar},
|
|
203
|
+
secret_iv = ${secretFields.secret_iv}, secret_auth_tag = ${secretFields.secret_auth_tag},
|
|
204
|
+
secret_ciphertext = ${secretFields.secret_ciphertext}, updated_at = ${updatedAt}
|
|
205
|
+
where id = ${id}`);
|
|
206
|
+
return toSummary({
|
|
207
|
+
...row,
|
|
208
|
+
name,
|
|
209
|
+
command,
|
|
210
|
+
args_json,
|
|
211
|
+
url,
|
|
212
|
+
env_json,
|
|
213
|
+
auth_kind: authKind,
|
|
214
|
+
secret_env_var: secretEnvVar,
|
|
215
|
+
...secretFields,
|
|
216
|
+
updated_at: updatedAt,
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
async recordDiscovery(id, result) {
|
|
220
|
+
const row = await findRow(id);
|
|
221
|
+
if (row === undefined)
|
|
222
|
+
throw connectionNotFound(id);
|
|
223
|
+
const updatedAt = new Date(now()).toISOString();
|
|
224
|
+
if (result.status === 'ok') {
|
|
225
|
+
const discoveredJson = JSON.stringify(result.tools);
|
|
226
|
+
await db.query(sql `
|
|
227
|
+
update ${table}
|
|
228
|
+
set status = ${'ok'}, last_error = ${null},
|
|
229
|
+
discovered_tools_json = ${discoveredJson}, last_discovered_at = ${updatedAt},
|
|
230
|
+
updated_at = ${updatedAt}
|
|
231
|
+
where id = ${id}`);
|
|
232
|
+
return toSummary({
|
|
233
|
+
...row,
|
|
234
|
+
status: 'ok',
|
|
235
|
+
last_error: null,
|
|
236
|
+
discovered_tools_json: discoveredJson,
|
|
237
|
+
last_discovered_at: updatedAt,
|
|
238
|
+
updated_at: updatedAt,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
await db.query(sql `
|
|
242
|
+
update ${table} set status = ${'error'}, last_error = ${result.error}, updated_at = ${updatedAt}
|
|
243
|
+
where id = ${id}`);
|
|
244
|
+
return toSummary({ ...row, status: 'error', last_error: result.error, updated_at: updatedAt });
|
|
245
|
+
},
|
|
246
|
+
async setExposedTools(id, tools) {
|
|
247
|
+
const row = await findRow(id);
|
|
248
|
+
if (row === undefined)
|
|
249
|
+
throw connectionNotFound(id);
|
|
250
|
+
const discovered = new Set((row.discovered_tools_json === null
|
|
251
|
+
? []
|
|
252
|
+
: JSON.parse(row.discovered_tools_json)).map((tool) => tool.name));
|
|
253
|
+
for (const tool of tools) {
|
|
254
|
+
if (!discovered.has(tool.remoteName))
|
|
255
|
+
throw toolNotDiscovered(id, tool.remoteName);
|
|
256
|
+
}
|
|
257
|
+
const updatedAt = new Date(now()).toISOString();
|
|
258
|
+
const exposedJson = JSON.stringify(tools);
|
|
259
|
+
await db.query(sql `
|
|
260
|
+
update ${table} set exposed_tools_json = ${exposedJson}, updated_at = ${updatedAt}
|
|
261
|
+
where id = ${id}`);
|
|
262
|
+
return toSummary({ ...row, exposed_tools_json: exposedJson, updated_at: updatedAt });
|
|
263
|
+
},
|
|
264
|
+
async decryptSecret(id) {
|
|
265
|
+
const row = await findRow(id);
|
|
266
|
+
if (row === undefined)
|
|
267
|
+
throw connectionNotFound(id);
|
|
268
|
+
return decrypt(row);
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/registry/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACvF,OAAO,EAAE,YAAY,EAAuB,UAAU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C;QAED,KAAK,CAAC,aAAa,CAAC,EAAE;YACpB,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,CAAA;YAC7B,IAAI,GAAG,KAAK,SAAS;gBAAE,MAAM,kBAAkB,CAAC,EAAE,CAAC,CAAA;YACnD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type DatabaseHandle } from '@cogenta/core';
|
|
2
|
+
export declare const MCP_CONNECTION_TABLE = "mcp_connections";
|
|
3
|
+
/**
|
|
4
|
+
* Fiche 58 task 2. Owned by `@cogenta/mcp`, following `@cogenta/plugins`'s
|
|
5
|
+
* `ensurePluginTables` pattern exactly: `create table if not exists`, run
|
|
6
|
+
* once at startup, no separate migration file — this is registry/config
|
|
7
|
+
* state for the current running process, not Contract A content.
|
|
8
|
+
*
|
|
9
|
+
* One row per configured external MCP connection. Everything a `stdio`
|
|
10
|
+
* connection needs to actually spawn (`command`/`args`/`env`) lives here in
|
|
11
|
+
* the clear — none of it is a secret by itself — while `secret_*` (the
|
|
12
|
+
* bearer/API key/OAuth token this *connection* authenticates itself with,
|
|
13
|
+
* for `auth_kind !== 'none'`) is the one thing encrypted at rest, same
|
|
14
|
+
* AES-256-GCM scheme as `@cogenta/agents`' `ProviderConfigStore` (R7: key
|
|
15
|
+
* derived from `COGENTA_AUTH_SIGNING_KEY`, no second secret to manage).
|
|
16
|
+
*
|
|
17
|
+
* `exposed_tools_json` is the admin's own checkbox decision (task 3) — the
|
|
18
|
+
* whole reason this is not simply "every tool `tools/list` returns is
|
|
19
|
+
* available": "absent, pas refusée" (fiche's own words, borrowed from
|
|
20
|
+
* `@cogenta/plugins`'s capability model) — a tool never checked here is
|
|
21
|
+
* never wrapped, never in an agent's manifest, full stop.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ensureMcpConnectionTables(db: DatabaseHandle): Promise<void>;
|
|
24
|
+
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/registry/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAKpB,MAAM,eAAe,CAAA;AAEtB,eAAO,MAAM,oBAAoB,oBAAoB,CAAA;AAWrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCjF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { identifier, sql, unsafeRaw, } from '@cogenta/core';
|
|
2
|
+
export const MCP_CONNECTION_TABLE = 'mcp_connections';
|
|
3
|
+
function textColumn(dialect, length) {
|
|
4
|
+
return unsafeRaw(dialect === 'sqlite' ? 'text' : `varchar(${length})`);
|
|
5
|
+
}
|
|
6
|
+
/** Same convention `@cogenta/auth`'s `tables.ts` already uses. */
|
|
7
|
+
function booleanColumn(dialect) {
|
|
8
|
+
return unsafeRaw(dialect === 'postgres' ? 'boolean' : 'tinyint');
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fiche 58 task 2. Owned by `@cogenta/mcp`, following `@cogenta/plugins`'s
|
|
12
|
+
* `ensurePluginTables` pattern exactly: `create table if not exists`, run
|
|
13
|
+
* once at startup, no separate migration file — this is registry/config
|
|
14
|
+
* state for the current running process, not Contract A content.
|
|
15
|
+
*
|
|
16
|
+
* One row per configured external MCP connection. Everything a `stdio`
|
|
17
|
+
* connection needs to actually spawn (`command`/`args`/`env`) lives here in
|
|
18
|
+
* the clear — none of it is a secret by itself — while `secret_*` (the
|
|
19
|
+
* bearer/API key/OAuth token this *connection* authenticates itself with,
|
|
20
|
+
* for `auth_kind !== 'none'`) is the one thing encrypted at rest, same
|
|
21
|
+
* AES-256-GCM scheme as `@cogenta/agents`' `ProviderConfigStore` (R7: key
|
|
22
|
+
* derived from `COGENTA_AUTH_SIGNING_KEY`, no second secret to manage).
|
|
23
|
+
*
|
|
24
|
+
* `exposed_tools_json` is the admin's own checkbox decision (task 3) — the
|
|
25
|
+
* whole reason this is not simply "every tool `tools/list` returns is
|
|
26
|
+
* available": "absent, pas refusée" (fiche's own words, borrowed from
|
|
27
|
+
* `@cogenta/plugins`'s capability model) — a tool never checked here is
|
|
28
|
+
* never wrapped, never in an agent's manifest, full stop.
|
|
29
|
+
*/
|
|
30
|
+
export async function ensureMcpConnectionTables(db) {
|
|
31
|
+
const d = db.dialect;
|
|
32
|
+
const connections = identifier(MCP_CONNECTION_TABLE, d);
|
|
33
|
+
const t255 = textColumn(d, 255);
|
|
34
|
+
const t2048 = textColumn(d, 2048);
|
|
35
|
+
const tText = unsafeRaw('text');
|
|
36
|
+
const tBool = booleanColumn(d);
|
|
37
|
+
await db.query(sql `
|
|
38
|
+
create table if not exists ${connections} (
|
|
39
|
+
id ${t255} not null primary key,
|
|
40
|
+
name ${t255} not null,
|
|
41
|
+
transport ${t255} not null,
|
|
42
|
+
command ${t2048},
|
|
43
|
+
args_json ${tText},
|
|
44
|
+
url ${t2048},
|
|
45
|
+
env_json ${tText},
|
|
46
|
+
auth_kind ${t255} not null,
|
|
47
|
+
secret_env_var ${t255},
|
|
48
|
+
secret_iv ${t255},
|
|
49
|
+
secret_auth_tag ${t255},
|
|
50
|
+
secret_ciphertext ${tText},
|
|
51
|
+
confirmed_unsandboxed ${tBool} not null,
|
|
52
|
+
enabled ${tBool} not null,
|
|
53
|
+
status ${t255} not null,
|
|
54
|
+
last_error ${tText},
|
|
55
|
+
discovered_tools_json ${tText},
|
|
56
|
+
last_discovered_at ${t255},
|
|
57
|
+
exposed_tools_json ${tText} not null,
|
|
58
|
+
created_at ${t255} not null,
|
|
59
|
+
updated_at ${t255} not null
|
|
60
|
+
)`);
|
|
61
|
+
await db
|
|
62
|
+
.query(sql `create index ${identifier('cogenta_mcp_connections_name', d)} on ${connections} (name)`)
|
|
63
|
+
.catch(() => undefined); // already there — no portable "if not exists" for indexes
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../src/registry/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,GAAG,EACH,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAA;AAErD,SAAS,UAAU,CAAC,OAAwB,EAAE,MAAc;IAC1D,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC,CAAA;AACxE,CAAC;AAED,kEAAkE;AAClE,SAAS,aAAa,CAAC,OAAwB;IAC7C,OAAO,SAAS,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AAClE,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAAkB;IAChE,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAA;IACpB,MAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAA;IACvD,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;IAC/B,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;IAE9B,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAA;iCACa,WAAW;WACjC,IAAI;aACF,IAAI;kBACC,IAAI;gBACN,KAAK;kBACH,KAAK;YACX,KAAK;iBACA,KAAK;kBACJ,IAAI;uBACC,IAAI;kBACT,IAAI;wBACE,IAAI;0BACF,KAAK;8BACD,KAAK;gBACnB,KAAK;eACN,IAAI;mBACA,KAAK;8BACM,KAAK;2BACR,IAAI;2BACJ,KAAK;mBACb,IAAI;mBACJ,IAAI;MACjB,CAAC,CAAA;IAEL,MAAM,EAAE;SACL,KAAK,CACJ,GAAG,CAAA,gBAAgB,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC,OAAO,WAAW,SAAS,CAC5F;SACA,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA,CAAC,0DAA0D;AACtF,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@cogenta/agents';
|
|
2
|
+
import type { Logger } from '@cogenta/core';
|
|
3
|
+
import { type McpStdioClientOptions } from '../client/stdio-client.js';
|
|
4
|
+
import type { McpConnectionStore } from './store.js';
|
|
5
|
+
/**
|
|
6
|
+
* Fiche 58 task 4's runtime wiring. Structurally, the fiche names
|
|
7
|
+
* `packages/agents/src/runtime/` for this — it lives here in `@cogenta/mcp`
|
|
8
|
+
* instead, and the discrepancy is deliberate, signalled rather than
|
|
9
|
+
* silently worked around: `@cogenta/mcp` already depends on
|
|
10
|
+
* `@cogenta/agents` (for `ToolDefinition`/`defineTool` — `../client/
|
|
11
|
+
* wrap-tool.js`), so a reverse dependency the fiche's own path would
|
|
12
|
+
* require is a package cycle. `packages/cli/src/commands/agent-runtime.ts`
|
|
13
|
+
* — which already depends on both packages, the same way it already
|
|
14
|
+
* builds this site's real `ToolRegistry` — is where this assembly's
|
|
15
|
+
* `definitions` are actually merged in; see that file's own comment at the
|
|
16
|
+
* call site.
|
|
17
|
+
*
|
|
18
|
+
* One `McpClient` per enabled connection that has at least one exposed
|
|
19
|
+
* tool, built once and shared by every `wrapMcpTool` for that connection —
|
|
20
|
+
* never one spawned process per tool. A connection that fails to
|
|
21
|
+
* `initialize()` here is logged and skipped, never thrown: one
|
|
22
|
+
* misbehaving external server must not keep the rest of a site's agents
|
|
23
|
+
* and tools from starting at all (the same posture L22 task 1's
|
|
24
|
+
* `resolveProvider` already takes for a missing LLM provider — R2's
|
|
25
|
+
* "runs refuse, the rest of the CMS does not").
|
|
26
|
+
*
|
|
27
|
+
* **Known, accepted limitation**: `wrapMcpTool` requires a static Zod
|
|
28
|
+
* input/output schema per tool, because Contract C's `ToolDefinition`
|
|
29
|
+
* always has one — there is no JSON-Schema-to-Zod translator in this
|
|
30
|
+
* repository (adding one would be a new dependency, R9), so a
|
|
31
|
+
* dynamically-discovered remote tool is wrapped with a permissive
|
|
32
|
+
* `z.record(...)` input rather than the real schema the remote server
|
|
33
|
+
* declared in `tools/list`. Local validation is therefore looser than the
|
|
34
|
+
* remote tool's own; the remote server still validates its own call and
|
|
35
|
+
* reports `isError: true` on a bad one, exactly like every other MCP tool
|
|
36
|
+
* failure. The JSON schema shown to the model (`manifest.ts`'s
|
|
37
|
+
* `z.toJSONSchema`) is correspondingly generic, not the remote's richer
|
|
38
|
+
* one — a real usability gap, honestly documented rather than hidden.
|
|
39
|
+
*/
|
|
40
|
+
export interface BuildMcpToolDefinitionsOptions {
|
|
41
|
+
readonly store: McpConnectionStore;
|
|
42
|
+
readonly logger?: Logger;
|
|
43
|
+
readonly callTimeoutMs?: number;
|
|
44
|
+
/** Injectable for tests — defaults to a real spawned process (see `McpStdioClientOptions.spawnFn`). */
|
|
45
|
+
readonly spawnFn?: McpStdioClientOptions['spawnFn'];
|
|
46
|
+
}
|
|
47
|
+
export interface McpToolDefinitionsAssembly {
|
|
48
|
+
readonly definitions: readonly ToolDefinition[];
|
|
49
|
+
/** Closes every underlying `McpClient` and removes every sandbox working directory this assembly created — call once, on shutdown. */
|
|
50
|
+
dispose(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare function buildMcpToolDefinitions(options: BuildMcpToolDefinitionsOptions): Promise<McpToolDefinitionsAssembly>;
|
|
53
|
+
//# sourceMappingURL=tool-definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-definitions.d.ts","sourceRoot":"","sources":["../../src/registry/tool-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,uGAAuG;IACvG,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAA;CACpD;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAA;IAC/C,sIAAsI;IACtI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAaD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CA4FrC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSandboxWorkDir } from '../client/sandbox.js';
|
|
3
|
+
import { createMcpStdioClient } from '../client/stdio-client.js';
|
|
4
|
+
import { wrapMcpTool } from '../client/wrap-tool.js';
|
|
5
|
+
const OPAQUE_INPUT = z.record(z.string(), z.unknown());
|
|
6
|
+
function localToolName(connection, localName) {
|
|
7
|
+
return `mcp.external.${connection.id}.${localName}`;
|
|
8
|
+
}
|
|
9
|
+
/** Fiche 58 task 6's settled taxonomy: one permission per checked remote tool, never per connection. */
|
|
10
|
+
function permissionFor(connection, remoteName) {
|
|
11
|
+
return `mcp.external:${connection.id}.${remoteName}`;
|
|
12
|
+
}
|
|
13
|
+
export async function buildMcpToolDefinitions(options) {
|
|
14
|
+
const connections = (await options.store.list()).filter((connection) => connection.enabled && connection.exposedTools.length > 0);
|
|
15
|
+
const definitions = [];
|
|
16
|
+
const clients = [];
|
|
17
|
+
const sandboxes = [];
|
|
18
|
+
for (const connection of connections) {
|
|
19
|
+
if (connection.transport !== 'stdio') {
|
|
20
|
+
options.logger?.warn('mcp registry: skipping connection with unsupported transport', {
|
|
21
|
+
connection: connection.id,
|
|
22
|
+
transport: connection.transport,
|
|
23
|
+
});
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (connection.command === undefined) {
|
|
27
|
+
options.logger?.warn('mcp registry: skipping connection with no command configured', {
|
|
28
|
+
connection: connection.id,
|
|
29
|
+
});
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
let secret;
|
|
33
|
+
if (connection.authKind !== 'none' && connection.hasSecret) {
|
|
34
|
+
try {
|
|
35
|
+
secret = await options.store.decryptSecret(connection.id);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
options.logger?.error('mcp registry: could not decrypt connection secret, skipping', {
|
|
39
|
+
connection: connection.id,
|
|
40
|
+
error: error instanceof Error ? error.message : String(error),
|
|
41
|
+
});
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const env = { ...connection.env };
|
|
46
|
+
if (connection.secretEnvVar !== undefined && secret !== undefined) {
|
|
47
|
+
env[connection.secretEnvVar] = secret;
|
|
48
|
+
}
|
|
49
|
+
const sandbox = await createSandboxWorkDir();
|
|
50
|
+
let client;
|
|
51
|
+
try {
|
|
52
|
+
client = createMcpStdioClient({
|
|
53
|
+
command: connection.command,
|
|
54
|
+
args: connection.args,
|
|
55
|
+
env,
|
|
56
|
+
cwd: sandbox.path,
|
|
57
|
+
...(options.logger === undefined ? {} : { logger: options.logger }),
|
|
58
|
+
...(options.callTimeoutMs === undefined ? {} : { callTimeoutMs: options.callTimeoutMs }),
|
|
59
|
+
...(options.spawnFn === undefined ? {} : { spawnFn: options.spawnFn }),
|
|
60
|
+
});
|
|
61
|
+
await client.initialize();
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
options.logger?.error('mcp registry: connection failed to initialize, skipping', {
|
|
65
|
+
connection: connection.id,
|
|
66
|
+
error: error instanceof Error ? error.message : String(error),
|
|
67
|
+
});
|
|
68
|
+
await sandbox.cleanup();
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
clients.push(client);
|
|
72
|
+
sandboxes.push(sandbox);
|
|
73
|
+
for (const tool of connection.exposedTools) {
|
|
74
|
+
definitions.push(wrapMcpTool({
|
|
75
|
+
client,
|
|
76
|
+
remoteName: tool.remoteName,
|
|
77
|
+
name: localToolName(connection, tool.localName),
|
|
78
|
+
version: '1.0.0',
|
|
79
|
+
description: tool.description,
|
|
80
|
+
input: OPAQUE_INPUT,
|
|
81
|
+
output: z.unknown(),
|
|
82
|
+
permissions: [permissionFor(connection, tool.remoteName)],
|
|
83
|
+
sideEffects: tool.sideEffects,
|
|
84
|
+
reversible: tool.reversible,
|
|
85
|
+
cost: tool.cost,
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
definitions,
|
|
91
|
+
async dispose() {
|
|
92
|
+
for (const client of clients)
|
|
93
|
+
client.close();
|
|
94
|
+
await Promise.all(sandboxes.map((sandbox) => sandbox.cleanup()));
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=tool-definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-definitions.js","sourceRoot":"","sources":["../../src/registry/tool-definitions.ts"],"names":[],"mappings":"AAEA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,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;gBACzD,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,WAAW;QACX,KAAK,CAAC,OAAO;YACX,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,MAAM,CAAC,KAAK,EAAE,CAAA;YAC5C,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QAClE,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogenta/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server and client — the tool registry, exposed.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@cogenta/agents": "0.
|
|
32
|
-
"@cogenta/core": "0.
|
|
31
|
+
"@cogenta/agents": "0.4.0",
|
|
32
|
+
"@cogenta/core": "0.6.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^7.0.2",
|