traqr-memory-mcp 0.1.3 → 0.1.5

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 CHANGED
@@ -1,68 +1,114 @@
1
- # TraqrDB — Memory-as-a-Service for AI Agents
1
+ # traqr-memory-mcp
2
2
 
3
- A schema + intelligence layer on top of Postgres + pgvector. Store memories, search by meaning, track entity relationships, manage memory lifecycle all via 10 MCP tools.
3
+ MCP server for persistent AI agent memory. 10 tools, Postgres + pgvector, multi-strategy retrieval (semantic + BM25 + RRF). Works with Claude Code, Cursor, Codex, and any MCP client.
4
4
 
5
- ## Quick Start (10 minutes)
5
+ ## Quick Start
6
6
 
7
7
  ### 1. Set Up Your Database
8
8
 
9
- **Option A: Supabase (easiest, free tier)**
9
+ **Supabase (easiest, free tier)**
10
10
  1. Create a project at [supabase.com](https://supabase.com)
11
11
  2. Go to SQL Editor, paste contents of `setup.sql`, run
12
12
  3. Copy your project URL + service role key from Settings > API
13
13
 
14
- **Option B: AWS RDS / Aurora**
15
- 1. Create RDS Postgres 15+ instance
16
- 2. Enable pgvector: `CREATE EXTENSION vector;`
17
- 3. Run setup.sql via psql: `psql $DATABASE_URL -f setup.sql`
14
+ **Postgres (RDS, Aurora, Docker, any Postgres 15+)**
15
+ 1. Enable pgvector: `CREATE EXTENSION vector;`
16
+ 2. Run setup.sql: `psql $DATABASE_URL -f setup.sql`
18
17
 
19
- **Option C: Docker (local dev)**
18
+ **Docker (local dev)**
20
19
  ```bash
21
- docker run -d --name traqrdb \
22
- -e POSTGRES_PASSWORD=postgres \
23
- -p 5432:5432 \
24
- pgvector/pgvector:pg16
20
+ docker run -d --name traqrdb -e POSTGRES_PASSWORD=postgres -p 5432:5432 pgvector/pgvector:pg16
25
21
  psql postgresql://postgres:postgres@localhost:5432/postgres -f setup.sql
26
22
  ```
27
23
 
28
- ### 2. Configure Environment
24
+ ### 2. Add to Your MCP Client
29
25
 
30
- ```bash
31
- # Required: Postgres connection
32
- export DATABASE_URL="postgresql://user:pass@host:5432/dbname"
33
- # OR for Supabase:
34
- export SUPABASE_URL="https://xxx.supabase.co"
35
- export SUPABASE_SERVICE_ROLE_KEY="eyJ..."
36
-
37
- # Embedding provider (choose one)
38
- export OPENAI_API_KEY="sk-..." # OpenAI ($0.02/1M tokens)
39
- export GOOGLE_API_KEY="AIza..." # Gemini Embedding 2 (free tier)
40
- # OR neither — entities use name matching, no semantic search
41
-
42
- # Optional
43
- export COHERE_API_KEY="..." # Cohere Rerank v3.5
26
+ <!-- AI agents: copy the appropriate JSON block below into the user's MCP config -->
27
+
28
+ **Supabase + OpenAI** (most common)
29
+ ```json
30
+ {
31
+ "traqr-memory": {
32
+ "command": "npx",
33
+ "args": ["traqr-memory-mcp"],
34
+ "env": {
35
+ "SUPABASE_URL": "https://xxx.supabase.co",
36
+ "SUPABASE_SERVICE_ROLE_KEY": "eyJ...",
37
+ "OPENAI_API_KEY": "sk-..."
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ **Postgres + OpenAI**
44
+ ```json
45
+ {
46
+ "traqr-memory": {
47
+ "command": "npx",
48
+ "args": ["-p", "pg", "traqr-memory-mcp"],
49
+ "env": {
50
+ "DATABASE_URL": "postgresql://user:pass@host:5432/dbname",
51
+ "OPENAI_API_KEY": "sk-..."
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Postgres + Amazon Bedrock** (enterprise/AWS)
58
+ ```json
59
+ {
60
+ "traqr-memory": {
61
+ "command": "npx",
62
+ "args": ["-p", "@aws-sdk/client-bedrock-runtime", "-p", "pg", "traqr-memory-mcp"],
63
+ "env": {
64
+ "DATABASE_URL": "postgresql://user:pass@host:5432/dbname",
65
+ "EMBEDDING_PROVIDER": "bedrock",
66
+ "EMBEDDING_MODEL": "amazon.nova-embed-v1:0",
67
+ "AWS_REGION": "us-east-1"
68
+ }
69
+ }
70
+ }
44
71
  ```
45
72
 
46
- ### 3. Connect to Your AI Agent
73
+ **Supabase + Gemini** (free embeddings)
74
+ ```json
75
+ {
76
+ "traqr-memory": {
77
+ "command": "npx",
78
+ "args": ["traqr-memory-mcp"],
79
+ "env": {
80
+ "SUPABASE_URL": "https://xxx.supabase.co",
81
+ "SUPABASE_SERVICE_ROLE_KEY": "eyJ...",
82
+ "GOOGLE_API_KEY": "AIza..."
83
+ }
84
+ }
85
+ }
86
+ ```
47
87
 
48
- Add to your MCP client config (Claude Code, Cursor, etc.):
88
+ **No embeddings** (BM25 keyword search only)
49
89
  ```json
50
90
  {
51
91
  "traqr-memory": {
52
92
  "command": "npx",
53
93
  "args": ["traqr-memory-mcp"],
54
94
  "env": {
55
- "DATABASE_URL": "postgresql://...",
56
- "OPENAI_API_KEY": "sk-..."
95
+ "SUPABASE_URL": "https://xxx.supabase.co",
96
+ "SUPABASE_SERVICE_ROLE_KEY": "eyJ...",
97
+ "EMBEDDING_PROVIDER": "none"
57
98
  }
58
99
  }
59
100
  }
60
101
  ```
61
102
 
62
- ### 4. Verify
103
+ ### 3. Verify
63
104
 
64
105
  Use `memory_audit` to check health, then `memory_store` to create your first memory.
65
106
 
107
+ On startup you should see:
108
+ ```
109
+ TraqrDB Memory MCP v0.1.3 | Schema v2 | DB: Supabase | Embeddings: openai/text-embedding-3-small | Ready
110
+ ```
111
+
66
112
  ---
67
113
 
68
114
  ## 10 MCP Tools
@@ -70,65 +116,92 @@ Use `memory_audit` to check health, then `memory_store` to create your first mem
70
116
  | Tool | Description |
71
117
  |------|-------------|
72
118
  | `memory_store` | Remember something. Only content required — everything else auto-derived. |
73
- | `memory_search` | Search memories by meaning. Returns summaries. |
74
- | `memory_read` | Expand a memory by ID. Full content + version history. |
119
+ | `memory_search` | Search memories by meaning. Returns summaries (~30 tokens each). |
120
+ | `memory_read` | Expand a memory by ID. Full content + metadata + version history. |
75
121
  | `memory_enhance` | Deepen understanding. Creates connected memories via triage pipeline. |
76
122
  | `memory_browse` | Navigate by facet. Domain > category > summaries. Zero embedding cost. |
77
123
  | `memory_context` | Load task-relevant context — principles, preferences, gotchas. |
78
- | `memory_pulse` | Batch: capture multiple learnings + search + update in one call. |
124
+ | `memory_pulse` | Batch: capture multiple learnings + search in one call. |
79
125
  | `memory_audit` | System health, stats, quality metrics. |
80
126
  | `memory_archive` | Archive stale content that was once correct. |
81
127
  | `memory_forget` | Forget incorrect or harmful content permanently. |
82
128
 
129
+ ## Environment Variables
130
+
131
+ ### Database (required — choose one)
132
+
133
+ | Variable | Description |
134
+ |----------|-------------|
135
+ | `SUPABASE_URL` | Supabase project URL (e.g., `https://xxx.supabase.co`) |
136
+ | `SUPABASE_SERVICE_ROLE_KEY` | Supabase service role key (not anon key) |
137
+ | `DATABASE_URL` | Raw Postgres connection string. Requires `npm install pg`. |
138
+
139
+ ### Embedding Provider (choose one)
140
+
141
+ | Variable | Provider | Notes |
142
+ |----------|----------|-------|
143
+ | `OPENAI_API_KEY` | OpenAI | text-embedding-3-small, 1536 dims. $0.02/1M tokens. |
144
+ | `GOOGLE_API_KEY` | Gemini | gemini-embedding-001, 1536 dims. Free tier available. |
145
+ | `EMBEDDING_PROVIDER=bedrock` | Amazon Bedrock | Requires AWS credentials (IAM role, env vars, or ~/.aws/credentials). |
146
+ | `EMBEDDING_PROVIDER=ollama` | Ollama | Local models. Set `OLLAMA_BASE_URL` if not localhost:11434. |
147
+ | `EMBEDDING_PROVIDER=none` | None | BM25 keyword search only. No API key needed. |
148
+
149
+ ### Provider-Specific
150
+
151
+ | Variable | When | Description |
152
+ |----------|------|-------------|
153
+ | `EMBEDDING_PROVIDER` | Always | Explicit provider selection: `openai`, `gemini`, `bedrock`, `ollama`, `none`. Auto-detects from API keys if not set. |
154
+ | `EMBEDDING_MODEL` | Bedrock/Ollama | Override default model (e.g., `amazon.nova-embed-v1:0`, `nomic-embed-text`) |
155
+ | `EMBEDDING_DIMENSIONS` | Bedrock/Ollama | Override embedding dimensions (default: 1536 for Bedrock, 768 for Ollama) |
156
+ | `OPENAI_BASE_URL` | OpenAI | Custom base URL for corporate proxies or compatible APIs |
157
+ | `OLLAMA_BASE_URL` | Ollama | Ollama server URL (default: `http://localhost:11434`) |
158
+ | `AWS_REGION` | Bedrock | AWS region (default: `us-east-1`) |
159
+
160
+ ### Optional
161
+
162
+ | Variable | Description |
163
+ |----------|-------------|
164
+ | `COHERE_API_KEY` | Cohere Rerank v3.5 (quality boost for search results) |
165
+ | `TRAQR_USER_ID` | Override default user ID (for multi-user setups) |
166
+ | `TRAQR_PROJECT_ID` | Override default project ID |
167
+
83
168
  ## What's Inside
84
169
 
85
170
  **Schema** (created by `setup.sql`):
86
- - `traqr_memories` — content, embeddings, lifecycle, dual tsvectors
87
- - `memory_relationships` — graph edges between memories
171
+ - `traqr_memories` — content, embeddings, lifecycle metadata, dual tsvectors for BM25
172
+ - `memory_relationships` — typed graph edges between memories
88
173
  - `memory_entities` — extracted entities with embeddings
89
174
  - `memory_entity_links` — memory-to-entity junction table
90
175
  - 12+ indexes including partial HNSW, BM25 GIN, lifecycle
91
- - 10+ RPC functions for search, BM25, temporal, graph, confidence decay
176
+ - 10+ SQL functions for search, BM25, temporal, graph, confidence decay
92
177
 
93
178
  **Intelligence** (in the TypeScript package):
94
179
  - Multi-strategy retrieval: semantic + BM25 > RRF fusion > optional Cohere rerank
95
180
  - 3-zone cosine triage: NOOP (>=0.90), ADD (<0.60), borderline (GPT-4o-mini decision)
96
181
  - Type-aware lifecycle: facts invalidate, preferences supersede, patterns coexist
97
- - Entity extraction: multi-signal canonicalization (name > ILIKE > embedding)
98
- - Quality gate: 3-layer ingestion filter prevents noise
182
+ - Entity extraction: multi-signal canonicalization (exact name > ILIKE > embedding similarity)
183
+ - Citation-aware decay: frequently cited memories resist archival
99
184
 
100
185
  ## Graceful Degradation
101
186
 
102
- | Missing | Behavior |
103
- |---------|----------|
104
- | No embedding API key | Entities use name matching. BM25 keyword search works. No vector search. |
105
- | No COHERE_API_KEY | Search uses RRF scores instead of Cohere rerank. |
187
+ | Configuration | Search Behavior | Entity Behavior |
188
+ |---------------|----------------|-----------------|
189
+ | OpenAI/Gemini/Bedrock + Cohere | Full: semantic + BM25 + RRF + Cohere rerank | Full: name + fuzzy + embedding matching |
190
+ | OpenAI/Gemini/Bedrock (no Cohere) | Semantic + BM25 + RRF fusion | Full: name + fuzzy + embedding matching |
191
+ | Ollama (local) | Semantic + BM25 + RRF fusion | Full: name + fuzzy + embedding matching |
192
+ | `EMBEDDING_PROVIDER=none` | BM25 keyword search only | Name + fuzzy matching only (no embedding) |
106
193
 
107
- ## TypeScript Library API
194
+ ## Troubleshooting
108
195
 
109
- ```typescript
110
- import { storeMemory, searchMemories, triageAndStore } from '@traqr/memory'
196
+ If something goes wrong, the MCP server prints structured error messages with fix steps. Common issues:
111
197
 
112
- // Store a memory
113
- await storeMemory({ content: 'Always use bun', sourceType: 'manual' })
198
+ **"schema_version table not found"** — Run `setup.sql` on your database. For Supabase: paste into SQL Editor. For Postgres: `psql $DATABASE_URL -f setup.sql`.
114
199
 
115
- // Search by meaning
116
- const results = await searchMemories('package manager', { limit: 5 })
200
+ **"SUPABASE_SERVICE_ROLE_KEY is missing"** — Find it at Supabase Dashboard > Settings > API > service_role (not the anon key).
117
201
 
118
- // Store with triage (dedup + edges + LLM borderline)
119
- const result = await triageAndStore({ content: '...', sourceType: 'session' })
120
- // result.zone: 'noop' | 'add' | 'borderline'
121
- ```
122
-
123
- ## Environment Variables
202
+ **"Raw Postgres requires the pg package"** Install it: `npm install pg` or add `-p pg` to your npx args.
124
203
 
125
- | Variable | Required | Description |
126
- |----------|----------|-------------|
127
- | `DATABASE_URL` or `SUPABASE_URL` | Yes | Postgres connection |
128
- | `SUPABASE_SERVICE_ROLE_KEY` | Supabase only | Service role key |
129
- | `OPENAI_API_KEY` | Recommended | OpenAI embeddings |
130
- | `GOOGLE_API_KEY` | Alternative | Gemini Embedding 2 (free) |
131
- | `COHERE_API_KEY` | No | Cohere Rerank (quality boost) |
204
+ **Embedding errors** Check your API key is valid. For Bedrock, ensure AWS credentials are configured (IAM role, env vars, or `~/.aws/credentials`).
132
205
 
133
206
  ## License
134
207
 
@@ -0,0 +1,23 @@
1
+ /**
2
+ * MCP Config Templates
3
+ *
4
+ * Builds the JSON config block that goes into the user's MCP client config.
5
+ * Templates match the README exactly — same args, same env vars.
6
+ */
7
+ export type DbProvider = 'supabase' | 'postgres';
8
+ export type EmbeddingProvider = 'openai' | 'gemini' | 'bedrock' | 'ollama' | 'none';
9
+ export interface WizardAnswers {
10
+ db: DbProvider;
11
+ embedding: EmbeddingProvider;
12
+ supabaseUrl?: string;
13
+ supabaseKey?: string;
14
+ databaseUrl?: string;
15
+ openaiKey?: string;
16
+ googleKey?: string;
17
+ awsRegion?: string;
18
+ ollamaUrl?: string;
19
+ ollamaModel?: string;
20
+ }
21
+ export declare function buildMcpConfig(answers: WizardAnswers): Record<string, any>;
22
+ export declare function formatConfig(config: Record<string, any>): string;
23
+ //# sourceMappingURL=config-templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-templates.d.ts","sourceRoot":"","sources":["../../src/cli/config-templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AAChD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,UAAU,CAAA;IACd,SAAS,EAAE,iBAAiB,CAAA;IAE5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAiD1E;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * MCP Config Templates
3
+ *
4
+ * Builds the JSON config block that goes into the user's MCP client config.
5
+ * Templates match the README exactly — same args, same env vars.
6
+ */
7
+ export function buildMcpConfig(answers) {
8
+ const args = [];
9
+ // Optional peer deps via npx -p
10
+ if (answers.embedding === 'bedrock')
11
+ args.push('-p', '@aws-sdk/client-bedrock-runtime');
12
+ if (answers.db === 'postgres')
13
+ args.push('-p', 'pg');
14
+ args.push('traqr-memory-mcp');
15
+ // Env vars
16
+ const env = {};
17
+ // DB
18
+ if (answers.db === 'supabase') {
19
+ if (answers.supabaseUrl)
20
+ env.SUPABASE_URL = answers.supabaseUrl;
21
+ if (answers.supabaseKey)
22
+ env.SUPABASE_SERVICE_ROLE_KEY = answers.supabaseKey;
23
+ }
24
+ else {
25
+ if (answers.databaseUrl)
26
+ env.DATABASE_URL = answers.databaseUrl;
27
+ }
28
+ // Embedding
29
+ switch (answers.embedding) {
30
+ case 'openai':
31
+ if (answers.openaiKey)
32
+ env.OPENAI_API_KEY = answers.openaiKey;
33
+ break;
34
+ case 'gemini':
35
+ if (answers.googleKey)
36
+ env.GOOGLE_API_KEY = answers.googleKey;
37
+ break;
38
+ case 'bedrock':
39
+ env.EMBEDDING_PROVIDER = 'bedrock';
40
+ env.EMBEDDING_MODEL = 'amazon.nova-embed-v1:0';
41
+ if (answers.awsRegion)
42
+ env.AWS_REGION = answers.awsRegion;
43
+ break;
44
+ case 'ollama':
45
+ env.EMBEDDING_PROVIDER = 'ollama';
46
+ if (answers.ollamaUrl)
47
+ env.OLLAMA_BASE_URL = answers.ollamaUrl;
48
+ if (answers.ollamaModel)
49
+ env.EMBEDDING_MODEL = answers.ollamaModel;
50
+ break;
51
+ case 'none':
52
+ env.EMBEDDING_PROVIDER = 'none';
53
+ break;
54
+ }
55
+ return {
56
+ 'traqr-memory': {
57
+ command: 'npx',
58
+ args,
59
+ env,
60
+ },
61
+ };
62
+ }
63
+ export function formatConfig(config) {
64
+ return JSON.stringify(config, null, 2);
65
+ }
66
+ //# sourceMappingURL=config-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-templates.js","sourceRoot":"","sources":["../../src/cli/config-templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,MAAM,UAAU,cAAc,CAAC,OAAsB;IACnD,MAAM,IAAI,GAAa,EAAE,CAAA;IAEzB,gCAAgC;IAChC,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAA;IACvF,IAAI,OAAO,CAAC,EAAE,KAAK,UAAU;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACpD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAE7B,WAAW;IACX,MAAM,GAAG,GAA2B,EAAE,CAAA;IAEtC,KAAK;IACL,IAAI,OAAO,CAAC,EAAE,KAAK,UAAU,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,WAAW;YAAE,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAA;QAC/D,IAAI,OAAO,CAAC,WAAW;YAAE,GAAG,CAAC,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAA;IAC9E,CAAC;SAAM,CAAC;QACN,IAAI,OAAO,CAAC,WAAW;YAAE,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAA;IACjE,CAAC;IAED,YAAY;IACZ,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,QAAQ;YACX,IAAI,OAAO,CAAC,SAAS;gBAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,SAAS,CAAA;YAC7D,MAAK;QACP,KAAK,QAAQ;YACX,IAAI,OAAO,CAAC,SAAS;gBAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,SAAS,CAAA;YAC7D,MAAK;QACP,KAAK,SAAS;YACZ,GAAG,CAAC,kBAAkB,GAAG,SAAS,CAAA;YAClC,GAAG,CAAC,eAAe,GAAG,wBAAwB,CAAA;YAC9C,IAAI,OAAO,CAAC,SAAS;gBAAE,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAA;YACzD,MAAK;QACP,KAAK,QAAQ;YACX,GAAG,CAAC,kBAAkB,GAAG,QAAQ,CAAA;YACjC,IAAI,OAAO,CAAC,SAAS;gBAAE,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAA;YAC9D,IAAI,OAAO,CAAC,WAAW;gBAAE,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,WAAW,CAAA;YAClE,MAAK;QACP,KAAK,MAAM;YACT,GAAG,CAAC,kBAAkB,GAAG,MAAM,CAAA;YAC/B,MAAK;IACT,CAAC;IAED,OAAO;QACL,cAAc,EAAE;YACd,OAAO,EAAE,KAAK;YACd,IAAI;YACJ,GAAG;SACJ;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAA2B;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * MCP Client Detection
3
+ *
4
+ * Finds the config file for the user's MCP client so --install
5
+ * can write the traqr-memory server config directly.
6
+ */
7
+ export interface DetectedClient {
8
+ name: string;
9
+ configPath: string;
10
+ configKey: string;
11
+ }
12
+ export declare function detectMcpClients(): DetectedClient[];
13
+ export declare function readClientConfig(client: DetectedClient): Record<string, any>;
14
+ //# sourceMappingURL=detect-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-client.d.ts","sourceRoot":"","sources":["../../src/cli/detect-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAsBD,wBAAgB,gBAAgB,IAAI,cAAc,EAAE,CAInD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAM5E"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * MCP Client Detection
3
+ *
4
+ * Finds the config file for the user's MCP client so --install
5
+ * can write the traqr-memory server config directly.
6
+ */
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ const HOME = process.env.HOME || '';
10
+ const CLIENTS = [
11
+ {
12
+ name: 'Claude Code',
13
+ path: join(HOME, '.claude', 'settings.json'),
14
+ key: 'mcpServers',
15
+ },
16
+ {
17
+ name: 'Claude Desktop',
18
+ path: join(HOME, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'),
19
+ key: 'mcpServers',
20
+ },
21
+ {
22
+ name: 'Cursor',
23
+ path: join(process.cwd(), '.cursor', 'mcp.json'),
24
+ key: 'mcpServers',
25
+ },
26
+ ];
27
+ export function detectMcpClients() {
28
+ return CLIENTS
29
+ .filter(c => existsSync(c.path))
30
+ .map(c => ({ name: c.name, configPath: c.path, configKey: c.key }));
31
+ }
32
+ export function readClientConfig(client) {
33
+ try {
34
+ return JSON.parse(readFileSync(client.configPath, 'utf-8'));
35
+ }
36
+ catch {
37
+ return {};
38
+ }
39
+ }
40
+ //# sourceMappingURL=detect-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-client.js","sourceRoot":"","sources":["../../src/cli/detect-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAQhC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAA;AAEnC,MAAM,OAAO,GAAuD;IAClE;QACE,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC;QAC5C,GAAG,EAAE,YAAY;KAClB;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,CAAC;QAC1F,GAAG,EAAE,YAAY;KAClB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC;QAChD,GAAG,EAAE,YAAY;KAClB;CACF,CAAA;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * --install — Interactive Setup Wizard
3
+ *
4
+ * Detects MCP client, asks 2-3 questions, writes config.
5
+ * Uses @clack/prompts for polished interactive UI.
6
+ *
7
+ * Usage: npx traqr-memory-mcp --install
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/cli/install.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}