Christian Gick f7f9cfe3d8 Add investigation type and duplicate detection (CF-166 Phase 1)
Enhancements:

1. Investigation Task Type
   - Added 'investigation' to task type enum
   - Migration 013: Updated PostgreSQL constraint
   - Updated TypeScript schemas (task_add, task_list, task_update)
   - Enables tracking research/debugging workflows

2. Duplicate Detection
   - Enhanced task_add to check for similar tasks before creating
   - Uses pgvector semantic search (>70% similarity threshold)
   - Warns about potential duplicates with similarity scores
   - Suggests linking command for related tasks
   - Gracefully handles when embeddings unavailable

Example Output:
```
Created: CF-123
  Title: Fix API rate limiting
  Type: task
  Priority: P2
  Project: CF

⚠️  Similar tasks found:
  - CF-120: Add rate limit monitoring (85% match, in_progress)
  - CF-115: Implement API throttling (72% match, open)

Consider linking with: task link <from> <to> relates_to
```

Benefits:
- Prevents accidental duplicate tasks
- Surfaces related work automatically
- Reduces manual task linking
- Investigation type for research workflows

Files Changed:
- migrations/013_investigation_type.sql (new)
- src/tools/crud.ts (duplicate detection logic)
- src/tools/index.ts (investigation type in enums)

Remaining CF-166 Features (Phase 2):
- Session-aware task context
- Automatic linking within session
- Investigation workflow helper
- Task creation reminders

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-17 08:38:18 +02:00

Task MCP Server

Exposes task management tools via Model Context Protocol. Uses PostgreSQL with pgvector for semantic search.

Requirements

  • SSH tunnel to services: ssh -L 5432:localhost:5432 services -N &
  • PostgreSQL with pgvector on services (CI stack postgres container)
  • CI postgres must be running: ssh services "cd /opt/docker/ci && docker compose up -d postgres"

Configuration

Add to ~/.claude/settings.json under mcpServers:

{
  "task-mcp": {
    "command": "node",
    "args": ["/path/to/task-mcp/dist/index.js"],
    "env": {
      "DB_HOST": "localhost",
      "DB_PORT": "5432",
      "DB_NAME": "agiliton",
      "DB_USER": "agiliton",
      "DB_PASSWORD": "<from /opt/docker/ci/.env>",
      "LLM_API_URL": "https://llm.agiliton.cloud",
      "LLM_API_KEY": "sk-master-..."
    }
  }
}

Tools

Tool Description
task_add Create task with auto-generated ID and embedding
task_list List tasks with filters (project, status, type, priority)
task_show Show task details including checklist and dependencies
task_close Mark task as completed
task_update Update task fields
task_similar Find semantically similar tasks using pgvector
task_context Get related tasks for current work context
task_link Create dependency between tasks
task_checklist_add Add checklist item to task
task_checklist_toggle Toggle checklist item

Build

npm install
npm run build

Development

npm run dev  # Run with tsx (no build)
Description
Session management MCP server
Readme 522 KiB
Languages
TypeScript 73.8%
JavaScript 19.5%
PLpgSQL 6.3%
Shell 0.3%