@engramprotocol/mcp-server 0.9.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 +72 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +77 -0
- package/dist/cli.js.map +1 -0
- package/dist/http-client.d.ts +33 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +106 -0
- package/dist/http-client.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +18 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/_helpers.d.ts +18 -0
- package/dist/tools/_helpers.d.ts.map +1 -0
- package/dist/tools/_helpers.js +37 -0
- package/dist/tools/_helpers.js.map +1 -0
- package/dist/tools/boot.d.ts +4 -0
- package/dist/tools/boot.d.ts.map +1 -0
- package/dist/tools/boot.js +21 -0
- package/dist/tools/boot.js.map +1 -0
- package/dist/tools/confirm-review.d.ts +4 -0
- package/dist/tools/confirm-review.d.ts.map +1 -0
- package/dist/tools/confirm-review.js +18 -0
- package/dist/tools/confirm-review.js.map +1 -0
- package/dist/tools/context.d.ts +4 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +30 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/entity.d.ts +7 -0
- package/dist/tools/entity.d.ts.map +1 -0
- package/dist/tools/entity.js +57 -0
- package/dist/tools/entity.js.map +1 -0
- package/dist/tools/epistemic.d.ts +4 -0
- package/dist/tools/epistemic.d.ts.map +1 -0
- package/dist/tools/epistemic.js +31 -0
- package/dist/tools/epistemic.js.map +1 -0
- package/dist/tools/get.d.ts +4 -0
- package/dist/tools/get.d.ts.map +1 -0
- package/dist/tools/get.js +27 -0
- package/dist/tools/get.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +43 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list.d.ts +4 -0
- package/dist/tools/list.d.ts.map +1 -0
- package/dist/tools/list.js +42 -0
- package/dist/tools/list.js.map +1 -0
- package/dist/tools/recall.d.ts +4 -0
- package/dist/tools/recall.d.ts.map +1 -0
- package/dist/tools/recall.js +20 -0
- package/dist/tools/recall.js.map +1 -0
- package/dist/tools/relate.d.ts +4 -0
- package/dist/tools/relate.d.ts.map +1 -0
- package/dist/tools/relate.js +31 -0
- package/dist/tools/relate.js.map +1 -0
- package/dist/tools/update.d.ts +4 -0
- package/dist/tools/update.d.ts.map +1 -0
- package/dist/tools/update.js +26 -0
- package/dist/tools/update.js.map +1 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @engramprotocol/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP-Wrapper für die EML HTTP-API. Macht das Engram Protocol als MCP-Tools für Claude Code (und andere MCP-Clients) verfügbar — Stdio-Transport, Bearer-Token-Auth gegen `api.engramprotocol.io` (Hosted) oder `localhost:3117` (Self-Host).
|
|
4
|
+
|
|
5
|
+
## Install + Run
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @engramprotocol/mcp-server --url <api-url> --token <bearer>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
oder via Env:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
EML_API_URL=https://api.engramprotocol.io \
|
|
15
|
+
EML_API_TOKEN=eml_<prefix><secret> \
|
|
16
|
+
npx @engramprotocol/mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Claude Code Config
|
|
20
|
+
|
|
21
|
+
In `~/.config/claude-code/mcp_servers.json` (oder dem MCP-Config-Pfad deines Clients):
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"eml": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": [
|
|
29
|
+
"@engramprotocol/mcp-server",
|
|
30
|
+
"--url", "https://api.engramprotocol.io",
|
|
31
|
+
"--token", "eml_<prefix><secret>"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Token bekommst du via `eml control bootstrap-user <email>` auf dem VPS (oder vom Self-Host-Server). Token wird einmalig nach stdout gedruckt — sicher abspeichern.
|
|
39
|
+
|
|
40
|
+
## Tools
|
|
41
|
+
|
|
42
|
+
Alle Tools haben den `eml_`-Prefix.
|
|
43
|
+
|
|
44
|
+
| Tool | HTTP-Endpoint | Use-Case |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| `eml_boot` | `POST /boot` | Identity + Status + Open Tasks bei Session-Start |
|
|
47
|
+
| `eml_recall` | `POST /recall` | Topic-Suche (FTS5 + Recency) |
|
|
48
|
+
| `eml_epistemic_store` | `POST /epistemic` | observation/hypothesis/assessment/prediction/pattern |
|
|
49
|
+
| `eml_context_store` | `POST /context` | decision/rule/profile/status/task/event/log/reference |
|
|
50
|
+
| `eml_list` | `GET /list[/mode]` | Filter-basierte Liste |
|
|
51
|
+
| `eml_get` | `GET /engram/:id` | Einzelnes Engram + Relations |
|
|
52
|
+
| `eml_relate` | `POST /relate` | Typed Relation zwischen 2 Engrams |
|
|
53
|
+
| `eml_update` | `POST /update` | Patch (status/properties/etc.) |
|
|
54
|
+
| `eml_confirm_review` | `POST /engram/:id/confirm-review` | review_due_at-Reset (Brain-Hygiene) |
|
|
55
|
+
| `eml_entity_create` | `POST /entity` | Entity-Registrierung (Pflicht vor `entity.<id>`-scope) |
|
|
56
|
+
| `eml_entity_list` | `GET /entities` | |
|
|
57
|
+
| `eml_entity_get` | `GET /entity/:id` | |
|
|
58
|
+
| `eml_entity_update` | `PUT /entity/:id` | |
|
|
59
|
+
|
|
60
|
+
## Error-Handling
|
|
61
|
+
|
|
62
|
+
Backend-Errors (z.B. 401 invalid token, 400 invalid scope) kommen als `isError: true` mit klarer Message zurück — nicht als MCP-Protocol-Error. Das LLM kann sie selbst korrigieren.
|
|
63
|
+
|
|
64
|
+
Protocol-Errors (malformed JSON-RPC, unbekannter Tool-Name) bleiben dem SDK.
|
|
65
|
+
|
|
66
|
+
## Self-Host
|
|
67
|
+
|
|
68
|
+
Genau gleicher Aufruf, nur `--url http://localhost:3117` (oder der Port deiner Self-Host-Instance).
|
|
69
|
+
|
|
70
|
+
## Lizenz
|
|
71
|
+
|
|
72
|
+
UNLICENSED (v0.9). Public-Self-Host ab v1.0.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const server_1 = require("./server");
|
|
5
|
+
function parseArgs(argv) {
|
|
6
|
+
const out = {};
|
|
7
|
+
for (let i = 0; i < argv.length; i++) {
|
|
8
|
+
const a = argv[i];
|
|
9
|
+
if (a === '--help' || a === '-h') {
|
|
10
|
+
out.help = true;
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (a === '--url') {
|
|
14
|
+
out.url = argv[++i];
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (a === '--token') {
|
|
18
|
+
out.token = argv[++i];
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (a === '--name') {
|
|
22
|
+
out.name = argv[++i];
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
function printHelpAndExit(code) {
|
|
29
|
+
const msg = `eml-mcp-server — MCP-Wrapper für die EML HTTP-API
|
|
30
|
+
|
|
31
|
+
Usage:
|
|
32
|
+
eml-mcp-server --url <api-url> --token <bearer> [--name <client-name>]
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
--url EML_API_URL EML-API-URL (z.B. http://localhost:3117)
|
|
36
|
+
--token EML_API_TOKEN Bearer-Token (eml_<prefix><secret>)
|
|
37
|
+
--name EML_CLIENT_NAME Client-Name in Server-Logs (default: eml-mcp-server)
|
|
38
|
+
--help
|
|
39
|
+
|
|
40
|
+
Beispiel — Claude Code MCP-Config:
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"eml": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["@engramprotocol/mcp-server",
|
|
46
|
+
"--url", "https://api.engramprotocol.io",
|
|
47
|
+
"--token", "eml_..."]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
process.stderr.write(msg);
|
|
53
|
+
process.exit(code);
|
|
54
|
+
}
|
|
55
|
+
async function main() {
|
|
56
|
+
const args = parseArgs(process.argv.slice(2));
|
|
57
|
+
if (args.help)
|
|
58
|
+
printHelpAndExit(0);
|
|
59
|
+
const url = args.url ?? process.env.EML_API_URL;
|
|
60
|
+
const token = args.token ?? process.env.EML_API_TOKEN;
|
|
61
|
+
const clientName = args.name ?? process.env.EML_CLIENT_NAME ?? 'eml-mcp-server';
|
|
62
|
+
if (!url || !token) {
|
|
63
|
+
process.stderr.write('Error: --url + --token (or EML_API_URL + EML_API_TOKEN) are required.\n\n');
|
|
64
|
+
printHelpAndExit(1);
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
await (0, server_1.startMcpServer)({ url, token, clientName });
|
|
68
|
+
process.stderr.write(`[eml-mcp-server] connected, stdio-transport ready (${clientName} → ${url})\n`);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
const e = err;
|
|
72
|
+
process.stderr.write(`[eml-mcp-server] startup failed: ${e.message}\n`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
}
|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|
+
* shippet als schlankes npm-Package (`@engramprotocol/mcp-server`), das nur
|
|
6
|
+
* SDK + zod + dieses File braucht.
|
|
7
|
+
*
|
|
8
|
+
* Error-Handling: alle Failures werfen ein `EmlApiError`. Tools fangen das
|
|
9
|
+
* im Handler und mappen auf `isError: true`-Result (siehe v0.9-PROPOSAL §6.4
|
|
10
|
+
* "Error-Handling — zwei Kanäle").
|
|
11
|
+
*/
|
|
12
|
+
export interface HttpClientOptions {
|
|
13
|
+
url: string;
|
|
14
|
+
token: string;
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class EmlApiError extends Error {
|
|
18
|
+
status: number;
|
|
19
|
+
body: unknown;
|
|
20
|
+
constructor(status: number, body: unknown, message: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class HttpClient {
|
|
23
|
+
private readonly baseUrl;
|
|
24
|
+
private readonly headers;
|
|
25
|
+
private readonly timeoutMs;
|
|
26
|
+
constructor(opts: HttpClientOptions);
|
|
27
|
+
get(path: string, query?: Record<string, string | number | undefined>): Promise<unknown>;
|
|
28
|
+
post(path: string, body?: unknown): Promise<unknown>;
|
|
29
|
+
put(path: string, body?: unknown): Promise<unknown>;
|
|
30
|
+
private buildPath;
|
|
31
|
+
private request;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qBAAa,WAAY,SAAQ,KAAK;IAE3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,OAAO;gBADb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACpB,OAAO,EAAE,MAAM;CAKlB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;gBAEtB,IAAI,EAAE,iBAAiB;IAS7B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxF,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpD,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzD,OAAO,CAAC,SAAS;YAUH,OAAO;CA+BtB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Thin fetch-Wrapper für die EML HTTP-API (v0.9-PROPOSAL §6.2).
|
|
4
|
+
*
|
|
5
|
+
* Lebt absichtlich ohne `@engramprotocol/core`-Dependency — der MCP-Server
|
|
6
|
+
* shippet als schlankes npm-Package (`@engramprotocol/mcp-server`), das nur
|
|
7
|
+
* SDK + zod + dieses File braucht.
|
|
8
|
+
*
|
|
9
|
+
* Error-Handling: alle Failures werfen ein `EmlApiError`. Tools fangen das
|
|
10
|
+
* im Handler und mappen auf `isError: true`-Result (siehe v0.9-PROPOSAL §6.4
|
|
11
|
+
* "Error-Handling — zwei Kanäle").
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.HttpClient = exports.EmlApiError = void 0;
|
|
15
|
+
class EmlApiError extends Error {
|
|
16
|
+
status;
|
|
17
|
+
body;
|
|
18
|
+
constructor(status, body, message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.status = status;
|
|
21
|
+
this.body = body;
|
|
22
|
+
this.name = 'EmlApiError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.EmlApiError = EmlApiError;
|
|
26
|
+
class HttpClient {
|
|
27
|
+
baseUrl;
|
|
28
|
+
headers;
|
|
29
|
+
timeoutMs;
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
this.baseUrl = opts.url.replace(/\/+$/, '');
|
|
32
|
+
this.headers = {
|
|
33
|
+
'Authorization': `Bearer ${opts.token}`,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
};
|
|
36
|
+
this.timeoutMs = opts.timeoutMs ?? 30_000;
|
|
37
|
+
}
|
|
38
|
+
async get(path, query) {
|
|
39
|
+
return this.request('GET', this.buildPath(path, query));
|
|
40
|
+
}
|
|
41
|
+
async post(path, body) {
|
|
42
|
+
return this.request('POST', path, body);
|
|
43
|
+
}
|
|
44
|
+
async put(path, body) {
|
|
45
|
+
return this.request('PUT', path, body);
|
|
46
|
+
}
|
|
47
|
+
buildPath(path, query) {
|
|
48
|
+
if (!query)
|
|
49
|
+
return path;
|
|
50
|
+
const params = [];
|
|
51
|
+
for (const [k, v] of Object.entries(query)) {
|
|
52
|
+
if (v === undefined || v === null)
|
|
53
|
+
continue;
|
|
54
|
+
params.push(`${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`);
|
|
55
|
+
}
|
|
56
|
+
return params.length ? `${path}?${params.join('&')}` : path;
|
|
57
|
+
}
|
|
58
|
+
async request(method, path, body) {
|
|
59
|
+
const controller = new AbortController();
|
|
60
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
61
|
+
try {
|
|
62
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
63
|
+
method,
|
|
64
|
+
headers: this.headers,
|
|
65
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
66
|
+
signal: controller.signal,
|
|
67
|
+
});
|
|
68
|
+
const text = await res.text();
|
|
69
|
+
let parsed = null;
|
|
70
|
+
if (text) {
|
|
71
|
+
try {
|
|
72
|
+
parsed = JSON.parse(text);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
parsed = text;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
const msg = extractErrorMessage(parsed) ?? `HTTP ${res.status}`;
|
|
80
|
+
throw new EmlApiError(res.status, parsed, `${method} ${path} → ${res.status}: ${msg}`);
|
|
81
|
+
}
|
|
82
|
+
return parsed;
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
if (err instanceof EmlApiError)
|
|
86
|
+
throw err;
|
|
87
|
+
const e = err;
|
|
88
|
+
if (e.name === 'AbortError') {
|
|
89
|
+
throw new EmlApiError(0, null, `${method} ${path} timed out after ${this.timeoutMs}ms`);
|
|
90
|
+
}
|
|
91
|
+
throw new EmlApiError(0, null, `${method} ${path} failed: ${e.message}`);
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
clearTimeout(timer);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.HttpClient = HttpClient;
|
|
99
|
+
function extractErrorMessage(body) {
|
|
100
|
+
if (body && typeof body === 'object' && 'error' in body) {
|
|
101
|
+
const e = body.error;
|
|
102
|
+
return typeof e === 'string' ? e : JSON.stringify(e);
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAQH,MAAa,WAAY,SAAQ,KAAK;IAE3B;IACA;IAFT,YACS,MAAc,EACd,IAAa,EACpB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAA;QAJP,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GA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|
+
* Single-Mode HTTP-Client (kein eingebettetes SQLite). Self-Host nutzt es
|
|
5
|
+
* genauso, nur mit `--url http://localhost:3117`.
|
|
6
|
+
*
|
|
7
|
+
* Stdio-Transport: lokaler Process via Claude-Code's MCP-Config gestartet.
|
|
8
|
+
* Capabilities: nur tools (statisch, listChanged=false). Resources/Prompts
|
|
9
|
+
* kommen v0.9.x-Polish.
|
|
10
|
+
*/
|
|
11
|
+
export interface McpServerOptions {
|
|
12
|
+
url: string;
|
|
13
|
+
token: string;
|
|
14
|
+
clientName?: string;
|
|
15
|
+
serverVersion?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function startMcpServer(opts: McpServerOptions): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAY1E"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startMcpServer = startMcpServer;
|
|
4
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
5
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
+
const http_client_1 = require("./http-client");
|
|
7
|
+
const tools_1 = require("./tools");
|
|
8
|
+
async function startMcpServer(opts) {
|
|
9
|
+
const httpClient = new http_client_1.HttpClient({ url: opts.url, token: opts.token });
|
|
10
|
+
const server = new mcp_js_1.McpServer({
|
|
11
|
+
name: opts.clientName ?? 'eml-mcp-server',
|
|
12
|
+
version: opts.serverVersion ?? '0.9.0',
|
|
13
|
+
});
|
|
14
|
+
(0, tools_1.registerAllTools)(server, httpClient);
|
|
15
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
16
|
+
await server.connect(transport);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAuBA,wCAYC;AAnCD,oEAAmE;AACnE,wEAAgF;AAChF,+CAA0C;AAC1C,mCAA0C;AAoBnC,KAAK,UAAU,cAAc,CAAC,IAAsB;IACzD,MAAM,UAAU,GAAG,IAAI,wBAAU,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAEvE,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,IAAI,gBAAgB;QACzC,OAAO,EAAE,IAAI,CAAC,aAAa,IAAI,OAAO;KACvC,CAAC,CAAA;IAEF,IAAA,wBAAgB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEpC,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-Handler-Wrapper (v0.9-PROPOSAL §6.4 "Error-Handling — zwei Kanäle").
|
|
3
|
+
*
|
|
4
|
+
* - Backend-Fehler (z.B. 401/500) → `isError: true` mit Message für das LLM
|
|
5
|
+
* (idealerweise selbst-korrigierbar formuliert)
|
|
6
|
+
* - Protocol-Errors (malformed Request, unknown Tool) bleiben dem SDK
|
|
7
|
+
*
|
|
8
|
+
* Der CallToolResult-Type kommt vom SDK; wir geben nur das Plain-Object
|
|
9
|
+
* zurück — kein Type-Assert hier nötig (das erledigt registerTool).
|
|
10
|
+
*/
|
|
11
|
+
export declare function callTool<T>(fn: () => Promise<T>): Promise<{
|
|
12
|
+
content: Array<{
|
|
13
|
+
type: 'text';
|
|
14
|
+
text: string;
|
|
15
|
+
}>;
|
|
16
|
+
isError?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=_helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../src/tools/_helpers.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAC/D,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAoBD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callTool = callTool;
|
|
4
|
+
const http_client_1 = require("../http-client");
|
|
5
|
+
/**
|
|
6
|
+
* Tool-Handler-Wrapper (v0.9-PROPOSAL §6.4 "Error-Handling — zwei Kanäle").
|
|
7
|
+
*
|
|
8
|
+
* - Backend-Fehler (z.B. 401/500) → `isError: true` mit Message für das LLM
|
|
9
|
+
* (idealerweise selbst-korrigierbar formuliert)
|
|
10
|
+
* - Protocol-Errors (malformed Request, unknown Tool) bleiben dem SDK
|
|
11
|
+
*
|
|
12
|
+
* Der CallToolResult-Type kommt vom SDK; wir geben nur das Plain-Object
|
|
13
|
+
* zurück — kein Type-Assert hier nötig (das erledigt registerTool).
|
|
14
|
+
*/
|
|
15
|
+
async function callTool(fn) {
|
|
16
|
+
try {
|
|
17
|
+
const result = await fn();
|
|
18
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
if (err instanceof http_client_1.EmlApiError) {
|
|
22
|
+
return {
|
|
23
|
+
isError: true,
|
|
24
|
+
content: [{
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: `EML API error (HTTP ${err.status}): ${err.message}`,
|
|
27
|
+
}],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const e = err;
|
|
31
|
+
return {
|
|
32
|
+
isError: true,
|
|
33
|
+
content: [{ type: 'text', text: `Tool execution failed: ${e.message}` }],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_helpers.js","sourceRoot":"","sources":["../../src/tools/_helpers.ts"],"names":[],"mappings":";;AAYA,4BAuBC;AAnCD,gDAA4C;AAE5C;;;;;;;;;GASG;AACI,KAAK,UAAU,QAAQ,CAAI,EAAoB;IAIpD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;QACzB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;IAC/E,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,IAAI,GAAG,YAAY,yBAAW,EAAE,CAAC;YAC/B,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,GAAG,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE;qBAC3D,CAAC;aACH,CAAA;QACH,CAAC;QACD,MAAM,CAAC,GAAG,GAAY,CAAA;QACtB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;SACzE,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAuB1E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerBootTool = registerBootTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
function registerBootTool(server, http) {
|
|
7
|
+
server.registerTool('eml_boot', {
|
|
8
|
+
title: 'Boot Brain',
|
|
9
|
+
description: 'Lädt die Boot-Sicht des Brains: Identity (profile/rule), aktueller Status, ' +
|
|
10
|
+
'Open Tasks, Recent Logs, Brain-Hygiene-Reviews. Am Anfang jeder Session aufrufen, ' +
|
|
11
|
+
'um Kontext nachzuladen — der returned Markdown ist direkt für Context-Window geeignet.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
agent: zod_1.z.string().optional().describe('Agent-ID (z.B. "motti", "default"). Wenn weggelassen, nimmt der Server den Brain-Namen als Default.'),
|
|
14
|
+
caller: zod_1.z.string().optional().describe('Wer den Boot triggert (default: gleicher Wert wie agent).'),
|
|
15
|
+
},
|
|
16
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/boot', {
|
|
17
|
+
agent: args.agent,
|
|
18
|
+
caller: args.caller ?? args.agent,
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=boot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":";;AAKA,4CAuBC;AA5BD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,gBAAgB,CAAC,MAAiB,EAAE,IAAgB;IAClE,MAAM,CAAC,YAAY,CACjB,UAAU,EACV;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,6EAA6E;YAC7E,oFAAoF;YACpF,wFAAwF;QAC1F,WAAW,EAAE;YACX,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnC,qGAAqG,CACtG;YACD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpC,2DAA2D,CAC5D;SACF;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QAChD,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK;KAClC,CAAC,CAAC,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-review.d.ts","sourceRoot":"","sources":["../../src/tools/confirm-review.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAiBnF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerConfirmReviewTool = registerConfirmReviewTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
function registerConfirmReviewTool(server, http) {
|
|
7
|
+
server.registerTool('eml_confirm_review', {
|
|
8
|
+
title: 'Confirm Review',
|
|
9
|
+
description: 'Resettet review_due_at für ein decision/rule/profile-Engram (Brain-Hygiene). ' +
|
|
10
|
+
'Boot zeigt overdue-Engrams an; nach Review-Bestätigung verschwinden sie aus ' +
|
|
11
|
+
'der Liste. Default-Verlängerungen: decision 60d, rule 90d, profile 180d.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
id: zod_1.z.string().describe('Engram-ID. Nur für decision/rule/profile gültig.'),
|
|
14
|
+
caller: zod_1.z.string().optional(),
|
|
15
|
+
},
|
|
16
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post(`/engram/${args.id}/confirm-review`, args.caller ? { caller: args.caller } : {})));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=confirm-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-review.js","sourceRoot":"","sources":["../../src/tools/confirm-review.ts"],"names":[],"mappings":";;AAKA,8DAiBC;AAtBD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,yBAAyB,CAAC,MAAiB,EAAE,IAAgB;IAC3E,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,+EAA+E;YAC/E,8EAA8E;YAC9E,0EAA0E;QAC5E,WAAW,EAAE;YACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YAC3E,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC9B;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,iBAAiB,EAC1E,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC/C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CA+BlF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerContextStoreTool = registerContextStoreTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
const CONTEXT_TYPES = ['decision', 'rule', 'profile', 'status', 'task', 'event', 'log', 'reference'];
|
|
7
|
+
function registerContextStoreTool(server, http) {
|
|
8
|
+
server.registerTool('eml_context_store', {
|
|
9
|
+
title: 'Store Context Engram',
|
|
10
|
+
description: 'Schreibt ein Engram im context-Mode (Handlungsrahmen): ' +
|
|
11
|
+
'decision, rule, profile, status, task, event, log, reference. ' +
|
|
12
|
+
'Status-Engrams brauchen properties.state (Kurzphrase). ' +
|
|
13
|
+
'decision/rule/profile bekommen automatisch review_due_at-Default (60/90/180d).',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
content: zod_1.z.string(),
|
|
16
|
+
type: zod_1.z.enum(CONTEXT_TYPES),
|
|
17
|
+
scope: zod_1.z.string().describe('Scope-Pattern: global | project.<id> | agent.<id> | user.<id> | entity.<id>.'),
|
|
18
|
+
subject: zod_1.z.string().optional(),
|
|
19
|
+
status: zod_1.z.enum(['planned', 'active', 'superseded', 'invalidated', 'expired', 'resolved']).optional(),
|
|
20
|
+
significance: zod_1.z.enum(['critical', 'high', 'normal', 'low', 'trivial']).optional(),
|
|
21
|
+
properties: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Type-spezifische Felder + provenance. Required pro Type: ' +
|
|
22
|
+
'rule→enforcement; status→state; event→occurred_at+change_type. ' +
|
|
23
|
+
'Plus source_id+source_type immer.'),
|
|
24
|
+
ingestion_method: zod_1.z.enum(['hook', 'direct', 'bulk', 'other']).optional(),
|
|
25
|
+
session_id: zod_1.z.string().optional(),
|
|
26
|
+
caller: zod_1.z.string().optional(),
|
|
27
|
+
},
|
|
28
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/context', args)));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":";;AAOA,4DA+BC;AAtCD,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAU,CAAA;AAE7G,SAAgB,wBAAwB,CAAC,MAAiB,EAAE,IAAgB;IAC1E,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,yDAAyD;YACzD,gEAAgE;YAChE,yDAAyD;YACzD,gFAAgF;QAClF,WAAW,EAAE;YACX,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,aAAa,CAAC;YAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CACxB,8EAA8E,CAC/E;YACD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;YACpG,YAAY,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;YACjF,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC/D,2DAA2D;gBAC3D,iEAAiE;gBACjE,mCAAmC,CACpC;YACD,gBAAgB,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;YACxE,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC9B;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAC5D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { HttpClient } from '../http-client';
|
|
3
|
+
export declare function registerEntityCreateTool(server: McpServer, http: HttpClient): void;
|
|
4
|
+
export declare function registerEntityListTool(server: McpServer, http: HttpClient): void;
|
|
5
|
+
export declare function registerEntityGetTool(server: McpServer, http: HttpClient): void;
|
|
6
|
+
export declare function registerEntityUpdateTool(server: McpServer, http: HttpClient): void;
|
|
7
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAkBlF;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAYhF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAY/E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAkBlF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerEntityCreateTool = registerEntityCreateTool;
|
|
4
|
+
exports.registerEntityListTool = registerEntityListTool;
|
|
5
|
+
exports.registerEntityGetTool = registerEntityGetTool;
|
|
6
|
+
exports.registerEntityUpdateTool = registerEntityUpdateTool;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const _helpers_1 = require("./_helpers");
|
|
9
|
+
const ENTITY_KINDS = ['person', 'org', 'asset', 'subject'];
|
|
10
|
+
function registerEntityCreateTool(server, http) {
|
|
11
|
+
server.registerTool('eml_entity_create', {
|
|
12
|
+
title: 'Create Entity',
|
|
13
|
+
description: 'Registriert eine Entity (externer Mensch / Organisation / Asset / Subject). ' +
|
|
14
|
+
'Pflicht VOR dem ersten Engram mit scope=entity.<id> — sonst schlägt der ' +
|
|
15
|
+
'scope-Existence-Check fehl.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
id: zod_1.z.string().describe('Slug-style ID, z.B. "lasse" oder "anthropic".'),
|
|
18
|
+
name: zod_1.z.string(),
|
|
19
|
+
kind: zod_1.z.enum(ENTITY_KINDS),
|
|
20
|
+
description: zod_1.z.string().optional(),
|
|
21
|
+
},
|
|
22
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/entity', args)));
|
|
23
|
+
}
|
|
24
|
+
function registerEntityListTool(server, http) {
|
|
25
|
+
server.registerTool('eml_entity_list', {
|
|
26
|
+
title: 'List Entities',
|
|
27
|
+
description: 'Listet alle Entities, optional gefiltert nach kind.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
kind: zod_1.z.enum(ENTITY_KINDS).optional(),
|
|
30
|
+
},
|
|
31
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.get('/entities', args.kind ? { kind: args.kind } : undefined)));
|
|
32
|
+
}
|
|
33
|
+
function registerEntityGetTool(server, http) {
|
|
34
|
+
server.registerTool('eml_entity_get', {
|
|
35
|
+
title: 'Get Entity',
|
|
36
|
+
description: 'Holt eine Entity per ID.',
|
|
37
|
+
inputSchema: {
|
|
38
|
+
id: zod_1.z.string(),
|
|
39
|
+
},
|
|
40
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.get(`/entity/${args.id}`)));
|
|
41
|
+
}
|
|
42
|
+
function registerEntityUpdateTool(server, http) {
|
|
43
|
+
server.registerTool('eml_entity_update', {
|
|
44
|
+
title: 'Update Entity',
|
|
45
|
+
description: 'Patch Entity-Felder (name/kind/description).',
|
|
46
|
+
inputSchema: {
|
|
47
|
+
id: zod_1.z.string(),
|
|
48
|
+
name: zod_1.z.string().optional(),
|
|
49
|
+
kind: zod_1.z.enum(ENTITY_KINDS).optional(),
|
|
50
|
+
description: zod_1.z.string().optional(),
|
|
51
|
+
},
|
|
52
|
+
}, async (args) => (0, _helpers_1.callTool)(() => {
|
|
53
|
+
const { id, ...patch } = args;
|
|
54
|
+
return http.put(`/entity/${id}`, patch);
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":";;AAOA,4DAkBC;AAED,wDAYC;AAED,sDAYC;AAED,4DAkBC;AAzED,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAU,CAAA;AAEnE,SAAgB,wBAAwB,CAAC,MAAiB,EAAE,IAAgB;IAC1E,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,8EAA8E;YAC9E,0EAA0E;YAC1E,6BAA6B;QAC/B,WAAW,EAAE;YACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YACxE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,YAAY,CAAC;YAC1B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACnC;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAC3D,CAAA;AACH,CAAC;AAED,SAAgB,sBAAsB,CAAC,MAAiB,EAAE,IAAgB;IACxE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,eAAe;QACtB,WAA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QAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAA;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epistemic.d.ts","sourceRoot":"","sources":["../../src/tools/epistemic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAgCpF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerEpistemicStoreTool = registerEpistemicStoreTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
const EPISTEMIC_TYPES = ['observation', 'hypothesis', 'assessment', 'prediction', 'pattern'];
|
|
7
|
+
function registerEpistemicStoreTool(server, http) {
|
|
8
|
+
server.registerTool('eml_epistemic_store', {
|
|
9
|
+
title: 'Store Epistemic Engram',
|
|
10
|
+
description: 'Schreibt ein Engram im epistemic-Mode: ' +
|
|
11
|
+
'observation (Beobachtung), hypothesis (Vermutung), assessment (Bewertung), ' +
|
|
12
|
+
'prediction (Vorhersage), pattern (wiederkehrende Struktur). ' +
|
|
13
|
+
'Source-Felder MÜSSEN in properties.source_id + properties.source_type stehen.',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
content: zod_1.z.string().describe('Engram-Inhalt (frei-text, kein Markup-Zwang).'),
|
|
16
|
+
type: zod_1.z.enum(EPISTEMIC_TYPES),
|
|
17
|
+
scope: zod_1.z.string().describe('Scope-Pattern: global | project.<id> | agent.<id> | user.<id> | entity.<id>. ' +
|
|
18
|
+
'Externe Personen/Orgs/Assets als entity.<id>; vorher via eml_entity_create anlegen.'),
|
|
19
|
+
subject: zod_1.z.string().optional(),
|
|
20
|
+
significance: zod_1.z.enum(['critical', 'high', 'normal', 'low', 'trivial']).optional(),
|
|
21
|
+
properties: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Type-spezifische Felder + provenance. Required pro Type: ' +
|
|
22
|
+
'observation→observation_type; hypothesis→reasoning; ' +
|
|
23
|
+
'assessment→assessment_type+reasoning; prediction→prediction_type+probability+resolution_date+reasoning; ' +
|
|
24
|
+
'pattern→observed_count. Plus source_id+source_type immer.'),
|
|
25
|
+
ingestion_method: zod_1.z.enum(['hook', 'direct', 'bulk', 'other']).optional(),
|
|
26
|
+
session_id: zod_1.z.string().optional(),
|
|
27
|
+
caller: zod_1.z.string().optional(),
|
|
28
|
+
},
|
|
29
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/epistemic', args)));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=epistemic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epistemic.js","sourceRoot":"","sources":["../../src/tools/epistemic.ts"],"names":[],"mappings":";;AAOA,gEAgCC;AAvCD,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,CAAU,CAAA;AAErG,SAAgB,0BAA0B,CAAC,MAAiB,EAAE,IAAgB;IAC5E,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,yCAAyC;YACzC,6EAA6E;YAC7E,8DAA8D;YAC9D,+EAA+E;QACjF,WAAW,EAAE;YACX,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,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AS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAyBzE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGetTool = registerGetTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
function registerGetTool(server, http) {
|
|
7
|
+
server.registerTool('eml_get', {
|
|
8
|
+
title: 'Get Engram',
|
|
9
|
+
description: 'Holt einen Engram per ID inkl. optionaler Relations. Mode-Variante ' +
|
|
10
|
+
'(/epistemic/:id, /context/:id) erzwingt mode-konsistente Lookups.',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
id: zod_1.z.string().describe('Engram-ID (UUID).'),
|
|
13
|
+
mode: zod_1.z.enum(['epistemic', 'context']).optional().describe('Wenn gesetzt: lookup über mode-spezifischen Endpoint (404 wenn falscher Mode).'),
|
|
14
|
+
with_relations: zod_1.z.boolean().optional().describe('Default true.'),
|
|
15
|
+
caller: zod_1.z.string().optional(),
|
|
16
|
+
},
|
|
17
|
+
}, async (args) => (0, _helpers_1.callTool)(() => {
|
|
18
|
+
const path = args.mode ? `/${args.mode}/${args.id}` : `/engram/${args.id}`;
|
|
19
|
+
const params = {};
|
|
20
|
+
if (args.with_relations !== undefined)
|
|
21
|
+
params.with_relations = String(args.with_relations);
|
|
22
|
+
if (args.caller)
|
|
23
|
+
params.caller = args.caller;
|
|
24
|
+
return http.get(path, params);
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":";;AAKA,0CAyBC;AA9BD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,eAAe,CAAC,MAAiB,EAAE,IAAgB;IACjE,MAAM,CAAC,YAAY,CACjB,SAAS,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
5
|
+
*
|
|
6
|
+
* Reihenfolge nicht semantisch — beeinflusst nur die `tools/list`-Order.
|
|
7
|
+
* Boot/Recall sind die meist-genutzten, daher zuerst.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerAllTools(server: McpServer, http: HttpClient): void;
|
|
10
|
+
export declare const TOOL_NAMES: readonly ["eml_boot", "eml_recall", "eml_epistemic_store", "eml_context_store", "eml_list", "eml_get", "eml_relate", "eml_update", "eml_confirm_review", "eml_entity_create", "eml_entity_list", "eml_entity_get", "eml_entity_update"];
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAkBhD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAc1E;AAED,eAAO,MAAM,UAAU,yOAMb,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_NAMES = void 0;
|
|
4
|
+
exports.registerAllTools = registerAllTools;
|
|
5
|
+
const boot_1 = require("./boot");
|
|
6
|
+
const recall_1 = require("./recall");
|
|
7
|
+
const epistemic_1 = require("./epistemic");
|
|
8
|
+
const context_1 = require("./context");
|
|
9
|
+
const list_1 = require("./list");
|
|
10
|
+
const get_1 = require("./get");
|
|
11
|
+
const relate_1 = require("./relate");
|
|
12
|
+
const update_1 = require("./update");
|
|
13
|
+
const confirm_review_1 = require("./confirm-review");
|
|
14
|
+
const entity_1 = require("./entity");
|
|
15
|
+
/**
|
|
16
|
+
* Registriert alle 13 Tools (v0.9-PROPOSAL §6.4).
|
|
17
|
+
*
|
|
18
|
+
* Reihenfolge nicht semantisch — beeinflusst nur die `tools/list`-Order.
|
|
19
|
+
* Boot/Recall sind die meist-genutzten, daher zuerst.
|
|
20
|
+
*/
|
|
21
|
+
function registerAllTools(server, http) {
|
|
22
|
+
(0, boot_1.registerBootTool)(server, http);
|
|
23
|
+
(0, recall_1.registerRecallTool)(server, http);
|
|
24
|
+
(0, epistemic_1.registerEpistemicStoreTool)(server, http);
|
|
25
|
+
(0, context_1.registerContextStoreTool)(server, http);
|
|
26
|
+
(0, list_1.registerListTool)(server, http);
|
|
27
|
+
(0, get_1.registerGetTool)(server, http);
|
|
28
|
+
(0, relate_1.registerRelateTool)(server, http);
|
|
29
|
+
(0, update_1.registerUpdateTool)(server, http);
|
|
30
|
+
(0, confirm_review_1.registerConfirmReviewTool)(server, http);
|
|
31
|
+
(0, entity_1.registerEntityCreateTool)(server, http);
|
|
32
|
+
(0, entity_1.registerEntityListTool)(server, http);
|
|
33
|
+
(0, entity_1.registerEntityGetTool)(server, http);
|
|
34
|
+
(0, entity_1.registerEntityUpdateTool)(server, http);
|
|
35
|
+
}
|
|
36
|
+
exports.TOOL_NAMES = [
|
|
37
|
+
'eml_boot', 'eml_recall',
|
|
38
|
+
'eml_epistemic_store', 'eml_context_store',
|
|
39
|
+
'eml_list', 'eml_get',
|
|
40
|
+
'eml_relate', 'eml_update', 'eml_confirm_review',
|
|
41
|
+
'eml_entity_create', 'eml_entity_list', 'eml_entity_get', 'eml_entity_update',
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAyBA,4CAcC;AApCD,iCAAyC;AACzC,qCAA6C;AAC7C,2CAAwD;AACxD,uCAAoD;AACpD,iCAAyC;AACzC,+BAAuC;AACvC,qCAA6C;AAC7C,qCAA6C;AAC7C,qDAA4D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AAE,MAAM,gBAAgB,CAAA;AAQhD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAqC1E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerListTool = registerListTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
const ENGRAM_TYPES = [
|
|
7
|
+
'observation', 'hypothesis', 'assessment', 'prediction', 'pattern',
|
|
8
|
+
'decision', 'rule', 'profile', 'status', 'task', 'event', 'log', 'reference',
|
|
9
|
+
];
|
|
10
|
+
function registerListTool(server, http) {
|
|
11
|
+
server.registerTool('eml_list', {
|
|
12
|
+
title: 'List Engrams',
|
|
13
|
+
description: 'Listet Engrams mit Filter (type/scope/significance/status/search/etc.). ' +
|
|
14
|
+
'Endpoint hat 3 Varianten: alle Modes (default), nur epistemic, nur context.',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
mode: zod_1.z.enum(['epistemic', 'context']).optional().describe('Wenn gesetzt: filtert auf einen Mode (eigener Endpoint /list/epistemic|context).'),
|
|
17
|
+
type: zod_1.z.enum(ENGRAM_TYPES).optional(),
|
|
18
|
+
scope: zod_1.z.string().optional(),
|
|
19
|
+
subject: zod_1.z.string().optional(),
|
|
20
|
+
status: zod_1.z.enum(['planned', 'active', 'superseded', 'invalidated', 'expired', 'resolved']).optional(),
|
|
21
|
+
significance: zod_1.z.enum(['critical', 'high', 'normal', 'low', 'trivial']).optional(),
|
|
22
|
+
search: zod_1.z.string().optional().describe('FTS5-Suche im content/subject.'),
|
|
23
|
+
order_by: zod_1.z.enum(['created_at', 'updated_at', 'significance', 'score']).optional(),
|
|
24
|
+
limit: zod_1.z.number().int().positive().max(200).optional(),
|
|
25
|
+
offset: zod_1.z.number().int().nonnegative().optional(),
|
|
26
|
+
has_relations: zod_1.z.boolean().optional(),
|
|
27
|
+
caller: zod_1.z.string().optional(),
|
|
28
|
+
},
|
|
29
|
+
}, async (args) => (0, _helpers_1.callTool)(() => {
|
|
30
|
+
const { mode, ...query } = args;
|
|
31
|
+
const path = mode ? `/list/${mode}` : '/list';
|
|
32
|
+
// Strip undefined + booleanify has_relations as flag-or-omit
|
|
33
|
+
const params = {};
|
|
34
|
+
for (const [k, v] of Object.entries(query)) {
|
|
35
|
+
if (v === undefined)
|
|
36
|
+
continue;
|
|
37
|
+
params[k] = typeof v === 'boolean' ? String(v) : v;
|
|
38
|
+
}
|
|
39
|
+
return http.get(path, params);
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":";;AAUA,4CAqCC;AA/CD,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,YAAY,GAAG;IACnB,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS;IAClE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW;CACpE,CAAA;AAEV,SAAgB,gBAAgB,CAAC,MAAiB,EAAE,IAAgB;IAClE,MAAM,CAAC,YAAY,CACjB,UAAU,EACV;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,0EAA0E;YAC1E,6EAA6E;QAC/E,WAAW,EAAE;YACX,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxD,kFAAkF,CACnF;YACD,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;YACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC5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AAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,KAAK,SAAS;gBAAE,SAAQ;YAC7B,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAoB,CAAA;QACvE,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC/B,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall.d.ts","sourceRoot":"","sources":["../../src/tools/recall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAoB5E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerRecallTool = registerRecallTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
function registerRecallTool(server, http) {
|
|
7
|
+
server.registerTool('eml_recall', {
|
|
8
|
+
title: 'Recall Knowledge',
|
|
9
|
+
description: 'Topic-basierter Recall mit FTS5-Volltextsuche + Recency-Mix. Returnt aktive ' +
|
|
10
|
+
'Engrams die zur Query passen, geordnet nach Score. Für gezielte Wissens-Lookups ' +
|
|
11
|
+
'("was weiß ich über X?") besser als list-Filter.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
query: zod_1.z.string().describe('Such-Query (Plaintext, FTS5-tokenisiert).'),
|
|
14
|
+
limit: zod_1.z.number().int().positive().max(50).optional().describe('Default 10.'),
|
|
15
|
+
mode: zod_1.z.enum(['epistemic', 'context']).optional().describe('Optional: nur epistemic-Mode oder nur context-Mode durchsuchen.'),
|
|
16
|
+
caller: zod_1.z.string().optional(),
|
|
17
|
+
},
|
|
18
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/recall', args)));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=recall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall.js","sourceRoot":"","sources":["../../src/tools/recall.ts"],"names":[],"mappings":";;AAKA,gDAoBC;AAzBD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,kBAAkB,CAAC,MAAiB,EAAE,IAAgB;IACpE,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,8EAA8E;YAC9E,kFAAkF;YAClF,kDAAkD;QACpD,WAAW,EAAE;YACX,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;YACvE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC7E,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxD,iEAAiE,CAClE;YACD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC9B;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAC3D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relate.d.ts","sourceRoot":"","sources":["../../src/tools/relate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAShD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAwB5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerRelateTool = registerRelateTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
const RELATION_TYPES = [
|
|
7
|
+
'supports', 'contradicts', 'supersedes',
|
|
8
|
+
'derived_from', 'evaluates', 'refines', 'related_to',
|
|
9
|
+
'blocks',
|
|
10
|
+
];
|
|
11
|
+
function registerRelateTool(server, http) {
|
|
12
|
+
server.registerTool('eml_relate', {
|
|
13
|
+
title: 'Relate Engrams',
|
|
14
|
+
description: 'Verknüpft zwei Engrams mit einer typed relation (idempotent: gleicher ' +
|
|
15
|
+
'source+target+relation überschreibt detection_method/explanation).',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
source_id: zod_1.z.string(),
|
|
18
|
+
target_id: zod_1.z.string(),
|
|
19
|
+
relation: zod_1.z.enum(RELATION_TYPES),
|
|
20
|
+
detection_method: zod_1.z.enum([
|
|
21
|
+
'manual', 'agent_declared', 'auto_subject', 'auto_temporal', 'auto_semantic',
|
|
22
|
+
]).optional().describe('Default: agent_declared (vom Agent gesetzt).'),
|
|
23
|
+
explanation: zod_1.z.string().optional(),
|
|
24
|
+
caller: zod_1.z.string().optional(),
|
|
25
|
+
},
|
|
26
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/relate', {
|
|
27
|
+
...args,
|
|
28
|
+
detection_method: args.detection_method ?? 'agent_declared',
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=relate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relate.js","sourceRoot":"","sources":["../../src/tools/relate.ts"],"names":[],"mappings":";;AAWA,gDAwBC;AAnCD,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE,aAAa,EAAE,YAAY;IACvC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY;IACpD,QAAQ;CACA,CAAA;AAEV,SAAgB,kBAAkB,CAAC,MAAiB,EAAE,IAAgB;IACpE,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,wEAAwE;YACxE,oEAAoE;QACtE,WAAW,EAAE;YACX,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,QAAQ,EAAE,OAAC,CAAC,IAAI,CAAC,cAAc,CAAC;YAChC,gBAAgB,EAAE,OAAC,CAAC,IAAI,CAAC;gBACvB,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe;aAC7E,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;YACtE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAClC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC9B;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAClD,GAAG,IAAI;QACP,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAAI,gBAAgB;KAC5D,CAAC,CAAC,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/tools/update.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAwB5E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerUpdateTool = registerUpdateTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
function registerUpdateTool(server, http) {
|
|
7
|
+
server.registerTool('eml_update', {
|
|
8
|
+
title: 'Update Engram',
|
|
9
|
+
description: 'Patch einen Engram (status, significance, properties, content). ' +
|
|
10
|
+
'Typischer Use-Case: status="resolved" + outcome in properties bei Predictions, ' +
|
|
11
|
+
'oder status="superseded" wenn ein Engram nicht mehr gilt.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
id: zod_1.z.string(),
|
|
14
|
+
patch: zod_1.z.object({
|
|
15
|
+
content: zod_1.z.string().optional(),
|
|
16
|
+
status: zod_1.z.enum(['planned', 'active', 'superseded', 'invalidated', 'expired', 'resolved']).optional(),
|
|
17
|
+
significance: zod_1.z.enum(['critical', 'high', 'normal', 'low', 'trivial']).optional(),
|
|
18
|
+
subject: zod_1.z.string().optional(),
|
|
19
|
+
scope: zod_1.z.string().optional(),
|
|
20
|
+
properties: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
21
|
+
}).describe('Nur die Felder die geändert werden sollen.'),
|
|
22
|
+
caller: zod_1.z.string().optional(),
|
|
23
|
+
},
|
|
24
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/update', args)));
|
|
25
|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G,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAC3D,CAAA;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@engramprotocol/mcp-server",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "MCP-Wrapper für die EML HTTP-API — exposes EML als MCP-Tools für Claude Code und andere MCP-Clients",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"main": "dist/server.js",
|
|
7
|
+
"types": "dist/server.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"eml-mcp-server": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
20
|
+
"zod": "^4.4.3"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@engramprotocol/core": "0.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -b",
|
|
30
|
+
"test": "vitest run --passWithNoTests",
|
|
31
|
+
"test:watch": "vitest"
|
|
32
|
+
}
|
|
33
|
+
}
|