langmail-mcp 0.0.0 → 0.1.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/package.json +2 -2
- package/dist/mcp/test-client.js +0 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langmail-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Langmail MCP for your own Stalwart: email, calendar and contacts — a self-hosted MCP server for Stalwart over JMAP, CalDAV and CardDAV",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/langmail/langmail-mcp.git"
|
|
27
|
+
"url": "git+https://github.com/langmail/langmail-mcp.git"
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"author": "Dominik Grusemann",
|
package/dist/mcp/test-client.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// A minimal MCP client for unit tests: drives a server over an in-memory
|
|
2
|
-
// transport the way a client would, handshake included. Nothing is dialled.
|
|
3
|
-
import { InMemoryTransport, } from "@modelcontextprotocol/server";
|
|
4
|
-
export const connect = async (server) => {
|
|
5
|
-
const [clientSide, serverSide] = InMemoryTransport.createLinkedPair();
|
|
6
|
-
await server.connect(serverSide);
|
|
7
|
-
const waiting = new Map();
|
|
8
|
-
clientSide.onmessage = (message) => {
|
|
9
|
-
const id = message.id;
|
|
10
|
-
if (id !== undefined) {
|
|
11
|
-
waiting.get(id)?.(message);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
await clientSide.start();
|
|
15
|
-
let nextId = 0;
|
|
16
|
-
const ask = async (method, params = {}) => {
|
|
17
|
-
nextId += 1;
|
|
18
|
-
const id = nextId;
|
|
19
|
-
const reply = new Promise((resolve) => {
|
|
20
|
-
waiting.set(id, resolve);
|
|
21
|
-
});
|
|
22
|
-
await clientSide.send({ id, jsonrpc: "2.0", method, params });
|
|
23
|
-
return (await reply);
|
|
24
|
-
};
|
|
25
|
-
const request = async (method, params = {}) => {
|
|
26
|
-
const message = await ask(method, params);
|
|
27
|
-
if (!message.result) {
|
|
28
|
-
throw new Error(`${method} failed: ${JSON.stringify(message.error)}`);
|
|
29
|
-
}
|
|
30
|
-
return message.result;
|
|
31
|
-
};
|
|
32
|
-
const initialized = await request("initialize", {
|
|
33
|
-
capabilities: {},
|
|
34
|
-
clientInfo: { name: "test-client", version: "0.0.0" },
|
|
35
|
-
protocolVersion: "2025-06-18",
|
|
36
|
-
});
|
|
37
|
-
await clientSide.send({
|
|
38
|
-
jsonrpc: "2.0",
|
|
39
|
-
method: "notifications/initialized",
|
|
40
|
-
});
|
|
41
|
-
return { ask, close: () => server.close(), initialized, request };
|
|
42
|
-
};
|
|
43
|
-
export const textOf = (result) => result.content?.map((part) => part.text).join("\n") ?? "";
|