lilith-platform.live/codebase/@features/api/src/mcp-prospector
2026-05-14 15:38:13 -07:00
..
src feat(mcp-prospector): Add archetype filtering to prospect lists with new filtering logic and API support 2026-05-14 15:38:13 -07:00
bun.lock remove(mcp-prospector): 🔥 Remove MCP Prospector client implementation, logging utilities, and documentation; update dependency lockfile and README 2026-05-12 20:34:44 -07:00
package.json
README.md remove(mcp-prospector): 🔥 Remove MCP Prospector client implementation, logging utilities, and documentation; update dependency lockfile and README 2026-05-12 20:34:44 -07:00
tsconfig.json

quinn-drafts MCP

Feedback loop for the draft-pipeline-claude CoT system. Six tools covering the full iteration cycle: browse drafts → record corrections → analyze patterns → propose prompt edits → apply them → verify with a new draft.

Setup

Registered in .mcp.json on apricot as quinn-drafts. Requires:

QUINN_API_BASE_URL=http://localhost:3030
QUINN_API_TOKEN=<service token>

DRAFT_PIPELINE_PROMPTS_PATH defaults to the prompts.py in @ml/draft-pipeline-claude.


Tools

list_recent_drafts

Browse recent engine drafts to find a draft_id before recording a correction.

list_recent_drafts(handle="+17205982015", limit=10, classification="QUINN_REVIEW")
Param Type Required Default
handle string no (all)
limit number no 20
classification string no (all)

Returns: formatted list of draft IDs, handles, body previews, timestamps.


record_correction

Store Quinn's actual send alongside which CoT step failed. Each correction builds the training corpus.

record_correction(
  draft_id=42,
  quinn_text="Yeah I'm around, what are you thinking?",
  cot_step_failed="CHASE_CHECK",
  reason="draft asked an eager follow-up Q, inverted chase"
)
Param Type Required
draft_id number yes
quinn_text string yes
cot_step_failed string no
reason string no

Valid steps: THREAD_FACTS · QUINN_STATE · THREAD_POSITION · CHASE_CHECK · SANITY_CHECK · VOICE_REGISTER


list_correction_patterns

Aggregate corrections by CoT step. Shows count + 3 recent examples per step.

list_correction_patterns(since="2026-05-01T00:00:00Z")
Param Type Required
since ISO datetime no

Use this to decide which step to revise next.


propose_prompt_revision

Ask Claude to suggest a concrete edit to a failing step's axis bullet in COT_SYSTEM_PROMPT. Does not apply the change — review first.

propose_prompt_revision(cot_step="CHASE_CHECK", since="2026-05-01T00:00:00Z")
Param Type Required
cot_step string yes
since ISO datetime no

Returns the suggested new axis text + instructions to apply via apply_prompt_revision.


apply_prompt_revision

Write the suggested axis text to prompts.py. Replaces the bullet for the given step in COT_SYSTEM_PROMPT. Run a smoke test after applying.

apply_prompt_revision(
  cot_step="CHASE_CHECK",
  new_axis_text="Never ask a follow-up question if the prospect hasn't answered a prior question. If they just sent an inbound, ack briefly — leave the next move to them."
)
Param Type Required
cot_step string yes
new_axis_text string yes

Smoke-test after: use draft_message with a representative request to verify the revised step catches the failure.


draft_message

Run the full CoT pipeline for a prospect and return the draft + reasoning brief. Useful for verifying a prompt revision fixed the failure before committing.

draft_message(request={
  "prospect_handle": "+17205982015",
  "thread_messages": [{"from": "them", "ts": "...", "text": "hey"}],
  "thread_facts": {"name": null, "city": null, ...},
  "quinn_state": {"now_ts": "...", "current_city": "Berkeley", ...},
  "recent_quinn_outbound_samples": ["Hiiii!", "Yeah I'm free"],
  "playbook_state": "cold_qualifying"
})

Returns: draft text, position, chase, brief sentence, any flags/fails.


Iteration loop

list_recent_drafts          → find draft_id
record_correction           → log Quinn's fix + which step failed
list_correction_patterns    → confirm step has ≥3 failures
propose_prompt_revision     → get Claude's suggested edit
apply_prompt_revision       → write it to prompts.py
draft_message               → smoke-test with a representative request
record_correction           → if the new draft is correct, no correction needed

Repeat until list_correction_patterns shows the step's count stops growing.