cimux-mcp 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.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -0
  3. package/dist/cli/cimux-cli.d.ts +10 -0
  4. package/dist/cli/cimux-cli.js +201 -0
  5. package/dist/cli/cimux-cli.js.map +1 -0
  6. package/dist/index.d.ts +15 -0
  7. package/dist/index.js +34 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/install/cimux-install-plan.d.ts +29 -0
  10. package/dist/install/cimux-install-plan.js +187 -0
  11. package/dist/install/cimux-install-plan.js.map +1 -0
  12. package/dist/mcp/cimux-mcp-server.d.ts +4 -0
  13. package/dist/mcp/cimux-mcp-server.js +59 -0
  14. package/dist/mcp/cimux-mcp-server.js.map +1 -0
  15. package/dist/model/context-package.d.ts +913 -0
  16. package/dist/model/context-package.js +153 -0
  17. package/dist/model/context-package.js.map +1 -0
  18. package/dist/registration/mailbox-registration.d.ts +30 -0
  19. package/dist/registration/mailbox-registration.js +48 -0
  20. package/dist/registration/mailbox-registration.js.map +1 -0
  21. package/dist/runtime/mailbox-runtime.d.ts +22 -0
  22. package/dist/runtime/mailbox-runtime.js +50 -0
  23. package/dist/runtime/mailbox-runtime.js.map +1 -0
  24. package/dist/service/cimux-mailbox-service.d.ts +87 -0
  25. package/dist/service/cimux-mailbox-service.js +126 -0
  26. package/dist/service/cimux-mailbox-service.js.map +1 -0
  27. package/dist/storage/mailbox-store.d.ts +22 -0
  28. package/dist/storage/mailbox-store.js +2 -0
  29. package/dist/storage/mailbox-store.js.map +1 -0
  30. package/dist/storage/sqlite-cimux-store.d.ts +21 -0
  31. package/dist/storage/sqlite-cimux-store.js +201 -0
  32. package/dist/storage/sqlite-cimux-store.js.map +1 -0
  33. package/dist/version.d.ts +2 -0
  34. package/dist/version.js +3 -0
  35. package/dist/version.js.map +1 -0
  36. package/docs/mvp-readiness.md +85 -0
  37. package/package.json +51 -0
  38. package/scripts/demo-local-handoff.mjs +73 -0
@@ -0,0 +1,4 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function createCimuxMcpServer(databasePath?: string): McpServer;
3
+ export declare function runCimuxMcpServer(databasePath?: string): Promise<void>;
4
+ export declare function defaultDatabasePath(): string;
@@ -0,0 +1,59 @@
1
+ import os from "node:os";
2
+ import path from "node:path";
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { createContextPackageInputSchema } from "../model/context-package.js";
6
+ import { registerMailboxInputSchema } from "../registration/mailbox-registration.js";
7
+ import { ackContext, ackContextInputSchema, checkInbox, checkInboxInputSchema, readContext, readContextInputSchema, registerSession, sendContext } from "../service/cimux-mailbox-service.js";
8
+ import { SQLiteCimuxStore } from "../storage/sqlite-cimux-store.js";
9
+ export function createCimuxMcpServer(databasePath = defaultDatabasePath()) {
10
+ const store = new SQLiteCimuxStore(databasePath);
11
+ const server = new McpServer({
12
+ name: "cimux",
13
+ version: "0.1.0"
14
+ });
15
+ server.registerTool("register_session", {
16
+ title: "Register Session",
17
+ description: "Register or infer the current agent mailbox. Branch names are preferred over task/folder names.",
18
+ inputSchema: registerMailboxInputSchema.shape
19
+ }, async (input) => toToolResult(await registerSession(store, input)));
20
+ server.registerTool("send_context", {
21
+ title: "Send Context",
22
+ description: "Send a structured Context Package to an existing mailbox. Unknown mailboxes are rejected.",
23
+ inputSchema: createContextPackageInputSchema.shape
24
+ }, async (input) => toToolResult(await sendContext(store, input)));
25
+ server.registerTool("check_inbox", {
26
+ title: "Check Inbox",
27
+ description: "Return token-aware inbox previews only. Full body, snippets, and payload values are excluded.",
28
+ inputSchema: checkInboxInputSchema.shape
29
+ }, async (input) => toToolResult(await checkInbox(store, input)));
30
+ server.registerTool("read_context", {
31
+ title: "Read Context",
32
+ description: "Read one Context Package addressed to the given mailbox and mark it as read.",
33
+ inputSchema: readContextInputSchema.shape
34
+ }, async (input) => toToolResult(await readContext(store, input)));
35
+ server.registerTool("ack_context", {
36
+ title: "Acknowledge Context",
37
+ description: "Acknowledge one Context Package addressed to the given mailbox. Ack means loaded/seen, not completed.",
38
+ inputSchema: ackContextInputSchema.shape
39
+ }, async (input) => toToolResult(await ackContext(store, input)));
40
+ return server;
41
+ }
42
+ export async function runCimuxMcpServer(databasePath) {
43
+ const server = createCimuxMcpServer(databasePath);
44
+ await server.connect(new StdioServerTransport());
45
+ }
46
+ export function defaultDatabasePath() {
47
+ return path.join(os.homedir(), ".cimux", "cimux.sqlite");
48
+ }
49
+ function toToolResult(value) {
50
+ return {
51
+ content: [
52
+ {
53
+ type: "text",
54
+ text: JSON.stringify(value, null, 2)
55
+ }
56
+ ]
57
+ };
58
+ }
59
+ //# sourceMappingURL=cimux-mcp-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cimux-mcp-server.js","sourceRoot":"","sources":["../../src/mcp/cimux-mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,WAAW,EACZ,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,MAAM,UAAU,oBAAoB,CAAC,YAAY,GAAG,mBAAmB,EAAE;IACvE,MAAM,KAAK,GAAG,IAAI,gBAAgB,CAAC,YAAY,C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