@sudosandwich/limps 3.1.0 → 3.2.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 +458 -15
- package/dist/cli/config-cmd.d.ts +2 -2
- package/dist/cli/config-cmd.d.ts.map +1 -1
- package/dist/cli/config-cmd.js +7 -6
- package/dist/cli/config-cmd.js.map +1 -1
- package/dist/cli/mcp-client-adapter.d.ts +26 -17
- package/dist/cli/mcp-client-adapter.d.ts.map +1 -1
- package/dist/cli/mcp-client-adapter.js +23 -28
- package/dist/cli/mcp-client-adapter.js.map +1 -1
- package/dist/commands/serve.d.ts +17 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +125 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/start.js +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status-server.d.ts.map +1 -1
- package/dist/commands/status-server.js +114 -49
- package/dist/commands/status-server.js.map +1 -1
- package/dist/commands/stop.d.ts.map +1 -1
- package/dist/commands/stop.js +3 -2
- package/dist/commands/stop.js.map +1 -1
- package/dist/pidfile.d.ts +30 -4
- package/dist/pidfile.d.ts.map +1 -1
- package/dist/pidfile.js +66 -6
- package/dist/pidfile.js.map +1 -1
- package/dist/server-http.d.ts.map +1 -1
- package/dist/server-http.js +43 -3
- package/dist/server-http.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/utils/app-paths.d.ts +15 -0
- package/dist/utils/app-paths.d.ts.map +1 -0
- package/dist/utils/app-paths.js +37 -0
- package/dist/utils/app-paths.js.map +1 -0
- package/dist/utils/config-resolver.d.ts +1 -0
- package/dist/utils/config-resolver.d.ts.map +1 -1
- package/dist/utils/config-resolver.js +29 -0
- package/dist/utils/config-resolver.js.map +1 -1
- package/dist/utils/daemon-manager.d.ts +23 -0
- package/dist/utils/daemon-manager.d.ts.map +1 -0
- package/dist/utils/daemon-manager.js +89 -0
- package/dist/utils/daemon-manager.js.map +1 -0
- package/dist/utils/http-client.d.ts +2 -0
- package/dist/utils/http-client.d.ts.map +1 -1
- package/dist/utils/http-client.js.map +1 -1
- package/dist/utils/port-checker.d.ts +23 -0
- package/dist/utils/port-checker.d.ts.map +1 -0
- package/dist/utils/port-checker.js +56 -0
- package/dist/utils/port-checker.js.map +1 -0
- package/dist/utils/version-state.d.ts.map +1 -1
- package/dist/utils/version-state.js +1 -19
- package/dist/utils/version-state.js.map +1 -1
- package/package.json +3 -1
- package/postinstall/postinstall.cjs +354 -0
package/README.md
CHANGED
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
- [Project Setup](#project-setup)
|
|
24
24
|
- [Client Setup](#client-setup)
|
|
25
25
|
- [Transport](#transport)
|
|
26
|
+
- [Daemon Management](#daemon-management)
|
|
26
27
|
- [CLI Commands](#cli-commands)
|
|
27
28
|
- [Configuration](#configuration)
|
|
28
29
|
- [Environment Variables](#environment-variables)
|
|
30
|
+
- [Troubleshooting](#troubleshooting)
|
|
29
31
|
- [MCP Tools](#mcp-tools)
|
|
30
32
|
- [Skills & Commands](#skills--commands)
|
|
31
33
|
- [Extensions](#extensions)
|
|
@@ -49,6 +51,9 @@ limps init
|
|
|
49
51
|
|
|
50
52
|
# Start the HTTP daemon
|
|
51
53
|
limps start
|
|
54
|
+
# → Daemon starts on http://127.0.0.1:4269/mcp
|
|
55
|
+
# → PID file written to OS-standard location
|
|
56
|
+
# → Ready for MCP client connections
|
|
52
57
|
|
|
53
58
|
# Generate MCP client config
|
|
54
59
|
limps config print --client claude-code
|
|
@@ -57,6 +62,8 @@ limps config print --client claude-code
|
|
|
57
62
|
|
|
58
63
|
That's it. Your AI assistant now has access to your documents via HTTP transport. The folder can be anywhere—local, synced, or in a repo; limps does not require a git repository or a `plans/` directory.
|
|
59
64
|
|
|
65
|
+
**Tip:** `limps status-server` shows the status of the current project if a config is found in the working directory (or passed via `--config`). Run it from a directory where no limps config can be resolved to list all running limps daemons on your system.
|
|
66
|
+
|
|
60
67
|
## Features
|
|
61
68
|
|
|
62
69
|
- **Document CRUD + full-text search** across any folder of Markdown files
|
|
@@ -74,6 +81,7 @@ That's it. Your AI assistant now has access to your documents via HTTP transport
|
|
|
74
81
|
|
|
75
82
|
- **Local only** — Your data stays on disk (SQLite index + your files). No cloud, no subscription.
|
|
76
83
|
- **Restart after changes** — If you change the indexed folder or config, restart the MCP server (or rely on the file watcher) so the index and tools reflect the current state.
|
|
84
|
+
- **Daemon management** — The HTTP server runs as a background process. Use `limps start`, `limps stop`, and `limps status-server` to manage the daemon lifecycle. PID files are stored in OS-standard directories for system-wide awareness.
|
|
77
85
|
- **Sandboxed user code** — `process_doc` and `process_docs` run your JavaScript in a QuickJS sandbox with time and memory limits; no network or Node APIs.
|
|
78
86
|
- **One optional network call** — `limps version --check` fetches from the npm registry to compare versions. All other commands (serve, init, list, search, create/update/delete docs, process_doc, etc.) do **not** contact the internet. Omit `version --check` if you want zero external calls.
|
|
79
87
|
|
|
@@ -309,21 +317,23 @@ limps v3 uses **HTTP transport exclusively** via a persistent daemon. This allow
|
|
|
309
317
|
|
|
310
318
|
```bash
|
|
311
319
|
# Start the daemon
|
|
312
|
-
limps start
|
|
320
|
+
limps start
|
|
313
321
|
|
|
314
322
|
# Check status (shows uptime, sessions, PID)
|
|
315
|
-
limps status-server
|
|
323
|
+
limps status-server
|
|
316
324
|
|
|
317
325
|
# Stop the daemon
|
|
318
|
-
limps stop
|
|
326
|
+
limps stop
|
|
319
327
|
```
|
|
320
328
|
|
|
321
329
|
The daemon runs at `http://127.0.0.1:4269/mcp` by default. Use `limps config print` to generate the correct MCP client configuration:
|
|
322
330
|
|
|
323
331
|
```bash
|
|
324
|
-
limps config print --client claude-code
|
|
332
|
+
limps config print --client claude-code
|
|
325
333
|
```
|
|
326
334
|
|
|
335
|
+
See [Daemon Management](#daemon-management) for detailed lifecycle documentation.
|
|
336
|
+
|
|
327
337
|
### MCP Client Configuration
|
|
328
338
|
|
|
329
339
|
All clients use HTTP transport. Example config:
|
|
@@ -345,15 +355,15 @@ All clients use HTTP transport. Example config:
|
|
|
345
355
|
|
|
346
356
|
Customize the HTTP server by adding a `"server"` section to your `config.json`:
|
|
347
357
|
|
|
348
|
-
| Option | Default
|
|
349
|
-
| ------------------ |
|
|
350
|
-
| `port` | `4269`
|
|
351
|
-
| `host` | `127.0.0.1`
|
|
352
|
-
| `maxSessions` | `100`
|
|
353
|
-
| `sessionTimeoutMs` | `1800000`
|
|
354
|
-
| `corsOrigin` | `""` (none)
|
|
355
|
-
| `maxBodySize` | `10485760`
|
|
356
|
-
| `rateLimit` | `100 req/min`
|
|
358
|
+
| Option | Default | Description |
|
|
359
|
+
| ------------------ | ---------------------- | ---------------------------------------- |
|
|
360
|
+
| `port` | `4269` | HTTP listen port |
|
|
361
|
+
| `host` | `127.0.0.1` | Bind address |
|
|
362
|
+
| `maxSessions` | `100` | Maximum concurrent MCP sessions |
|
|
363
|
+
| `sessionTimeoutMs` | `1800000` | Session idle timeout in ms (30 min) |
|
|
364
|
+
| `corsOrigin` | `""` (none) | CORS origin (`""`, `"*"`, or a URL) |
|
|
365
|
+
| `maxBodySize` | `10485760` | Max request body in bytes (10 MB) |
|
|
366
|
+
| `rateLimit` | `100 req/min` | Rate limit per client IP |
|
|
357
367
|
|
|
358
368
|
Example custom server config:
|
|
359
369
|
|
|
@@ -366,8 +376,255 @@ Example custom server config:
|
|
|
366
376
|
}
|
|
367
377
|
```
|
|
368
378
|
|
|
379
|
+
**Note:** PID files are stored in OS-standard application directories:
|
|
380
|
+
- **macOS**: `~/Library/Application Support/limps/pids/`
|
|
381
|
+
- **Linux**: `$XDG_DATA_HOME/limps/pids/` or `~/.local/share/limps/pids/`
|
|
382
|
+
- **Windows**: `%APPDATA%/limps/pids/`
|
|
383
|
+
|
|
384
|
+
This enables `limps status-server` to perform system-wide daemon discovery when no project configuration can be resolved; when a limps config is found for the current directory, the CLI runs in project mode and reports status for that project instead.
|
|
385
|
+
|
|
369
386
|
- **Remote clients**: Use an MCP-compatible HTTPS proxy for remote clients (e.g., ChatGPT).
|
|
370
387
|
|
|
388
|
+
## Daemon Management
|
|
389
|
+
|
|
390
|
+
limps v3 uses a persistent HTTP daemon with system-wide awareness. PID files are stored in OS-standard directories, allowing you to manage and discover daemons from any directory on your system.
|
|
391
|
+
|
|
392
|
+
### PID File Locations
|
|
393
|
+
|
|
394
|
+
PID files are stored in platform-specific application data directories:
|
|
395
|
+
|
|
396
|
+
**macOS:**
|
|
397
|
+
```
|
|
398
|
+
~/Library/Application Support/limps/pids/
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Linux:**
|
|
402
|
+
```
|
|
403
|
+
$XDG_DATA_HOME/limps/pids/
|
|
404
|
+
# or if XDG_DATA_HOME is not set:
|
|
405
|
+
~/.local/share/limps/pids/
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
**Windows:**
|
|
409
|
+
```
|
|
410
|
+
%APPDATA%/limps/pids/
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Each PID file is named by port number (`limps-{port}.pid`) to enable system-wide discovery. Example PID file structure:
|
|
414
|
+
|
|
415
|
+
```json
|
|
416
|
+
{
|
|
417
|
+
"pid": 12345,
|
|
418
|
+
"port": 4269,
|
|
419
|
+
"host": "127.0.0.1",
|
|
420
|
+
"startedAt": "2026-02-08T12:00:00.000Z",
|
|
421
|
+
"configPath": "/path/to/project/.limps/config.json"
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
This port-based naming allows `limps status-server` to find all running daemons across different projects without needing a config file.
|
|
426
|
+
|
|
427
|
+
### Starting the Daemon
|
|
428
|
+
|
|
429
|
+
**Background mode (default):**
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
limps start
|
|
433
|
+
# → Daemon starts on http://127.0.0.1:4269/mcp
|
|
434
|
+
# → PID file written to OS-standard location
|
|
435
|
+
# → Process detaches and runs in background
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**Foreground mode (debugging):**
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
limps start --foreground
|
|
442
|
+
# → Runs in foreground (blocks terminal)
|
|
443
|
+
# → Logs appear in stderr
|
|
444
|
+
# → Useful for debugging startup issues
|
|
445
|
+
# → Still creates PID file for discovery
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Custom port/host (via config):**
|
|
449
|
+
|
|
450
|
+
Configure `server.port` and `server.host` in your `.limps/config.json`:
|
|
451
|
+
|
|
452
|
+
```json
|
|
453
|
+
{
|
|
454
|
+
"server": {
|
|
455
|
+
"port": 8080,
|
|
456
|
+
"host": "0.0.0.0"
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Then start normally:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
limps start
|
|
465
|
+
# → Starts using server.port/server.host from config
|
|
466
|
+
# → PID file: limps-8080.pid
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
The `start` command performs health verification by polling the `/health` endpoint for up to 5 seconds, issuing repeated HTTP requests. Each individual health-check request has its own shorter timeout (for example, ~1000ms). If any request fails during this window, you'll see one of these error codes:
|
|
470
|
+
|
|
471
|
+
- **TIMEOUT** — A single health-check HTTP request exceeded its per-request timeout (e.g., ~1000ms). The daemon may be slow to start or system resources may be constrained. Try `limps start --foreground` to see logs.
|
|
472
|
+
- **NETWORK_ERROR** — Cannot connect to daemon. Port may be blocked or already in use by another process.
|
|
473
|
+
- **NON_200_STATUS** — Health endpoint returned a non-200 status code. Check daemon logs with foreground mode.
|
|
474
|
+
- **INVALID_RESPONSE** — Health endpoint responded, but the response was invalid or could not be parsed as expected (for example, malformed or missing required fields).
|
|
475
|
+
|
|
476
|
+
### Checking Daemon Status
|
|
477
|
+
|
|
478
|
+
**Project mode (when config is found):**
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# From within a project directory with .limps/config.json
|
|
482
|
+
limps status-server
|
|
483
|
+
# limps server is running
|
|
484
|
+
# PID: 12345 | 127.0.0.1:4269
|
|
485
|
+
# Uptime: 2h 15m
|
|
486
|
+
# Sessions: 3
|
|
487
|
+
|
|
488
|
+
# Or specify config explicitly
|
|
489
|
+
limps status-server --config /path/to/.limps/config.json
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**System-wide discovery (when no config is found):**
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
# From a directory without a limps config
|
|
496
|
+
cd /tmp
|
|
497
|
+
limps status-server
|
|
498
|
+
# Found 2 running daemons:
|
|
499
|
+
# 127.0.0.1:4269 (PID 12345)
|
|
500
|
+
# Uptime: 2h 15m | Sessions: 3
|
|
501
|
+
# 127.0.0.1:8080 (PID 67890)
|
|
502
|
+
# Uptime: 45m 30s | Sessions: 1
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
When `limps status-server` cannot resolve a config file in the current directory (and no `--config` is provided), it scans the system PID directory and reports all running limps daemons. When a config is found, it shows only that project's daemon status.
|
|
506
|
+
|
|
507
|
+
### Stopping the Daemon
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# From the project directory (where your .limps config lives):
|
|
511
|
+
limps stop
|
|
512
|
+
# → Gracefully shuts down daemon
|
|
513
|
+
# → Closes all MCP sessions
|
|
514
|
+
# → Stops file watchers
|
|
515
|
+
# → Removes PID file
|
|
516
|
+
# → Process exits
|
|
517
|
+
|
|
518
|
+
# Or from any directory, by specifying the config explicitly:
|
|
519
|
+
limps stop --config /path/to/.limps/config.json
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
The `stop` command is project-specific and resolves the config to determine which daemon to stop. The daemon performs a graceful shutdown by:
|
|
523
|
+
1. Closing all active MCP sessions
|
|
524
|
+
2. Shutting down file watchers
|
|
525
|
+
3. Removing the PID file
|
|
526
|
+
4. Exiting the process
|
|
527
|
+
|
|
528
|
+
### Port Conflicts
|
|
529
|
+
|
|
530
|
+
If you try to start a daemon on a port that's already in use, limps will detect the conflict and provide resolution guidance:
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
limps start
|
|
534
|
+
# Error: Port 4269 is already in use.
|
|
535
|
+
# Process using port: node (PID 12345)
|
|
536
|
+
# Command: /usr/local/bin/node /usr/local/bin/limps start
|
|
537
|
+
#
|
|
538
|
+
# To stop the process: kill 12345
|
|
539
|
+
# Or use a different port: limps start --port <port>
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
On systems with `lsof` available (macOS, Linux), limps can identify which process is using the port and show its command line. If `lsof` is not available, you'll see a simpler error message suggesting a different port.
|
|
543
|
+
|
|
544
|
+
### Foreground Mode
|
|
545
|
+
|
|
546
|
+
Use foreground mode for debugging, Docker deployments, or CI/CD pipelines:
|
|
547
|
+
|
|
548
|
+
```bash
|
|
549
|
+
limps start --foreground
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
**Use cases:**
|
|
553
|
+
- **Debugging** — See server logs in real-time to diagnose startup issues
|
|
554
|
+
- **Docker** — Keep container alive with the daemon as the main process
|
|
555
|
+
- **CI/CD** — Run tests against a limps daemon without background processes
|
|
556
|
+
|
|
557
|
+
**Behavior differences from background mode:**
|
|
558
|
+
- Logs to stderr instead of being silent
|
|
559
|
+
- Blocks the terminal (press Ctrl+C to stop)
|
|
560
|
+
- Still creates a PID file for discovery by other processes
|
|
561
|
+
- Responds to SIGINT (Ctrl+C) and SIGTERM for graceful shutdown
|
|
562
|
+
|
|
563
|
+
### Health Endpoint
|
|
564
|
+
|
|
565
|
+
The HTTP daemon exposes a `/health` endpoint for monitoring and health checks:
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
curl http://127.0.0.1:4269/health
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Example response:**
|
|
572
|
+
|
|
573
|
+
```json
|
|
574
|
+
{
|
|
575
|
+
"status": "ok",
|
|
576
|
+
"sessions": 3,
|
|
577
|
+
"uptime": 8145,
|
|
578
|
+
"pid": 12345,
|
|
579
|
+
"sessionTimeoutMs": 1800000
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
**HTTP status codes:**
|
|
584
|
+
- **200** — Daemon is healthy and accepting connections
|
|
585
|
+
- **429** — Rate limit exceeded (rate limiter may return this before the request reaches `/health`)
|
|
586
|
+
|
|
587
|
+
Use this endpoint for:
|
|
588
|
+
- Monitoring daemon health in scripts or dashboards
|
|
589
|
+
- Verifying daemon is running before connecting MCP clients
|
|
590
|
+
- Automated health checks in orchestration tools (Kubernetes, Docker Compose)
|
|
591
|
+
|
|
592
|
+
### Multiple Daemons
|
|
593
|
+
|
|
594
|
+
You can run multiple limps daemons on different ports for different projects by configuring different ports in each project's config:
|
|
595
|
+
|
|
596
|
+
```bash
|
|
597
|
+
# Project A with default port (4269)
|
|
598
|
+
cd ~/projects/project-a
|
|
599
|
+
# .limps/config.json has server.port: 4269 (or uses default)
|
|
600
|
+
limps start
|
|
601
|
+
# → Running on http://127.0.0.1:4269/mcp
|
|
602
|
+
|
|
603
|
+
# Project B with custom port (8080)
|
|
604
|
+
cd ~/projects/project-b
|
|
605
|
+
# .limps/config.json has server.port: 8080
|
|
606
|
+
limps start
|
|
607
|
+
# → Running on http://127.0.0.1:8080/mcp
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
Each daemon has its own PID file:
|
|
611
|
+
- `limps-4269.pid` — Project A
|
|
612
|
+
- `limps-8080.pid` — Project B
|
|
613
|
+
|
|
614
|
+
Discover all running daemons (run from a directory without a limps config):
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
cd /tmp
|
|
618
|
+
limps status-server
|
|
619
|
+
# Found 2 running daemons:
|
|
620
|
+
# 127.0.0.1:4269 (PID 12345)
|
|
621
|
+
# Uptime: 2h 15m | Sessions: 3
|
|
622
|
+
# 127.0.0.1:8080 (PID 67890)
|
|
623
|
+
# Uptime: 45m 30s | Sessions: 1
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
Each MCP client can connect to different daemons by configuring different URLs in their config files.
|
|
627
|
+
|
|
371
628
|
## CLI Commands
|
|
372
629
|
|
|
373
630
|
### Viewing Plans
|
|
@@ -383,9 +640,10 @@ limps next-task <plan> # Get highest-priority available task
|
|
|
383
640
|
|
|
384
641
|
```bash
|
|
385
642
|
limps init [path] # Initialize new project
|
|
386
|
-
limps start # Start HTTP daemon (
|
|
643
|
+
limps start # Start HTTP daemon (background by default)
|
|
644
|
+
limps start --foreground # Start in foreground (debugging mode)
|
|
387
645
|
limps stop # Stop HTTP daemon
|
|
388
|
-
limps status-server # Show
|
|
646
|
+
limps status-server # Show daemon status (current project or all daemons)
|
|
389
647
|
limps config show # Display current config
|
|
390
648
|
limps config print # Print MCP client config snippets
|
|
391
649
|
```
|
|
@@ -470,6 +728,191 @@ Config lives at `.limps/config.json` in your project directory, created by `limp
|
|
|
470
728
|
|
|
471
729
|
**Precedence:** `config.tools` overrides env vars. If allowlist is set, denylist is ignored.
|
|
472
730
|
|
|
731
|
+
## Troubleshooting
|
|
732
|
+
|
|
733
|
+
### Daemon Won't Start
|
|
734
|
+
|
|
735
|
+
**"Port already in use" error:**
|
|
736
|
+
|
|
737
|
+
If you see this error, another process is using the port:
|
|
738
|
+
|
|
739
|
+
```bash
|
|
740
|
+
limps start
|
|
741
|
+
# Error: Port 4269 is already in use.
|
|
742
|
+
# Process using port: node (PID 12345)
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
**Resolution:**
|
|
746
|
+
1. **Kill the existing process**: `kill 12345`
|
|
747
|
+
2. **Or use a different port**: `limps start --port 8080`
|
|
748
|
+
3. **Check if it's another limps daemon**: `limps status-server` (if so, use `limps stop` first)
|
|
749
|
+
|
|
750
|
+
**"Daemon may have failed to start" error:**
|
|
751
|
+
|
|
752
|
+
If the daemon starts but doesn't respond to health checks:
|
|
753
|
+
|
|
754
|
+
```bash
|
|
755
|
+
limps start
|
|
756
|
+
# Error: Daemon may have failed to start. Check logs or try: limps start --foreground
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
**Resolution:**
|
|
760
|
+
1. **Run in foreground to see logs**: `limps start --foreground`
|
|
761
|
+
2. **Check for permission issues**: Ensure you have write access to the PID directory
|
|
762
|
+
3. **Verify port is accessible**: Try `curl http://127.0.0.1:4269/health`
|
|
763
|
+
4. **Enable debug logging**: `DEBUG=1 limps start --foreground`
|
|
764
|
+
|
|
765
|
+
**Permission issues with PID directory:**
|
|
766
|
+
|
|
767
|
+
If you can't create PID files:
|
|
768
|
+
|
|
769
|
+
```bash
|
|
770
|
+
# macOS
|
|
771
|
+
ls -la ~/Library/Application\ Support/limps/pids/
|
|
772
|
+
|
|
773
|
+
# Linux
|
|
774
|
+
ls -la ~/.local/share/limps/pids/
|
|
775
|
+
|
|
776
|
+
# Windows
|
|
777
|
+
dir %APPDATA%\limps\pids
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
Ensure the directory exists and you have write permissions. If not, create it manually:
|
|
781
|
+
|
|
782
|
+
```bash
|
|
783
|
+
# macOS
|
|
784
|
+
mkdir -p ~/Library/Application\ Support/limps/pids
|
|
785
|
+
|
|
786
|
+
# Linux
|
|
787
|
+
mkdir -p ~/.local/share/limps/pids
|
|
788
|
+
|
|
789
|
+
# Windows
|
|
790
|
+
mkdir %APPDATA%\limps\pids
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
### Health Check Failures
|
|
794
|
+
|
|
795
|
+
**TIMEOUT error:**
|
|
796
|
+
|
|
797
|
+
The daemon did not respond within the configured timeout. Each health-check request has its own timeout (for example, 1000ms during the final `limps start` check and 3000ms for `status-server`), and during startup limps will poll for up to about 5 seconds before reporting "Daemon may have failed to start".
|
|
798
|
+
|
|
799
|
+
**Common causes:**
|
|
800
|
+
- System resource constraints (high CPU/memory usage)
|
|
801
|
+
- Slow filesystem (especially for index initialization)
|
|
802
|
+
- Large document corpus requiring time to index
|
|
803
|
+
|
|
804
|
+
**Resolution:**
|
|
805
|
+
1. Check system resources: `top` or Activity Monitor
|
|
806
|
+
2. Wait a bit longer and retry: `limps status-server`
|
|
807
|
+
3. Run in foreground to see progress: `limps start --foreground`
|
|
808
|
+
|
|
809
|
+
**NETWORK_ERROR:**
|
|
810
|
+
|
|
811
|
+
Cannot establish connection to the daemon.
|
|
812
|
+
|
|
813
|
+
**Common causes:**
|
|
814
|
+
- Port is blocked by firewall
|
|
815
|
+
- Daemon crashed after starting
|
|
816
|
+
- Incorrect host/port configuration
|
|
817
|
+
|
|
818
|
+
**Resolution:**
|
|
819
|
+
1. Verify daemon is running: `limps status-server`
|
|
820
|
+
2. Check firewall settings for port 4269
|
|
821
|
+
3. Try `curl http://127.0.0.1:4269/health` manually
|
|
822
|
+
4. Check daemon logs: `limps start --foreground`
|
|
823
|
+
|
|
824
|
+
### Stale PID Files
|
|
825
|
+
|
|
826
|
+
limps automatically cleans up stale PID files when:
|
|
827
|
+
- Running `limps status-server` (discovers and removes stale files)
|
|
828
|
+
- Running `limps start` (removes stale file for the target port)
|
|
829
|
+
- The daemon shuts down gracefully with `limps stop`
|
|
830
|
+
|
|
831
|
+
If you need to manually clean up PID files:
|
|
832
|
+
|
|
833
|
+
```bash
|
|
834
|
+
# macOS
|
|
835
|
+
rm ~/Library/Application\ Support/limps/pids/limps-*.pid
|
|
836
|
+
|
|
837
|
+
# Linux
|
|
838
|
+
rm ~/.local/share/limps/pids/limps-*.pid
|
|
839
|
+
|
|
840
|
+
# Windows
|
|
841
|
+
del %APPDATA%\limps\pids\limps-*.pid
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
**When to manually clean up:**
|
|
845
|
+
- After a system crash or forced shutdown
|
|
846
|
+
- If `limps start` reports a daemon is running but it's not
|
|
847
|
+
- Before uninstalling limps
|
|
848
|
+
|
|
849
|
+
### Multiple Daemons Conflict
|
|
850
|
+
|
|
851
|
+
If you accidentally try to start a second daemon on the same port:
|
|
852
|
+
|
|
853
|
+
```bash
|
|
854
|
+
limps start
|
|
855
|
+
# Error: limps daemon already running (PID 12345 on 127.0.0.1:4269). Run 'limps stop' first.
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
This is expected behavior — limps prevents multiple daemons on the same port using PID-based locking.
|
|
859
|
+
|
|
860
|
+
**Resolution:**
|
|
861
|
+
1. **Check all running daemons**: `limps status-server`
|
|
862
|
+
2. **Stop the existing daemon**: `limps stop`
|
|
863
|
+
3. **Or start on a different port**: `limps start --port 8080`
|
|
864
|
+
|
|
865
|
+
### Debugging Connection Issues
|
|
866
|
+
|
|
867
|
+
If MCP clients can't connect to the daemon, verify connectivity step by step:
|
|
868
|
+
|
|
869
|
+
**1. Check daemon status:**
|
|
870
|
+
|
|
871
|
+
```bash
|
|
872
|
+
limps status-server
|
|
873
|
+
# Should show daemon running with healthy status
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
**2. Verify health endpoint:**
|
|
877
|
+
|
|
878
|
+
```bash
|
|
879
|
+
curl http://127.0.0.1:4269/health
|
|
880
|
+
# Should return JSON with status "ok"
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
**3. Verify MCP endpoint:**
|
|
884
|
+
|
|
885
|
+
```bash
|
|
886
|
+
curl -X POST http://127.0.0.1:4269/mcp \
|
|
887
|
+
-H "Content-Type: application/json" \
|
|
888
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}}}'
|
|
889
|
+
# Should return MCP initialize response
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
**4. Enable debug logging:**
|
|
893
|
+
|
|
894
|
+
```bash
|
|
895
|
+
DEBUG=1 limps start --foreground
|
|
896
|
+
# Watch for connection attempts and errors
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
**5. Check MCP client config:**
|
|
900
|
+
|
|
901
|
+
Ensure the URL in your client config matches the daemon:
|
|
902
|
+
|
|
903
|
+
```json
|
|
904
|
+
{
|
|
905
|
+
"mcpServers": {
|
|
906
|
+
"limps-planning-myproject": {
|
|
907
|
+
"transport": {
|
|
908
|
+
"type": "http",
|
|
909
|
+
"url": "http://127.0.0.1:4269/mcp"
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
```
|
|
915
|
+
|
|
473
916
|
## MCP Tools
|
|
474
917
|
|
|
475
918
|
limps exposes MCP tools for AI assistants:
|
package/dist/cli/config-cmd.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export declare function resetAll(configPath: string, options?: {
|
|
|
64
64
|
import { type McpClientAdapter, type McpServerConfig } from './mcp-client-adapter.js';
|
|
65
65
|
/**
|
|
66
66
|
* Generate MCP server configuration JSON for a single limps project.
|
|
67
|
-
*
|
|
67
|
+
* Generates stdio or HTTP transport configuration depending on client support.
|
|
68
68
|
*
|
|
69
69
|
* @param adapter - MCP client adapter
|
|
70
70
|
* @param configPath - Path to the limps config file
|
|
@@ -78,7 +78,7 @@ export declare function generateMcpClientConfig(adapter: McpClientAdapter, confi
|
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
80
|
* Generate config for printing.
|
|
81
|
-
*
|
|
81
|
+
* Generates stdio or HTTP transport configuration depending on client support.
|
|
82
82
|
*/
|
|
83
83
|
export declare function generateConfigForPrint(adapter: McpClientAdapter, configPath: string): string;
|
|
84
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/config-cmd.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAEnB,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,EAAE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O,CAAC,CAAC;CACrC,CAsCA;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB5F;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA4BtE;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAoCrF"}
|
package/dist/cli/config-cmd.js
CHANGED
|
@@ -297,10 +297,11 @@ export function resetAll(configPath, options = {}) {
|
|
|
297
297
|
log.push('Run with --force to confirm.');
|
|
298
298
|
return log;
|
|
299
299
|
}
|
|
300
|
+
const httpConfig = getHttpServerConfig(config);
|
|
300
301
|
const dataPath = config.dataPath;
|
|
301
302
|
// Stop running daemon
|
|
302
303
|
try {
|
|
303
|
-
const pidFilePath = getPidFilePath(
|
|
304
|
+
const pidFilePath = getPidFilePath(httpConfig.port);
|
|
304
305
|
const daemon = getRunningDaemon(pidFilePath);
|
|
305
306
|
if (daemon) {
|
|
306
307
|
try {
|
|
@@ -328,7 +329,7 @@ export function resetAll(configPath, options = {}) {
|
|
|
328
329
|
}
|
|
329
330
|
/**
|
|
330
331
|
* Generate MCP server configuration JSON for a single limps project.
|
|
331
|
-
*
|
|
332
|
+
* Generates stdio or HTTP transport configuration depending on client support.
|
|
332
333
|
*
|
|
333
334
|
* @param adapter - MCP client adapter
|
|
334
335
|
* @param configPath - Path to the limps config file
|
|
@@ -343,12 +344,12 @@ export function generateMcpClientConfig(adapter, configPath) {
|
|
|
343
344
|
const parentDir = basename(dirname(configPath));
|
|
344
345
|
const projectDir = parentDir === '.limps' ? basename(dirname(dirname(configPath))) : parentDir;
|
|
345
346
|
const serverName = `limps-planning-${projectDir}`;
|
|
346
|
-
// Load
|
|
347
|
+
// Load server config for HTTP clients
|
|
347
348
|
const config = loadConfig(configPath);
|
|
348
349
|
const httpConfig = getHttpServerConfig(config);
|
|
349
|
-
// Build servers configuration (
|
|
350
|
+
// Build servers configuration (adapter determines stdio vs HTTP)
|
|
350
351
|
const servers = {
|
|
351
|
-
[serverName]: adapter.
|
|
352
|
+
[serverName]: adapter.createServerConfig(configPath, httpConfig.host, httpConfig.port),
|
|
352
353
|
};
|
|
353
354
|
// Build full config structure
|
|
354
355
|
const serversKey = adapter.getServersKey();
|
|
@@ -369,7 +370,7 @@ export function generateMcpClientConfig(adapter, configPath) {
|
|
|
369
370
|
}
|
|
370
371
|
/**
|
|
371
372
|
* Generate config for printing.
|
|
372
|
-
*
|
|
373
|
+
* Generates stdio or HTTP transport configuration depending on client support.
|
|
373
374
|
*/
|
|
374
375
|
export function generateConfigForPrint(adapter, configPath) {
|
|
375
376
|
const { fullConfig, serversKey } = generateMcpClientConfig(adapter, configPath);
|