|
14 | 14 | mempalace mine <dir> Mine project files (default) |
15 | 15 | mempalace mine <dir> --mode convos Mine conversation exports |
16 | 16 | mempalace search "query" Find anything, exact words |
| 17 | + mempalace mcp Show MCP setup command |
17 | 18 | mempalace wake-up Show L0 + L1 wake-up context |
18 | 19 | mempalace wake-up --wing my_app Wake-up for a specific project |
19 | 20 | mempalace status Show what's been filed |
|
28 | 29 |
|
29 | 30 | import os |
30 | 31 | import sys |
| 32 | +import shlex |
31 | 33 | import argparse |
32 | 34 | from pathlib import Path |
33 | 35 |
|
@@ -241,6 +243,27 @@ def cmd_instructions(args): |
241 | 243 | run_instructions(name=args.name) |
242 | 244 |
|
243 | 245 |
|
| 246 | +def cmd_mcp(args): |
| 247 | + """Show how to wire MemPalace into MCP-capable hosts.""" |
| 248 | + base_server_cmd = "python -m mempalace.mcp_server" |
| 249 | + |
| 250 | + if args.palace: |
| 251 | + resolved_palace = str(Path(args.palace).expanduser()) |
| 252 | + server_cmd = f"{base_server_cmd} --palace {shlex.quote(resolved_palace)}" |
| 253 | + else: |
| 254 | + server_cmd = base_server_cmd |
| 255 | + |
| 256 | + print("MemPalace MCP quick setup:") |
| 257 | + print(f" claude mcp add mempalace -- {server_cmd}") |
| 258 | + print("\nRun the server directly:") |
| 259 | + print(f" {server_cmd}") |
| 260 | + |
| 261 | + if not args.palace: |
| 262 | + print("\nOptional custom palace:") |
| 263 | + print(f" claude mcp add mempalace -- {base_server_cmd} --palace /path/to/palace") |
| 264 | + print(f" {base_server_cmd} --palace /path/to/palace") |
| 265 | + |
| 266 | + |
244 | 267 | def cmd_compress(args): |
245 | 268 | """Compress drawers in a wing using AAAK Dialect.""" |
246 | 269 | import chromadb |
@@ -501,6 +524,12 @@ def main(): |
501 | 524 | help="Rebuild palace vector index from stored data (fixes segfaults after corruption)", |
502 | 525 | ) |
503 | 526 |
|
| 527 | + # mcp |
| 528 | + sub.add_parser( |
| 529 | + "mcp", |
| 530 | + help="Show MCP setup command for connecting MemPalace to your AI client", |
| 531 | + ) |
| 532 | + |
504 | 533 | # status |
505 | 534 | sub.add_parser("status", help="Show what's been filed") |
506 | 535 |
|
@@ -532,6 +561,7 @@ def main(): |
532 | 561 | "mine": cmd_mine, |
533 | 562 | "split": cmd_split, |
534 | 563 | "search": cmd_search, |
| 564 | + "mcp": cmd_mcp, |
535 | 565 | "compress": cmd_compress, |
536 | 566 | "wake-up": cmd_wakeup, |
537 | 567 | "repair": cmd_repair, |
|
0 commit comments