@clearagents/mcp-server 0.2.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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +263 -0
- package/dist/index.js.map +1 -0
- package/package.json +25 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
const API_URL = (process.env["CLEARAGENT_API_URL"] ?? "http://localhost:3000").replace(/\/$/, "");
|
|
6
|
+
const API_KEY = process.env["CLEARAGENT_API_KEY"] ?? "";
|
|
7
|
+
// ─── API helpers ──────────────────────────────────────────────────────────────
|
|
8
|
+
async function apiCall(method, path, body) {
|
|
9
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
10
|
+
method,
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
14
|
+
},
|
|
15
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok) {
|
|
18
|
+
const payload = await res.json().catch(() => ({}));
|
|
19
|
+
const errObj = payload["error"];
|
|
20
|
+
throw new Error(errObj?.["message"] ?? `API error ${res.status}: ${res.statusText}`);
|
|
21
|
+
}
|
|
22
|
+
return res.json();
|
|
23
|
+
}
|
|
24
|
+
async function pollJob(jobId, maxAttempts = 30, intervalMs = 500) {
|
|
25
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
26
|
+
const job = await apiCall("GET", `/v1/jobs/${jobId}`);
|
|
27
|
+
if (job["status"] === "completed" && job["eventId"]) {
|
|
28
|
+
const event = await apiCall("GET", `/v1/events/${job["eventId"]}`);
|
|
29
|
+
return {
|
|
30
|
+
eventId: job["eventId"],
|
|
31
|
+
requiresReview: event["requiresReview"],
|
|
32
|
+
contentHash: event["contentHash"],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (job["status"] === "failed") {
|
|
36
|
+
throw new Error(job["error"] ?? "Verification job failed");
|
|
37
|
+
}
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
39
|
+
}
|
|
40
|
+
throw new Error(`Job ${jobId} did not complete after ${maxAttempts} attempts`);
|
|
41
|
+
}
|
|
42
|
+
// ─── Tool definitions ─────────────────────────────────────────────────────────
|
|
43
|
+
const TOOLS = [
|
|
44
|
+
{
|
|
45
|
+
name: "clearagent_verify",
|
|
46
|
+
description: "Submit an AI agent decision for verification. Creates a tamper-evident, hash-chained audit trail entry (EU AI Act Art. 12). Returns a jobId — call clearagent_poll to retrieve the result.",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
input: {
|
|
51
|
+
type: "object",
|
|
52
|
+
description: "The input the agent received (e.g. transaction details, request data)",
|
|
53
|
+
},
|
|
54
|
+
eventType: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Type of event (default: settlement_signal)",
|
|
57
|
+
default: "settlement_signal",
|
|
58
|
+
},
|
|
59
|
+
eventCategory: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Category of decision (default: transaction)",
|
|
62
|
+
default: "transaction",
|
|
63
|
+
},
|
|
64
|
+
sessionId: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "UUID to group related events in a session",
|
|
67
|
+
},
|
|
68
|
+
parentEventId: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "UUID of parent event for multi-step chains",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ["input"],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "clearagent_poll",
|
|
78
|
+
description: "Poll for the result of a verification job submitted via clearagent_verify. Returns the event ID, content hash, and whether human review is required (EU AI Act Art. 14).",
|
|
79
|
+
inputSchema: {
|
|
80
|
+
type: "object",
|
|
81
|
+
properties: {
|
|
82
|
+
jobId: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "The job ID returned by clearagent_verify",
|
|
85
|
+
},
|
|
86
|
+
maxAttempts: {
|
|
87
|
+
type: "number",
|
|
88
|
+
description: "Maximum polling attempts before timeout (default: 30)",
|
|
89
|
+
default: 30,
|
|
90
|
+
},
|
|
91
|
+
intervalMs: {
|
|
92
|
+
type: "number",
|
|
93
|
+
description: "Milliseconds between poll attempts (default: 500)",
|
|
94
|
+
default: 500,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ["jobId"],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "clearagent_audit_integrity",
|
|
102
|
+
description: "Verify the integrity of the ClearAgent hash chain. Recomputes the SHA-256 Merkle root over all events and reports whether any record has been tampered with (EU AI Act Art. 12 + 19).",
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: "object",
|
|
105
|
+
properties: {},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "clearagent_submit_review",
|
|
110
|
+
description: "Submit a human review for a flagged verification event. Required when clearagent_poll returns requiresReview: true. Justification must be at least 10 characters (EU AI Act Art. 14 mandatory justification).",
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
eventId: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "The event ID to review",
|
|
117
|
+
},
|
|
118
|
+
action: {
|
|
119
|
+
type: "string",
|
|
120
|
+
enum: ["approve", "reject", "override"],
|
|
121
|
+
description: "The review decision",
|
|
122
|
+
},
|
|
123
|
+
justification: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "Mandatory justification for the decision (minimum 10 characters — EU AI Act Art. 14)",
|
|
126
|
+
minLength: 10,
|
|
127
|
+
},
|
|
128
|
+
reviewerId: {
|
|
129
|
+
type: "string",
|
|
130
|
+
description: "Identifier of the human reviewer",
|
|
131
|
+
},
|
|
132
|
+
reviewerEmail: {
|
|
133
|
+
type: "string",
|
|
134
|
+
description: "Email address of the human reviewer",
|
|
135
|
+
},
|
|
136
|
+
reviewerRole: {
|
|
137
|
+
type: "string",
|
|
138
|
+
description: "Role of the reviewer (e.g. compliance_officer, risk_manager)",
|
|
139
|
+
},
|
|
140
|
+
overrideDecision: {
|
|
141
|
+
type: "string",
|
|
142
|
+
description: "Required when action = override: the replacement decision",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
required: ["eventId", "action", "justification", "reviewerId", "reviewerEmail", "reviewerRole"],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
// ─── Server setup ─────────────────────────────────────────────────────────────
|
|
150
|
+
const server = new Server({ name: "clearagent", version: "0.2.0" }, { capabilities: { tools: {} } });
|
|
151
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
152
|
+
tools: TOOLS,
|
|
153
|
+
}));
|
|
154
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
155
|
+
const { name, arguments: args = {} } = request.params;
|
|
156
|
+
const toolArgs = args;
|
|
157
|
+
try {
|
|
158
|
+
switch (name) {
|
|
159
|
+
case "clearagent_verify": {
|
|
160
|
+
const result = await apiCall("POST", "/v1/events/verify", toolArgs);
|
|
161
|
+
return {
|
|
162
|
+
content: [
|
|
163
|
+
{
|
|
164
|
+
type: "text",
|
|
165
|
+
text: JSON.stringify({
|
|
166
|
+
success: true,
|
|
167
|
+
jobId: result["jobId"],
|
|
168
|
+
message: "Verification queued. Call clearagent_poll with this jobId to get the result.",
|
|
169
|
+
}),
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
case "clearagent_poll": {
|
|
175
|
+
const jobId = toolArgs["jobId"];
|
|
176
|
+
const maxAttempts = toolArgs["maxAttempts"] ?? 30;
|
|
177
|
+
const intervalMs = toolArgs["intervalMs"] ?? 500;
|
|
178
|
+
const result = await pollJob(jobId, maxAttempts, intervalMs);
|
|
179
|
+
return {
|
|
180
|
+
content: [
|
|
181
|
+
{
|
|
182
|
+
type: "text",
|
|
183
|
+
text: JSON.stringify({
|
|
184
|
+
success: true,
|
|
185
|
+
eventId: result.eventId,
|
|
186
|
+
contentHash: result.contentHash,
|
|
187
|
+
requiresReview: result.requiresReview,
|
|
188
|
+
message: result.requiresReview
|
|
189
|
+
? "Human review required (EU AI Act Art. 14). Call clearagent_submit_review with the eventId."
|
|
190
|
+
: "Verification complete. Decision is hash-chained in the immutable audit trail.",
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case "clearagent_audit_integrity": {
|
|
197
|
+
const result = await apiCall("GET", "/v1/audit/integrity");
|
|
198
|
+
return {
|
|
199
|
+
content: [
|
|
200
|
+
{
|
|
201
|
+
type: "text",
|
|
202
|
+
text: JSON.stringify({
|
|
203
|
+
success: true,
|
|
204
|
+
validChain: result["validChain"],
|
|
205
|
+
totalEvents: result["totalEvents"],
|
|
206
|
+
merkleRoot: result["merkleRoot"],
|
|
207
|
+
checkedAt: result["checkedAt"],
|
|
208
|
+
brokenAt: result["brokenAt"] ?? null,
|
|
209
|
+
message: result["validChain"] === true
|
|
210
|
+
? `Hash chain intact across ${result["totalEvents"]} events. Merkle root: ${result["merkleRoot"]}`
|
|
211
|
+
: `ALERT: Hash chain integrity violation detected at event ${result["brokenAt"]}`,
|
|
212
|
+
}),
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
case "clearagent_submit_review": {
|
|
218
|
+
const result = await apiCall("POST", "/v1/reviews", toolArgs);
|
|
219
|
+
return {
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: "text",
|
|
223
|
+
text: JSON.stringify({
|
|
224
|
+
success: true,
|
|
225
|
+
reviewId: result["id"],
|
|
226
|
+
action: result["action"],
|
|
227
|
+
contentHash: result["contentHash"],
|
|
228
|
+
message: `Human review logged (EU AI Act Art. 14). Review ID: ${result["id"]}. This decision is permanently recorded in the immutable audit trail.`,
|
|
229
|
+
}),
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
default:
|
|
235
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
return {
|
|
240
|
+
content: [
|
|
241
|
+
{
|
|
242
|
+
type: "text",
|
|
243
|
+
text: JSON.stringify({
|
|
244
|
+
success: false,
|
|
245
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
246
|
+
}),
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
isError: true,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
// ─── Entry point ──────────────────────────────────────────────────────────────
|
|
254
|
+
async function main() {
|
|
255
|
+
const transport = new StdioServerTransport();
|
|
256
|
+
await server.connect(transport);
|
|
257
|
+
process.stderr.write("ClearAgent MCP server v0.2.0 running on stdio\n");
|
|
258
|
+
}
|
|
259
|
+
main().catch((err) => {
|
|
260
|
+
process.stderr.write(`Fatal error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
261
|
+
process.exit(1);
|
|
262
|
+
});
|
|
263
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA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AAO,EAAE,KAAK;wBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;qBAChE,CAAC;iBACH;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,iFAAiF;AAEjF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAC1E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@clearagents/mcp-server",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server for ClearAgent AI verification and audit trail",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"clearagent-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.6.0",
|
|
23
|
+
"@types/node": "^22.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|