@astramindapp/mcp-server 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/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # @mindapp/mcp-server
2
+
3
+ **MIND MCP Server** — Give any AI agent persistent memory.
4
+
5
+ Your AI agents forget everything between sessions. MIND fixes that. Connect any MCP-compatible tool to your personal knowledge graph and never lose context again.
6
+
7
+ ## What It Does
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `mind_query` | Search your knowledge graph — returns only what's relevant |
12
+ | `mind_remember` | Store anything — auto-categorized as document, entry, or thought |
13
+ | `mind_context` | Load your persistent identity, preferences, rules, and priorities |
14
+ | `mind_life` | Manage goals, projects, and tasks |
15
+ | `mind_crm` | Track contacts and relationships |
16
+ | `mind_graph` | Check graph health and statistics |
17
+
18
+ ## Quick Start
19
+
20
+ ### 1. Get a MIND API Key
21
+
22
+ Sign up at [m-i-n-d.ai](https://m-i-n-d.ai) → Settings → Developer → Create API Key
23
+
24
+ ### 2. Install
25
+
26
+ ```bash
27
+ npm install -g @mindapp/mcp-server
28
+ ```
29
+
30
+ ### 3. Configure Your AI Tool
31
+
32
+ #### Claude Desktop
33
+
34
+ Add to your `claude_desktop_config.json`:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "mind": {
40
+ "command": "mind-mcp",
41
+ "env": {
42
+ "MIND_API_KEY": "mind_your_key_here"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ #### Claude Code
50
+
51
+ ```bash
52
+ claude mcp add mind -- env MIND_API_KEY=mind_xxx mind-mcp
53
+ ```
54
+
55
+ #### OpenClaw
56
+
57
+ Add to your OpenClaw config:
58
+
59
+ ```json5
60
+ {
61
+ mcp: {
62
+ servers: {
63
+ mind: {
64
+ command: "mind-mcp",
65
+ env: { MIND_API_KEY: "mind_xxx" }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ #### Cursor
73
+
74
+ Add to `.cursor/mcp.json`:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "mind": {
80
+ "command": "mind-mcp",
81
+ "env": {
82
+ "MIND_API_KEY": "mind_your_key_here"
83
+ }
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ ## How It Works
90
+
91
+ ```
92
+ Your AI Agent ←→ MCP Protocol ←→ MIND MCP Server ←→ MIND Knowledge Graph
93
+ ```
94
+
95
+ 1. Agent calls `mind_context` at session start → gets identity, rules, priorities
96
+ 2. Agent calls `mind_query` before decisions → gets relevant memories
97
+ 3. Agent calls `mind_remember` after tasks → stores outcomes and learnings
98
+ 4. Next session, same agent (or different one!) has full context
99
+
100
+ **Your knowledge graph grows from every tool you use.** What you learn in Claude Code is available in Cursor. What you decide in OpenClaw is remembered by Claude Desktop.
101
+
102
+ ## Why MIND vs. Flat File Memory
103
+
104
+ | | Flat files (MEMORY.md) | MIND |
105
+ |---|---|---|
106
+ | Size limit | ~20K chars, then truncated | Unlimited graph |
107
+ | Retrieval | Loads everything every turn | Only relevant memories |
108
+ | Capture | Manual (agent must write) | Automatic categorization |
109
+ | Cross-agent | One tool only | Shared across all agents |
110
+ | Structure | Unstructured text | Knowledge graph with entities & relationships |
111
+ | Search | Keyword/vector on small file | Hybrid semantic + graph traversal |
112
+
113
+ ## Environment Variables
114
+
115
+ | Variable | Required | Default | Description |
116
+ |----------|----------|---------|-------------|
117
+ | `MIND_API_KEY` | Yes | — | Your MIND Developer API key |
118
+ | `MIND_BASE_URL` | No | `https://m-i-n-d.ai` | MIND API base URL |
119
+
120
+ ## Programmatic Usage
121
+
122
+ ```typescript
123
+ import { createMindMcpServer, MindClient } from "@mindapp/mcp-server";
124
+
125
+ const client = new MindClient({
126
+ baseUrl: "https://m-i-n-d.ai",
127
+ apiKey: "mind_xxx",
128
+ });
129
+
130
+ const server = createMindMcpServer(client);
131
+ // Connect to any MCP transport
132
+ ```
133
+
134
+ ## License
135
+
136
+ MIT — Astra AI
package/dist/cli.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MIND MCP Server — CLI Entry Point
4
+ *
5
+ * Usage:
6
+ * MIND_API_KEY=mind_xxx mind-mcp
7
+ * MIND_API_KEY=mind_xxx MIND_BASE_URL=https://m-i-n-d.ai mind-mcp
8
+ *
9
+ * Environment variables:
10
+ * MIND_API_KEY — Required. Your MIND Developer API key.
11
+ * MIND_BASE_URL — Optional. Defaults to https://m-i-n-d.ai
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
package/dist/cli.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * MIND MCP Server — CLI Entry Point
5
+ *
6
+ * Usage:
7
+ * MIND_API_KEY=mind_xxx mind-mcp
8
+ * MIND_API_KEY=mind_xxx MIND_BASE_URL=https://m-i-n-d.ai mind-mcp
9
+ *
10
+ * Environment variables:
11
+ * MIND_API_KEY — Required. Your MIND Developer API key.
12
+ * MIND_BASE_URL — Optional. Defaults to https://m-i-n-d.ai
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
16
+ const mind_client_js_1 = require("./mind-client.js");
17
+ const server_js_1 = require("./server.js");
18
+ const API_KEY = process.env.MIND_API_KEY;
19
+ const BASE_URL = process.env.MIND_BASE_URL ?? "https://m-i-n-d.ai";
20
+ if (!API_KEY) {
21
+ console.error("Error: MIND_API_KEY environment variable is required.\n" +
22
+ "Get your API key at https://m-i-n-d.ai → Settings → Developer → API Keys\n");
23
+ process.exit(1);
24
+ }
25
+ async function main() {
26
+ const apiKey = API_KEY;
27
+ const client = new mind_client_js_1.MindClient({ baseUrl: BASE_URL, apiKey });
28
+ const server = (0, server_js_1.createMindMcpServer)(client);
29
+ const transport = new stdio_js_1.StdioServerTransport();
30
+ await server.connect(transport);
31
+ // Log to stderr so it doesn't interfere with MCP stdio protocol
32
+ console.error(`MIND MCP Server v0.1.0 started`);
33
+ console.error(` → Base URL: ${BASE_URL}`);
34
+ console.error(` → API Key: ${apiKey.slice(0, 8)}...`);
35
+ console.error(` → Tools: mind_query, mind_remember, mind_context, mind_life, mind_crm, mind_graph`);
36
+ }
37
+ main().catch((err) => {
38
+ console.error("Fatal error starting MIND MCP Server:", err);
39
+ process.exit(1);
40
+ });
41
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;GAUG;;AAEH,wEAAiF;AACjF,qDAA8C;AAC9C,2CAAkD;AAElD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,oBAAoB,CAAC;AAEnE,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CACX,yDAAyD;QACvD,4EAA4E,CAC/E,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,OAAQ,CAAC;IACxB,MAAM,MAAM,GAAG,IAAI,2BAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAA,+BAAmB,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAChD,OAAO,CAAC,KAAK,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,KAAK,CAAC,gBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CAAC,KAAK,CAAC,qFAAqF,CAAC,CAAC;AACvG,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @mindapp/mcp-server
3
+ *
4
+ * MIND MCP Server — Universal AI memory layer.
5
+ * Give any LLM agent persistent memory via the Model Context Protocol.
6
+ *
7
+ * Programmatic usage:
8
+ * import { createMindMcpServer, MindClient } from "@mindapp/mcp-server";
9
+ * const client = new MindClient({ baseUrl: "https://m-i-n-d.ai", apiKey: "mind_xxx" });
10
+ * const server = createMindMcpServer(client);
11
+ */
12
+ export { createMindMcpServer } from "./server.js";
13
+ export { MindClient } from "./mind-client.js";
14
+ export type * from "./mind-client.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,mBAAmB,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * @mindapp/mcp-server
4
+ *
5
+ * MIND MCP Server — Universal AI memory layer.
6
+ * Give any LLM agent persistent memory via the Model Context Protocol.
7
+ *
8
+ * Programmatic usage:
9
+ * import { createMindMcpServer, MindClient } from "@mindapp/mcp-server";
10
+ * const client = new MindClient({ baseUrl: "https://m-i-n-d.ai", apiKey: "mind_xxx" });
11
+ * const server = createMindMcpServer(client);
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MindClient = exports.createMindMcpServer = void 0;
15
+ var server_js_1 = require("./server.js");
16
+ Object.defineProperty(exports, "createMindMcpServer", { enumerable: true, get: function () { return server_js_1.createMindMcpServer; } });
17
+ var mind_client_js_1 = require("./mind-client.js");
18
+ Object.defineProperty(exports, "MindClient", { enumerable: true, get: function () { return mind_client_js_1.MindClient; } });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,yCAAkD;AAAzC,gHAAA,mBAAmB,OAAA;AAC5B,mDAA8C;AAArC,4GAAA,UAAU,OAAA"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * MIND API Client
3
+ *
4
+ * Thin wrapper around the MIND Developer API.
5
+ * All methods return typed responses or throw on HTTP errors.
6
+ */
7
+ export interface MindClientConfig {
8
+ baseUrl: string;
9
+ apiKey: string;
10
+ }
11
+ export interface QueryRequest {
12
+ query: string;
13
+ mode?: "mix" | "graph" | "vector";
14
+ limit?: number;
15
+ }
16
+ export interface QueryResponse {
17
+ response: string;
18
+ sources: Array<{
19
+ id?: string;
20
+ title?: string;
21
+ content_preview?: string;
22
+ relevance_score?: number;
23
+ }>;
24
+ credits_used: number;
25
+ credits_remaining: number;
26
+ }
27
+ export interface DocumentCreateRequest {
28
+ title: string;
29
+ content: string;
30
+ source?: string;
31
+ tags?: string[];
32
+ }
33
+ export interface DocumentResponse {
34
+ id: string;
35
+ title: string;
36
+ source: string;
37
+ status: string;
38
+ created_at: string;
39
+ content_preview?: string;
40
+ }
41
+ export interface EntryCreateRequest {
42
+ title?: string;
43
+ content: string;
44
+ entry_type?: string;
45
+ tags?: string[];
46
+ }
47
+ export interface EntryResponse {
48
+ id?: string;
49
+ entry_id?: string;
50
+ title?: string;
51
+ content?: string;
52
+ entry_type?: string;
53
+ tags?: string[];
54
+ created_at?: string;
55
+ }
56
+ export interface ThoughtCreateRequest {
57
+ content: string;
58
+ }
59
+ export interface ThoughtResponse {
60
+ id?: string;
61
+ thought_id?: string;
62
+ content: string;
63
+ created_at?: string;
64
+ }
65
+ export interface LifeItemCreateRequest {
66
+ title: string;
67
+ description?: string;
68
+ status?: string;
69
+ priority?: string;
70
+ due_date?: string;
71
+ }
72
+ export interface LifeItemResponse {
73
+ item_id: string;
74
+ title: string;
75
+ description?: string;
76
+ status?: string;
77
+ priority?: string;
78
+ due_date?: string;
79
+ created_at?: string;
80
+ }
81
+ export interface CrmContactCreateRequest {
82
+ name: string;
83
+ email?: string;
84
+ company?: string;
85
+ type?: string;
86
+ stage?: string;
87
+ source?: string;
88
+ value?: number;
89
+ notes?: string;
90
+ }
91
+ export interface CrmContactResponse {
92
+ id?: string;
93
+ contact_id?: string;
94
+ name: string;
95
+ email?: string;
96
+ company?: string;
97
+ type?: string;
98
+ stage?: string;
99
+ created_at?: string;
100
+ }
101
+ export interface GraphInfoResponse {
102
+ total_entities: number;
103
+ total_relationships: number;
104
+ popular_labels?: Array<{
105
+ label: string | null;
106
+ count: number;
107
+ }>;
108
+ storage_status?: {
109
+ workspace_id: string;
110
+ status: string;
111
+ };
112
+ }
113
+ export interface ProfileResponse {
114
+ username: string;
115
+ tier?: string;
116
+ credits_remaining?: number;
117
+ [key: string]: unknown;
118
+ }
119
+ export interface InsightsResponse {
120
+ insights: Array<{
121
+ id?: string;
122
+ type?: string;
123
+ content?: string;
124
+ created_at?: string;
125
+ }>;
126
+ }
127
+ export declare class MindClient {
128
+ private baseUrl;
129
+ private apiKey;
130
+ constructor(config: MindClientConfig);
131
+ private request;
132
+ query(req: QueryRequest): Promise<QueryResponse>;
133
+ createDocument(req: DocumentCreateRequest): Promise<DocumentResponse>;
134
+ listDocuments(page?: number, pageSize?: number): Promise<{
135
+ documents: DocumentResponse[];
136
+ }>;
137
+ deleteDocument(docId: string): Promise<void>;
138
+ createEntry(req: EntryCreateRequest): Promise<EntryResponse>;
139
+ listEntries(limit?: number): Promise<{
140
+ entries: EntryResponse[];
141
+ }>;
142
+ deleteEntry(entryId: string): Promise<void>;
143
+ createThought(req: ThoughtCreateRequest): Promise<ThoughtResponse>;
144
+ listThoughts(): Promise<{
145
+ thoughts: ThoughtResponse[];
146
+ }>;
147
+ deleteThought(thoughtId: string): Promise<void>;
148
+ createLifeItem(req: LifeItemCreateRequest): Promise<LifeItemResponse>;
149
+ listLifeItems(status?: string, limit?: number): Promise<{
150
+ items: LifeItemResponse[];
151
+ }>;
152
+ updateLifeItem(itemId: string, patch: Partial<LifeItemCreateRequest & {
153
+ status: string;
154
+ }>): Promise<LifeItemResponse>;
155
+ deleteLifeItem(itemId: string): Promise<void>;
156
+ createContact(req: CrmContactCreateRequest): Promise<CrmContactResponse>;
157
+ listContacts(): Promise<{
158
+ contacts: CrmContactResponse[];
159
+ }>;
160
+ updateContact(contactId: string, patch: Partial<CrmContactCreateRequest>): Promise<CrmContactResponse>;
161
+ graphInfo(): Promise<GraphInfoResponse>;
162
+ profile(): Promise<ProfileResponse>;
163
+ credits(): Promise<{
164
+ credits_balance: number;
165
+ credits_limit: number;
166
+ tier: string;
167
+ documents_used: number;
168
+ documents_limit: number;
169
+ }>;
170
+ insights(): Promise<InsightsResponse>;
171
+ }
172
+ //# sourceMappingURL=mind-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mind-client.d.ts","sourceRoot":"","sources":["../src/mind-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;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,OAAO,CAAC,iBAAiB,CAAC;IAMvC,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;IAInC,OAAO,IAAI,OAAO,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IAMI,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG5C"}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ /**
3
+ * MIND API Client
4
+ *
5
+ * Thin wrapper around the MIND Developer API.
6
+ * All methods return typed responses or throw on HTTP errors.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.MindClient = void 0;
10
+ class MindApiError extends Error {
11
+ status;
12
+ statusText;
13
+ body;
14
+ constructor(status, statusText, body) {
15
+ super(`MIND API error ${status}: ${statusText} — ${body}`);
16
+ this.status = status;
17
+ this.statusText = statusText;
18
+ this.body = body;
19
+ this.name = "MindApiError";
20
+ }
21
+ }
22
+ class MindClient {
23
+ baseUrl;
24
+ apiKey;
25
+ constructor(config) {
26
+ this.baseUrl = config.baseUrl.replace(/\/+$/, "");
27
+ this.apiKey = config.apiKey;
28
+ }
29
+ async request(method, path, body, params) {
30
+ let url = `${this.baseUrl}${path}`;
31
+ if (params) {
32
+ const qs = new URLSearchParams(params).toString();
33
+ if (qs)
34
+ url += `?${qs}`;
35
+ }
36
+ const headers = {
37
+ "X-API-Key": this.apiKey,
38
+ "Content-Type": "application/json",
39
+ };
40
+ const res = await fetch(url, {
41
+ method,
42
+ headers,
43
+ body: body ? JSON.stringify(body) : undefined,
44
+ });
45
+ const text = await res.text();
46
+ if (!res.ok) {
47
+ throw new MindApiError(res.status, res.statusText, text);
48
+ }
49
+ try {
50
+ return JSON.parse(text);
51
+ }
52
+ catch {
53
+ return text;
54
+ }
55
+ }
56
+ // ─── Query ──────────────────────────────────────────────
57
+ async query(req) {
58
+ return this.request("POST", "/developer/v1/query", req);
59
+ }
60
+ // ─── Documents ──────────────────────────────────────────
61
+ async createDocument(req) {
62
+ return this.request("POST", "/developer/v1/documents", req);
63
+ }
64
+ async listDocuments(page = 1, pageSize = 20) {
65
+ return this.request("GET", "/developer/v1/documents", undefined, {
66
+ page: String(page),
67
+ page_size: String(pageSize),
68
+ });
69
+ }
70
+ async deleteDocument(docId) {
71
+ await this.request("DELETE", `/developer/v1/documents/${docId}`);
72
+ }
73
+ // ─── Entries ────────────────────────────────────────────
74
+ async createEntry(req) {
75
+ return this.request("POST", "/developer/v1/entries", req);
76
+ }
77
+ async listEntries(limit = 20) {
78
+ return this.request("GET", "/developer/v1/entries", undefined, {
79
+ limit: String(limit),
80
+ });
81
+ }
82
+ async deleteEntry(entryId) {
83
+ await this.request("DELETE", `/developer/v1/entries/${entryId}`);
84
+ }
85
+ // ─── Thoughts ───────────────────────────────────────────
86
+ async createThought(req) {
87
+ return this.request("POST", "/developer/v1/thoughts", req);
88
+ }
89
+ async listThoughts() {
90
+ return this.request("GET", "/developer/v1/thoughts");
91
+ }
92
+ async deleteThought(thoughtId) {
93
+ await this.request("DELETE", `/developer/v1/thoughts/${thoughtId}`);
94
+ }
95
+ // ─── Life ───────────────────────────────────────────────
96
+ async createLifeItem(req) {
97
+ return this.request("POST", "/developer/v1/life/items", req);
98
+ }
99
+ async listLifeItems(status, limit = 30) {
100
+ const params = { limit: String(limit) };
101
+ if (status)
102
+ params.status = status;
103
+ return this.request("GET", "/developer/v1/life/items", undefined, params);
104
+ }
105
+ async updateLifeItem(itemId, patch) {
106
+ return this.request("PATCH", `/developer/v1/life/items/${itemId}`, patch);
107
+ }
108
+ async deleteLifeItem(itemId) {
109
+ await this.request("DELETE", `/developer/v1/life/items/${itemId}`);
110
+ }
111
+ // ─── CRM ────────────────────────────────────────────────
112
+ async createContact(req) {
113
+ return this.request("POST", "/developer/v1/crm/contacts", req);
114
+ }
115
+ async listContacts() {
116
+ return this.request("GET", "/developer/v1/crm/contacts");
117
+ }
118
+ async updateContact(contactId, patch) {
119
+ return this.request("PATCH", `/developer/v1/crm/contacts/${contactId}`, patch);
120
+ }
121
+ // ─── Graph ──────────────────────────────────────────────
122
+ async graphInfo() {
123
+ return this.request("GET", "/developer/v1/graph");
124
+ }
125
+ // ─── Profile / Credits ─────────────────────────────────
126
+ async profile() {
127
+ return this.request("GET", "/developer/v1/profile");
128
+ }
129
+ async credits() {
130
+ return this.request("GET", "/developer/v1/credits");
131
+ }
132
+ // ─── Insights ───────────────────────────────────────────
133
+ async insights() {
134
+ return this.request("GET", "/developer/v1/insights");
135
+ }
136
+ }
137
+ exports.MindClient = MindClient;
138
+ //# sourceMappingURL=mind-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mind-client.js","sourceRoot":"","sources":["../src/mind-client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAoIH,MAAM,YAAa,SAAQ,KAAK;IAErB;IACA;IACA;IAHT,YACS,MAAc,EACd,UAAkB,EAClB,IAAY;QAEnB,KAAK,CAAC,kBAAkB,MAAM,KAAK,UAAU,MAAM,IAAI,EAAE,CAAC,CAAC;QAJpD,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAGnB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAa,UAAU;IACb,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,MAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,MAAc,EACd,IAAY,EACZ,IAAc,EACd,MAA+B;QAE/B,IAAI,GAAG,GAAG,GAAG,IAAI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,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,OAAO,CAAkB,KAAK,EAAE,uBAAuB,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,OAAO;QAOX,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;IACtD,CAAC;IAED,2DAA2D;IAE3D,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,OAAO,CAAmB,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACzE,CAAC;CACF;AA/KD,gCA+KC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * MIND MCP Server
3
+ *
4
+ * Exposes the MIND knowledge graph as MCP tools that any LLM agent can use.
5
+ * This is the universal AI memory layer.
6
+ *
7
+ * Tools:
8
+ * mind_query — Semantic search across the knowledge graph
9
+ * mind_remember — Store content to the graph (auto-categorized)
10
+ * mind_context — Get structured always-loaded context (soul/user/rules)
11
+ * mind_life — Read/write goals, projects, tasks
12
+ * mind_crm — Read/write contacts and interactions
13
+ * mind_graph — Get graph statistics and health
14
+ */
15
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ import { MindClient } from "./mind-client.js";
17
+ export declare function createMindMcpServer(client: MindClient): McpServer;
18
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAqbjE"}