Fight LLM Context Degradation

A Context Custodian MCP server with 34 tools that keeps your AI conversations on track — from recap and conflict detection to entropy monitoring, context quarantine, verifiable abstention, advanced reasoning paradigms, and hallucination detection with self-verification.

Quick Start

# Run with npx (no install needed)

npx context-first-mcp

# Or use the remote endpoint

https://context-first-mcp.vercel.app/api/mcp

Solving Four Context Gaps

Every long AI conversation suffers from these structural problems. Context-First MCP provides dedicated tools for each one.

Lost in Conversation

recap_conversation

Analyzes conversation history to extract hidden intents, key decisions, and produces a consolidated state summary. Prevents context degradation over long conversations.

Context Clash

detect_conflicts

Compares new user input against established ground truth. Detects contradictions, changed requirements, and shifted assumptions before they cause problems.

Calibration & Trust

check_ambiguity

Analyzes requirements for underspecification. Returns clarifying questions and identifies vague language, undefined criteria, and missing edge cases.

Benchmark vs Reality

verify_execution

Validates that tool outputs actually achieved the stated goal. Checks for silent errors, partial completion, and goal-output alignment.

State Management

get_state / set_state / clear_state

Lock in confirmed facts, decisions, and task status as conversation ground truth. Retrieve or reset state at any time.

History Compression

get_history_summary

Get a compressed conversation history with intent annotations, key decision points, topic progression, and open questions highlighted.

Research-Backed Advanced Features

4 peer-reviewed papers → 5 advanced MCP tools. Layer 2 brings entropy monitoring, tool discovery, context quarantine, and verifiable abstention.

Active Discovery (MCP-Zero)

discover_tools

Describe what you need in natural language. Semantic routing returns only relevant tools, reducing context bloat by up to 98%.

Context Quarantine

quarantine_context / merge_quarantine

Isolate sub-tasks in memory silos. Prevents technical noise from polluting primary conversation intent.

Entropy Detection (ERGO)

entropy_monitor

Proxy entropy metrics detect confusion spikes in model output. Triggers adaptive context reset when drift is detected.

Verifiable Abstention (RLAAR)

abstention_check

Evaluates whether the model has enough verified info to proceed. Abstains with clarifying questions rather than hallucinating.

Truthfulness & Self-Verification

7 research-backed tools for hallucination detection. Layer 5 brings internal state probing, truth direction analysis, neighborhood consistency, logical verification, verify-first checking, IoE self-correction, and iterative self-critique.

Internal State Probing

probe_internal_state

5 proxy activation signals detect likely false claims without model internals. Classifies each claim as likely_true, uncertain, or likely_false.

Truth Direction Detection

detect_truth_direction

4-feature truth vector analysis flags deviant claims that diverge significantly from population baselines.

Neighborhood Consistency (NCB)

ncb_check

5 perturbation types test whether knowledge is genuine or surface-level pattern matching. Returns robust/brittle/mixed verdict.

Logical Consistency

check_logical_consistency

Applies contrapositive, negation, generalization, specialization, and transitive checks to verify structural soundness.

Verify-First Check

verify_first

5-dimension verification: factual accuracy, internal consistency, source verifiability, logical soundness, and completeness.

IoE Self-Correction

ioe_self_correct

5-metric confidence evaluation with conditional self-correction. Accepts, corrects, or escalates based on calibrated thresholds.

Iterative Self-Critique

self_critique

Multi-round critique-improve loop that converges toward quality. Tracks score progression and stops when improvements plateau.

Research Foundations

Layer 2 features are grounded in peer-reviewed research.

Works With Your Client

Claude Desktop / Cursor

{
  "mcpServers": {
    "context-first": {
      "command": "npx",
      "args": ["-y", "context-first-mcp"]
    }
  }
}

VS Code (settings.json)

{
  "mcp": {
    "servers": {
      "context-first": {
        "command": "npx",
        "args": ["-y", "context-first-mcp"]
      }
    }
  }
}

Remote (Streamable HTTP)

{
  "mcpServers": {
    "context-first": {
      "url": "https://context-first-mcp.vercel.app/api/mcp"
    }
  }
}
npm versionlicenseMCP