# ThumbGate

MCP Memory Gateway captures explicit structured feedback from AI coding agents, validates it against a rubric engine, and auto-promotes repeated failures into prevention rules enforced via PreToolUse…

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add rlhf-loop/mcp-memory-gateway-v2

# Browse available tools
npx -y @smithery/cli@latest tool list rlhf-loop/mcp-memory-gateway-v2

# Get full schema for a tool
npx -y @smithery/cli@latest tool get rlhf-loop/mcp-memory-gateway-v2 capture_feedback

# Call a tool
npx -y @smithery/cli@latest tool call rlhf-loop/mcp-memory-gateway-v2 capture_feedback '{}'
```

## Direct MCP Connection

Endpoint: `https://mcp-memory-gateway-v2--rlhf-loop.run.tools`

## Tools (29)

- `capture_feedback` — Capture an up/down signal plus one line of why. Vague feedback is logged, then returned with a clarification prompt ins…
- `feedback_summary` — Get summary of recent feedback
- `feedback_stats` — Get feedback stats and recommendations
- `diagnose_failure` — Diagnose a failed or suspect workflow step using MCP schema, workflow, gate, and approval constraints.
- `list_intents` — List available intent plans and whether each requires human approval in the active profile
- `plan_intent` — Generate an intent execution plan with policy checkpoints
- `start_handoff` — Start a sequential delegation handoff from a delegation-eligible intent plan
- `complete_handoff` — Complete a sequential delegation handoff and record verification outcomes
- `describe_reliability_entity` — Get the definition and state of a business entity (Customer, Revenue, Funnel). Aliased to describe_semantic_entity.
- `get_reliability_rules` — Retrieve active prevention rules and success patterns. Aliased to prevention_rules.
- `capture_memory_feedback` — Capture success/failure feedback to harden future workflows. Aliased to capture_feedback.
- `bootstrap_internal_agent` — Normalize a GitHub/Slack/Linear trigger into startup context, construct a recall pack, prepare a git worktree sandbox, …
- `prevention_rules` — Generate prevention rules from repeated mistake patterns
- `export_dpo_pairs` — Export DPO preference pairs from local memory log
- `export_databricks_bundle` — Export RLHF logs and proof artifacts as a Databricks-ready analytics bundle
- `construct_context_pack` — Construct a bounded context pack from contextfs
- `evaluate_context_pack` — Record evaluation outcome for a context pack
- `context_provenance` — Get recent context/provenance events
- `generate_skill` — Auto-generate Claude skills from repeated feedback patterns. Clusters failure patterns by tags and produces SKILL.md fi…
- `recall` — Recall relevant past feedback, memories, and prevention rules for the current task. Call this at the start of any task …
- `satisfy_gate` — Satisfy a gate condition (e.g., after checking PR threads). Evidence is stored with a 5-minute TTL.
- `gate_stats` — Get gate enforcement statistics -- blocked count, warned count, top gates
- `dashboard` — Get full RLHF dashboard -- approval rate, gate stats, prevention impact, system health
- `commerce_recall` — Recall past feedback filtered by commerce categories (product_recommendation, brand_compliance, sizing, pricing, regula…
- `get_business_metrics` — Retrieve high-level business metrics (Revenue, Conversion, Customers) from the Semantic Layer.
- `describe_semantic_entity` — Get the canonical definition and state of a business entity (Customer, Revenue, Funnel).
- `estimate_uncertainty` — Estimate Bayesian uncertainty for a set of tags based on past feedback.
- `session_handoff` — Write a session handoff primer that auto-captures git state (branch, last 5 commits, modified files), last completed ta…
- `session_primer` — Read the most recent session handoff primer to restore context from the previous session. Call at session start.

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get rlhf-loop/mcp-memory-gateway-v2 <tool-name>
```
