@uvrn/mcp 1.0.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 +446 -0
- package/dist/__tests__/fixtures/bundles.d.ts +4 -0
- package/dist/__tests__/fixtures/bundles.d.ts.map +1 -0
- package/dist/__tests__/fixtures/bundles.js +75 -0
- package/dist/__tests__/fixtures/bundles.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +26 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +17 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +45 -0
- package/dist/logger.js.map +1 -0
- package/dist/prompts/templates.d.ts +34 -0
- package/dist/prompts/templates.d.ts.map +1 -0
- package/dist/prompts/templates.js +102 -0
- package/dist/prompts/templates.js.map +1 -0
- package/dist/resources/handlers.d.ts +33 -0
- package/dist/resources/handlers.d.ts.map +1 -0
- package/dist/resources/handlers.js +94 -0
- package/dist/resources/handlers.js.map +1 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +256 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/handlers.d.ts +21 -0
- package/dist/tools/handlers.d.ts.map +1 -0
- package/dist/tools/handlers.js +141 -0
- package/dist/tools/handlers.js.map +1 -0
- package/dist/tools/schemas.d.ts +147 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +109 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +43 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;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M,GAAG,IAAI,MAAM,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompt Templates
|
|
3
|
+
* Provides reusable prompt templates for common Delta Engine tasks
|
|
4
|
+
*/
|
|
5
|
+
export interface PromptTemplate {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
template: string;
|
|
9
|
+
parameters?: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Prompt: verify_data
|
|
13
|
+
* Template for data verification queries
|
|
14
|
+
*/
|
|
15
|
+
export declare const verifyDataPrompt: PromptTemplate;
|
|
16
|
+
/**
|
|
17
|
+
* Prompt: create_bundle
|
|
18
|
+
* Template for bundle creation guidance
|
|
19
|
+
*/
|
|
20
|
+
export declare const createBundlePrompt: PromptTemplate;
|
|
21
|
+
/**
|
|
22
|
+
* Prompt: analyze_receipt
|
|
23
|
+
* Template for receipt analysis
|
|
24
|
+
*/
|
|
25
|
+
export declare const analyzeReceiptPrompt: PromptTemplate;
|
|
26
|
+
/**
|
|
27
|
+
* Get prompt by name
|
|
28
|
+
*/
|
|
29
|
+
export declare function getPrompt(name: string): Promise<PromptTemplate>;
|
|
30
|
+
/**
|
|
31
|
+
* List all available prompts
|
|
32
|
+
*/
|
|
33
|
+
export declare function listPrompts(): Promise<PromptTemplate[]>;
|
|
34
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/prompts/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAkB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,cAkBhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAkBlC,CAAC;AAEF;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAgBrE;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAE7D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Prompt Templates
|
|
4
|
+
* Provides reusable prompt templates for common Delta Engine tasks
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.analyzeReceiptPrompt = exports.createBundlePrompt = exports.verifyDataPrompt = void 0;
|
|
8
|
+
exports.getPrompt = getPrompt;
|
|
9
|
+
exports.listPrompts = listPrompts;
|
|
10
|
+
const logger_1 = require("../logger");
|
|
11
|
+
/**
|
|
12
|
+
* Prompt: verify_data
|
|
13
|
+
* Template for data verification queries
|
|
14
|
+
*/
|
|
15
|
+
exports.verifyDataPrompt = {
|
|
16
|
+
name: 'verify_data',
|
|
17
|
+
description: 'Template for verifying data across multiple sources',
|
|
18
|
+
parameters: ['claim', 'sources'],
|
|
19
|
+
template: `I need to verify the following claim using Delta Engine:
|
|
20
|
+
|
|
21
|
+
Claim: {{claim}}
|
|
22
|
+
|
|
23
|
+
Please help me:
|
|
24
|
+
1. Create a DeltaBundle with data from these sources: {{sources}}
|
|
25
|
+
2. Run the delta_run_engine tool to process the bundle
|
|
26
|
+
3. Analyze the receipt and explain:
|
|
27
|
+
- What is the consensus outcome?
|
|
28
|
+
- What is the final delta between sources?
|
|
29
|
+
- Are the sources in agreement within the threshold?
|
|
30
|
+
- What rounds were needed to reach the outcome?
|
|
31
|
+
|
|
32
|
+
Format the bundle with appropriate thresholdPct and dataSpecs.`,
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Prompt: create_bundle
|
|
36
|
+
* Template for bundle creation guidance
|
|
37
|
+
*/
|
|
38
|
+
exports.createBundlePrompt = {
|
|
39
|
+
name: 'create_bundle',
|
|
40
|
+
description: 'Guide user through creating a DeltaBundle',
|
|
41
|
+
parameters: ['claim'],
|
|
42
|
+
template: `I want to create a DeltaBundle to verify: {{claim}}
|
|
43
|
+
|
|
44
|
+
Please guide me through:
|
|
45
|
+
1. What data sources should I include? (minimum 2 required)
|
|
46
|
+
2. What metrics should I compare across sources?
|
|
47
|
+
3. What threshold percentage should I use?
|
|
48
|
+
4. Help me structure the bundle JSON with:
|
|
49
|
+
- bundleId: unique identifier
|
|
50
|
+
- claim: the verification claim
|
|
51
|
+
- dataSpecs: array of at least 2 data specifications
|
|
52
|
+
- thresholdPct: acceptable variance (0.0 to 1.0)
|
|
53
|
+
- maxRounds: optional, defaults to 5
|
|
54
|
+
|
|
55
|
+
Once we have the bundle structure, we can use delta_validate_bundle to check it before running.`,
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Prompt: analyze_receipt
|
|
59
|
+
* Template for receipt analysis
|
|
60
|
+
*/
|
|
61
|
+
exports.analyzeReceiptPrompt = {
|
|
62
|
+
name: 'analyze_receipt',
|
|
63
|
+
description: 'Analyze a Delta Engine receipt',
|
|
64
|
+
parameters: ['receipt_json'],
|
|
65
|
+
template: `Please analyze this Delta Engine receipt:
|
|
66
|
+
|
|
67
|
+
{{receipt_json}}
|
|
68
|
+
|
|
69
|
+
Help me understand:
|
|
70
|
+
1. What was being verified? (bundleId and sources)
|
|
71
|
+
2. What was the outcome? (consensus or indeterminate)
|
|
72
|
+
3. What was the final delta between sources?
|
|
73
|
+
4. How many rounds were needed?
|
|
74
|
+
5. For each round, what were the deltas by metric?
|
|
75
|
+
6. Is the receipt hash valid? (use delta_verify_receipt to check)
|
|
76
|
+
7. What does this tell us about data agreement across sources?
|
|
77
|
+
|
|
78
|
+
Provide a clear explanation of the verification results.`,
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Get prompt by name
|
|
82
|
+
*/
|
|
83
|
+
async function getPrompt(name) {
|
|
84
|
+
logger_1.logger.debug('getPrompt called', { name });
|
|
85
|
+
switch (name) {
|
|
86
|
+
case 'verify_data':
|
|
87
|
+
return exports.verifyDataPrompt;
|
|
88
|
+
case 'create_bundle':
|
|
89
|
+
return exports.createBundlePrompt;
|
|
90
|
+
case 'analyze_receipt':
|
|
91
|
+
return exports.analyzeReceiptPrompt;
|
|
92
|
+
default:
|
|
93
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* List all available prompts
|
|
98
|
+
*/
|
|
99
|
+
async function listPrompts() {
|
|
100
|
+
return [exports.verifyDataPrompt, exports.createBundlePrompt, exports.analyzeReceiptPrompt];
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/prompts/templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsFH,8BAgBC;AAKD,kCAEC;AA3GD,sCAAmC;AASnC;;;GAGG;AACU,QAAA,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,qDAAqD;IAClE,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;IAChC,QAAQ,EAAE;;;;;;;;;;;;;+DAamD;CAC9D,CAAC;AAEF;;;GAGG;AACU,QAAA,kBAAkB,GAAmB;IAChD,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,2CAA2C;IACxD,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,QAAQ,EAAE;;;;;;;;;;;;;gGAaoF;CAC/F,CAAC;AAEF;;;GAGG;AACU,QAAA,oBAAoB,GAAmB;IAClD,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,gCAAgC;IAC7C,UAAU,EAAE,CAAC,cAAc,CAAC;IAC5B,QAAQ,EAAE;;;;;;;;;;;;;yDAa6C;CACxD,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,eAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa;YAChB,OAAO,wBAAgB,CAAC;QAE1B,KAAK,eAAe;YAClB,OAAO,0BAAkB,CAAC;QAE5B,KAAK,iBAAiB;YACpB,OAAO,4BAAoB,CAAC;QAE9B;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW;IAC/B,OAAO,CAAC,wBAAgB,EAAE,0BAAkB,EAAE,4BAAoB,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Resource Handlers
|
|
3
|
+
* Provides access to schemas and stored data via MCP resources
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Schema resources
|
|
7
|
+
*/
|
|
8
|
+
export declare function getBundleSchema(): Promise<unknown>;
|
|
9
|
+
export declare function getReceiptSchema(): Promise<unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Receipt retrieval by UVRN
|
|
12
|
+
* Note: In Phase A.3, we don't have persistent storage yet
|
|
13
|
+
* This is a placeholder for future implementation
|
|
14
|
+
*/
|
|
15
|
+
export declare function getReceiptByUvrn(uvrn: string): Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Bundle retrieval by ID
|
|
18
|
+
* Note: In Phase A.3, we don't have persistent storage yet
|
|
19
|
+
* This is a placeholder for future implementation
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBundleById(id: string): Promise<unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Resource URI parser
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseResourceUri(uri: string): {
|
|
26
|
+
type: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Main resource handler
|
|
31
|
+
*/
|
|
32
|
+
export declare function handleResource(uri: string): Promise<unknown>;
|
|
33
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/resources/handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AAEH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAGxD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAGzD;AAED;;;;GAIG;AAEH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKrE;AAED;;;;GAIG;AAEH,wBAAsB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKhE;AAED;;GAEG;AAEH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CA0B3E;AAED;;GAEG;AAEH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBlE"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Resource Handlers
|
|
4
|
+
* Provides access to schemas and stored data via MCP resources
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getBundleSchema = getBundleSchema;
|
|
8
|
+
exports.getReceiptSchema = getReceiptSchema;
|
|
9
|
+
exports.getReceiptByUvrn = getReceiptByUvrn;
|
|
10
|
+
exports.getBundleById = getBundleById;
|
|
11
|
+
exports.parseResourceUri = parseResourceUri;
|
|
12
|
+
exports.handleResource = handleResource;
|
|
13
|
+
const types_1 = require("../types");
|
|
14
|
+
const logger_1 = require("../logger");
|
|
15
|
+
const schemas_1 = require("../tools/schemas");
|
|
16
|
+
/**
|
|
17
|
+
* Schema resources
|
|
18
|
+
*/
|
|
19
|
+
async function getBundleSchema() {
|
|
20
|
+
logger_1.logger.debug('getBundleSchema called');
|
|
21
|
+
return schemas_1.runEngineSchema.properties.bundle;
|
|
22
|
+
}
|
|
23
|
+
async function getReceiptSchema() {
|
|
24
|
+
logger_1.logger.debug('getReceiptSchema called');
|
|
25
|
+
return schemas_1.verifyReceiptSchema.properties.receipt;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Receipt retrieval by UVRN
|
|
29
|
+
* Note: In Phase A.3, we don't have persistent storage yet
|
|
30
|
+
* This is a placeholder for future implementation
|
|
31
|
+
*/
|
|
32
|
+
async function getReceiptByUvrn(uvrn) {
|
|
33
|
+
logger_1.logger.debug('getReceiptByUvrn called', { uvrn });
|
|
34
|
+
// TODO: Implement receipt storage/retrieval in future phase
|
|
35
|
+
throw new types_1.ResourceNotFoundError(`Receipt with UVRN ${uvrn} not found (storage not yet implemented)`);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Bundle retrieval by ID
|
|
39
|
+
* Note: In Phase A.3, we don't have persistent storage yet
|
|
40
|
+
* This is a placeholder for future implementation
|
|
41
|
+
*/
|
|
42
|
+
async function getBundleById(id) {
|
|
43
|
+
logger_1.logger.debug('getBundleById called', { id });
|
|
44
|
+
// TODO: Implement bundle storage/retrieval in future phase
|
|
45
|
+
throw new types_1.ResourceNotFoundError(`Bundle with ID ${id} not found (storage not yet implemented)`);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Resource URI parser
|
|
49
|
+
*/
|
|
50
|
+
function parseResourceUri(uri) {
|
|
51
|
+
logger_1.logger.debug('parseResourceUri', { uri });
|
|
52
|
+
// mcp://delta-engine/schema/bundle
|
|
53
|
+
if (uri === 'mcp://delta-engine/schema/bundle') {
|
|
54
|
+
return { type: 'schema-bundle' };
|
|
55
|
+
}
|
|
56
|
+
// mcp://delta-engine/schema/receipt
|
|
57
|
+
if (uri === 'mcp://delta-engine/schema/receipt') {
|
|
58
|
+
return { type: 'schema-receipt' };
|
|
59
|
+
}
|
|
60
|
+
// mcp://delta-engine/receipts/{uvrn}
|
|
61
|
+
const receiptMatch = uri.match(/^mcp:\/\/delta-engine\/receipts\/(.+)$/);
|
|
62
|
+
if (receiptMatch) {
|
|
63
|
+
return { type: 'receipt', id: receiptMatch[1] };
|
|
64
|
+
}
|
|
65
|
+
// mcp://delta-engine/bundles/{id}
|
|
66
|
+
const bundleMatch = uri.match(/^mcp:\/\/delta-engine\/bundles\/(.+)$/);
|
|
67
|
+
if (bundleMatch) {
|
|
68
|
+
return { type: 'bundle', id: bundleMatch[1] };
|
|
69
|
+
}
|
|
70
|
+
throw new types_1.ResourceNotFoundError(`Invalid resource URI: ${uri}`);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Main resource handler
|
|
74
|
+
*/
|
|
75
|
+
async function handleResource(uri) {
|
|
76
|
+
const parsed = parseResourceUri(uri);
|
|
77
|
+
switch (parsed.type) {
|
|
78
|
+
case 'schema-bundle':
|
|
79
|
+
return getBundleSchema();
|
|
80
|
+
case 'schema-receipt':
|
|
81
|
+
return getReceiptSchema();
|
|
82
|
+
case 'receipt':
|
|
83
|
+
if (!parsed.id)
|
|
84
|
+
throw new types_1.ResourceNotFoundError('Receipt UVRN missing');
|
|
85
|
+
return getReceiptByUvrn(parsed.id);
|
|
86
|
+
case 'bundle':
|
|
87
|
+
if (!parsed.id)
|
|
88
|
+
throw new types_1.ResourceNotFoundError('Bundle ID missing');
|
|
89
|
+
return getBundleById(parsed.id);
|
|
90
|
+
default:
|
|
91
|
+
throw new types_1.ResourceNotFoundError(`Unknown resource type: ${parsed.type}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/resources/handlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAUH,0CAGC;AAED,4CAGC;AAQD,4CAKC;AAQD,sCAKC;AAMD,4CA0BC;AAMD,wCAqBC;AArGD,oCAAiD;AACjD,sCAAmC;AACnC,8CAAwE;AAExE;;GAEG;AAEI,KAAK,UAAU,eAAe;IACnC,eAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACvC,OAAO,yBAAe,CAAC,UAAU,CAAC,MAAM,CAAC;AAC3C,CAAC;AAEM,KAAK,UAAU,gBAAgB;IACpC,eAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACxC,OAAO,6BAAmB,CAAC,UAAU,CAAC,OAAO,CAAC;AAChD,CAAC;AAED;;;;GAIG;AAEI,KAAK,UAAU,gBAAgB,CAAC,IAAY;IACjD,eAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,4DAA4D;IAC5D,MAAM,IAAI,6BAAqB,CAAC,qBAAqB,IAAI,0CAA0C,CAAC,CAAC;AACvG,CAAC;AAED;;;;GAIG;AAEI,KAAK,UAAU,aAAa,CAAC,EAAU;IAC5C,eAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE7C,2DAA2D;IAC3D,MAAM,IAAI,6BAAqB,CAAC,kBAAkB,EAAE,0CAA0C,CAAC,CAAC;AAClG,CAAC;AAED;;GAEG;AAEH,SAAgB,gBAAgB,CAAC,GAAW;IAC1C,eAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAE1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,6BAAqB,CAAC,mBAAmB,CAAC,CAAC;YACrE,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAElC;YACE,MAAM,IAAI,6BAAqB,CAAC,0BAA0B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delta Engine MCP Server
|
|
3
|
+
* Main server implementation using MCP SDK
|
|
4
|
+
*/
|
|
5
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Create and configure the MCP server
|
|
8
|
+
*/
|
|
9
|
+
export declare function createServer(): Server;
|
|
10
|
+
/**
|
|
11
|
+
* Start the MCP server
|
|
12
|
+
*/
|
|
13
|
+
export declare function startServer(): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAuBnE;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAuPrC;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAcjD"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Delta Engine MCP Server
|
|
4
|
+
* Main server implementation using MCP SDK
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createServer = createServer;
|
|
8
|
+
exports.startServer = startServer;
|
|
9
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
10
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
11
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
12
|
+
const logger_1 = require("./logger");
|
|
13
|
+
const handlers_1 = require("./tools/handlers");
|
|
14
|
+
const schemas_1 = require("./tools/schemas");
|
|
15
|
+
const handlers_2 = require("./resources/handlers");
|
|
16
|
+
const templates_1 = require("./prompts/templates");
|
|
17
|
+
const types_1 = require("./types");
|
|
18
|
+
/**
|
|
19
|
+
* Create and configure the MCP server
|
|
20
|
+
*/
|
|
21
|
+
function createServer() {
|
|
22
|
+
const server = new index_js_1.Server({
|
|
23
|
+
name: 'delta-engine-mcp',
|
|
24
|
+
version: '1.0.0',
|
|
25
|
+
}, {
|
|
26
|
+
capabilities: {
|
|
27
|
+
tools: {},
|
|
28
|
+
resources: {},
|
|
29
|
+
prompts: {},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Tool Handlers
|
|
34
|
+
*/
|
|
35
|
+
// List available tools
|
|
36
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
37
|
+
logger_1.logger.debug('ListTools request received');
|
|
38
|
+
return {
|
|
39
|
+
tools: [
|
|
40
|
+
{
|
|
41
|
+
name: 'delta_run_engine',
|
|
42
|
+
description: 'Execute the Delta Engine on a bundle to verify data consensus across sources. ' +
|
|
43
|
+
'Returns a DeltaReceipt with outcome (consensus/indeterminate) and round-by-round analysis.',
|
|
44
|
+
inputSchema: schemas_1.runEngineSchema,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'delta_validate_bundle',
|
|
48
|
+
description: 'Validate a DeltaBundle structure without executing the engine. ' +
|
|
49
|
+
'Checks required fields, data types, and structural integrity.',
|
|
50
|
+
inputSchema: schemas_1.validateBundleSchema,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'delta_verify_receipt',
|
|
54
|
+
description: 'Verify the integrity of a DeltaReceipt by recomputing its hash. ' +
|
|
55
|
+
'Ensures the receipt has not been tampered with.',
|
|
56
|
+
inputSchema: schemas_1.verifyReceiptSchema,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
// Handle tool calls
|
|
62
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
63
|
+
logger_1.logger.debug('CallTool request received', { tool: request.params.name });
|
|
64
|
+
try {
|
|
65
|
+
switch (request.params.name) {
|
|
66
|
+
case 'delta_run_engine': {
|
|
67
|
+
const result = await (0, handlers_1.handleRunEngine)(request.params.arguments);
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: 'text',
|
|
72
|
+
text: JSON.stringify(result, null, 2),
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
case 'delta_validate_bundle': {
|
|
78
|
+
const result = await (0, handlers_1.handleValidateBundle)(request.params.arguments);
|
|
79
|
+
return {
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: 'text',
|
|
83
|
+
text: JSON.stringify(result, null, 2),
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
case 'delta_verify_receipt': {
|
|
89
|
+
const result = await (0, handlers_1.handleVerifyReceipt)(request.params.arguments);
|
|
90
|
+
return {
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: 'text',
|
|
94
|
+
text: JSON.stringify(result, null, 2),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
logger_1.logger.error('Tool execution error', { error });
|
|
105
|
+
if (error instanceof types_1.MCPError) {
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: 'text',
|
|
110
|
+
text: JSON.stringify({
|
|
111
|
+
error: error.message,
|
|
112
|
+
code: error.code,
|
|
113
|
+
details: error.details,
|
|
114
|
+
}, null, 2),
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
isError: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
text: JSON.stringify({
|
|
126
|
+
error: message,
|
|
127
|
+
code: 'INTERNAL_ERROR',
|
|
128
|
+
}, null, 2),
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
isError: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Resource Handlers
|
|
137
|
+
*/
|
|
138
|
+
// List available resources
|
|
139
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => {
|
|
140
|
+
logger_1.logger.debug('ListResources request received');
|
|
141
|
+
return {
|
|
142
|
+
resources: [
|
|
143
|
+
{
|
|
144
|
+
uri: 'mcp://delta-engine/schema/bundle',
|
|
145
|
+
name: 'DeltaBundle Schema',
|
|
146
|
+
description: 'JSON schema for DeltaBundle structure',
|
|
147
|
+
mimeType: 'application/json',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
uri: 'mcp://delta-engine/schema/receipt',
|
|
151
|
+
name: 'DeltaReceipt Schema',
|
|
152
|
+
description: 'JSON schema for DeltaReceipt structure',
|
|
153
|
+
mimeType: 'application/json',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
uri: 'mcp://delta-engine/receipts/{uvrn}',
|
|
157
|
+
name: 'Receipt by UVRN',
|
|
158
|
+
description: 'Retrieve a DeltaReceipt by its UVRN (Note: Storage not yet implemented in Phase A.3)',
|
|
159
|
+
mimeType: 'application/json',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
uri: 'mcp://delta-engine/bundles/{id}',
|
|
163
|
+
name: 'Bundle by ID',
|
|
164
|
+
description: 'Retrieve a DeltaBundle by its ID (Note: Storage not yet implemented in Phase A.3)',
|
|
165
|
+
mimeType: 'application/json',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
// Handle resource reads
|
|
171
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
172
|
+
logger_1.logger.debug('ReadResource request received', { uri: request.params.uri });
|
|
173
|
+
try {
|
|
174
|
+
const data = await (0, handlers_2.handleResource)(request.params.uri);
|
|
175
|
+
return {
|
|
176
|
+
contents: [
|
|
177
|
+
{
|
|
178
|
+
uri: request.params.uri,
|
|
179
|
+
mimeType: 'application/json',
|
|
180
|
+
text: JSON.stringify(data, null, 2),
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
logger_1.logger.error('Resource read error', { error });
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* Prompt Handlers
|
|
192
|
+
*/
|
|
193
|
+
// List available prompts
|
|
194
|
+
server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async () => {
|
|
195
|
+
logger_1.logger.debug('ListPrompts request received');
|
|
196
|
+
const prompts = await (0, templates_1.listPrompts)();
|
|
197
|
+
return {
|
|
198
|
+
prompts: prompts.map((p) => ({
|
|
199
|
+
name: p.name,
|
|
200
|
+
description: p.description,
|
|
201
|
+
arguments: p.parameters?.map((param) => ({
|
|
202
|
+
name: param,
|
|
203
|
+
description: `Parameter: ${param}`,
|
|
204
|
+
required: true,
|
|
205
|
+
})) || [],
|
|
206
|
+
})),
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
// Handle prompt requests
|
|
210
|
+
server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
|
|
211
|
+
logger_1.logger.debug('GetPrompt request received', { prompt: request.params.name });
|
|
212
|
+
try {
|
|
213
|
+
const prompt = await (0, templates_1.getPrompt)(request.params.name);
|
|
214
|
+
// Substitute parameters if provided
|
|
215
|
+
let text = prompt.template;
|
|
216
|
+
if (request.params.arguments) {
|
|
217
|
+
Object.entries(request.params.arguments).forEach(([key, value]) => {
|
|
218
|
+
text = text.replace(new RegExp(`{{${key}}}`, 'g'), String(value));
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
description: prompt.description,
|
|
223
|
+
messages: [
|
|
224
|
+
{
|
|
225
|
+
role: 'user',
|
|
226
|
+
content: {
|
|
227
|
+
type: 'text',
|
|
228
|
+
text,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
logger_1.logger.error('Prompt error', { error });
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return server;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Start the MCP server
|
|
243
|
+
*/
|
|
244
|
+
async function startServer() {
|
|
245
|
+
logger_1.logger.info('Starting Delta Engine MCP Server...');
|
|
246
|
+
const server = createServer();
|
|
247
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
248
|
+
await server.connect(transport);
|
|
249
|
+
logger_1.logger.info('Delta Engine MCP Server started successfully');
|
|
250
|
+
logger_1.logger.info('Server capabilities:', {
|
|
251
|
+
tools: 3,
|
|
252
|
+
resources: 4,
|
|
253
|
+
prompts: 3,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA4BH,oCAuPC;AAKD,kCAcC;AApSD,wEAAmE;AACnE,wEAAiF;AACjF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E,KAAK,EAAE,CAAC,CAAC;YACxC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW;IAC/B,eAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,eAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC5D,eAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE;QAClC,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tool Handlers
|
|
3
|
+
* Implements the three core tools for Delta Engine MCP server
|
|
4
|
+
*/
|
|
5
|
+
import { RunEngineInput, RunEngineOutput, ValidateBundleInput, ValidateBundleOutput, VerifyReceiptInput, VerifyReceiptOutput } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Tool: delta_run_engine
|
|
8
|
+
* Executes the Delta Engine on a provided bundle
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleRunEngine(input: RunEngineInput): Promise<RunEngineOutput>;
|
|
11
|
+
/**
|
|
12
|
+
* Tool: delta_validate_bundle
|
|
13
|
+
* Validates bundle structure without executing
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleValidateBundle(input: ValidateBundleInput): Promise<ValidateBundleOutput>;
|
|
16
|
+
/**
|
|
17
|
+
* Tool: delta_verify_receipt
|
|
18
|
+
* Verifies receipt integrity and hash chain
|
|
19
|
+
*/
|
|
20
|
+
export declare function handleVerifyReceipt(input: VerifyReceiptInput): Promise<VerifyReceiptOutput>;
|
|
21
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/tools/handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAIlB;;;GAGG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAyDrF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CAsC/B;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAuC9B"}
|