MC

MCP Server for Human-in-the-Loop Feedback

Enable human-in-the-loop feedback with an MCP server for tools like Cline and Cursor, simplifying setup and workflow integration.

Quick Install
npx -y @mrexodia/user-feedback-mcp

Overview

This MCP (Model Context Protocol) server provides a small HTTP service to capture, route, and persist human-in-the-loop (HITL) feedback for model-driven tooling. It acts as a centralized endpoint for tools like Cline and Cursor to submit contextual corrections, judgments, or annotations about model outputs. The server normalizes incoming feedback, associates it with session and model metadata, and forwards it to configured sinks (databases, webhooks, or queues) for downstream processing and model training pipelines.

Using an MCP server simplifies the integration between interactive developer tools and ML improvement workflows: instead of wiring each client to a different storage or training pipeline, tools post to a single MCP endpoint and rely on server-side routing, filtering, and enrichment. This reduces client complexity, centralizes access control and auditing, and enables consistent data schemas for labeling, triage, and active learning.

Features

  • Lightweight HTTP API for submitting and querying feedback
  • Standardized feedback schema (context, user/session, model metadata, label)
  • Pluggable sinks: database (SQLite/Postgres), webhooks, message queues
  • Configurable routing and enrichment (add tags, sampling, deduplication)
  • Authentication and simple API key support
  • Basic UI or CLI for inspection and manual triage (optional)
  • Support for batching and asynchronous processing for high throughput

Installation / Configuration

Clone the repository and run locally, or use Docker for a quick start.

Local (Node.js example)

git clone https://github.com/mrexodia/user-feedback-mcp.git
cd user-feedback-mcp
# install dependencies (Node.js)
npm install

# create .env based on .env.example then run migrations
cp .env.example .env
npm run migrate

# start in development
npm run dev
# or production
npm start

Docker Compose

version: "3.8"
services:
  mcp:
    image: mrexodia/user-feedback-mcp:latest
    ports:
      - "8080:8080"
    env_file:
      - .env
    depends_on:
      - db
  db:
    image: postgres:15
    environment:
      POSTGRES_USER: mcp
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: mcp
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  pgdata:

Run:

docker-compose up -d

Sample .env

PORT=8080
DATABASE_URL=postgres://mcp:secret@db:5432/mcp
API_KEY=your-secret-api-key
WEBHOOK_URL=https://hooks.example.com/feedback
LOG_LEVEL=info

API key based auth is enabled by default; set API_KEY to a secure value or integrate with your identity provider.

API Reference (examples)

Submit feedback

POST /api/v1/feedback
Authorization: Bearer <API_KEY>
Content-Type: application/json

Body (JSON)

{
  "client": "cline",
  "session_id": "sess-123",
  "user_id": "[email protected]",
  "model": {"name": "gpt-4.1", "version": "2026-04-01"},
  "input": "Summarize the following...",
  "output": "Bad summary text",
  "label": {"type": "correction", "value": "Better summary text"},
  "metadata": {"cursor_position": 412, "file": "README.md"}
}

Response:

  • 202 Accepted — queued for processing
  • 400 Bad Request — schema validation failed
  • 401 Unauthorized — invalid API key

Query feedback

GET /api/v1/feedback?client=cline&limit=50
Authorization: Bearer <API_KEY>

Table: core feedback fields

FieldTypeDescription
clientstringOrigin tool (e.g., cline, cursor)
session_idstringSession or workspace identifier
user_idstringUser performing the action
modelobjectModel name and version used to produce output
inputstringInput / prompt context
outputstringModel output being annotated
labelobjectHuman annotation (correction, rating, tag)
metadataobjectArbitrary key/value context

Available Tools / Resources

  • Cline integration: submit feedback after command runs or when users annotate output; set the MCP endpoint as the feedback sink in Cline’s config.
  • Cursor integration: bind an editor command or keybinding to send selection + context to the MCP endpoint for correction or review.
  • Webhooks: forward accepted feedback to downstream systems (labeling UI, training pipelines, Slack notifications).
  • Storage adapters: SQLite for local testing, Postgres for production, and S3/MinIO for storing large artifacts.
  • Example client snippets (curl, JavaScript, Python) are included in the repo under /clients.

Use Cases

  • Model improvement loop: Collect corrected outputs and send periodic batches to retraining jobs. Example: users fix model-generated code in Cursor; MCP stores corrections with file context for active learning.
  • Quality assurance and triage: Route low-confidence or flagged responses to a human QA workflow via webhook. Example: Cline detects hallucination heuristics and posts to MCP which forwards to a triage UI.
  • Policy enforcement & moderation: Capture user reports and attach model metadata for audit trails. Example: security team uses stored feedback to verify whether model outputs violated policy.
  • Annotation & labeling: Provide a single ingestion point for crowd labeling or internal annotators. Example: a labeling team uses the MCP UI/CLI to confirm or re-label model outputs; results are written to Postgres for downstream ETL.

If you are integrating this server into your product, start by configuring your client tools to POST feedback to /api/v1/feedback with appropriate API credentials, then set up one or more sinks (database, webhook) to process and persist the incoming data. The repo includes sample configs and client snippets to accelerate that integration.