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/mcpSolving Four Context Gaps
Every long AI conversation suffers from these structural problems. Context-First MCP provides dedicated tools for each one.
recap_conversation
Analyzes conversation history to extract hidden intents, key decisions, and produces a consolidated state summary. Prevents context degradation over long conversations.
detect_conflicts
Compares new user input against established ground truth. Detects contradictions, changed requirements, and shifted assumptions before they cause problems.
check_ambiguity
Analyzes requirements for underspecification. Returns clarifying questions and identifies vague language, undefined criteria, and missing edge cases.
verify_execution
Validates that tool outputs actually achieved the stated goal. Checks for silent errors, partial completion, and goal-output alignment.
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.
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.
discover_tools
Describe what you need in natural language. Semantic routing returns only relevant tools, reducing context bloat by up to 98%.
quarantine_context / merge_quarantine
Isolate sub-tasks in memory silos. Prevents technical noise from polluting primary conversation intent.
entropy_monitor
Proxy entropy metrics detect confusion spikes in model output. Triggers adaptive context reset when drift is detected.
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.
probe_internal_state
5 proxy activation signals detect likely false claims without model internals. Classifies each claim as likely_true, uncertain, or likely_false.
detect_truth_direction
4-feature truth vector analysis flags deviant claims that diverge significantly from population baselines.
ncb_check
5 perturbation types test whether knowledge is genuine or surface-level pattern matching. Returns robust/brittle/mixed verdict.
check_logical_consistency
Applies contrapositive, negation, generalization, specialization, and transitive checks to verify structural soundness.
verify_first
5-dimension verification: factual accuracy, internal consistency, source verifiability, logical soundness, and completeness.
ioe_self_correct
5-metric confidence evaluation with conditional self-correction. Accepts, corrects, or escalates based on calibrated thresholds.
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.
MCP-Zero: Tool Discovery via Self-Routing
arXiv:2506.01056Semantic routing for MCP tool discovery. Reduces context bloat by matching natural language queries to tool capabilities.
ERGO: Entropy-Regulated Generative Orchestration
arXiv:2510.14077Proxy entropy metrics to detect confusion and drift in LLM output. Triggers adaptive context resets.
RLAAR: Reinforcement Learning for Abstention
arXiv:2510.18731Teaches models when to abstain rather than hallucinate. Multi-dimensional confidence scoring.
ScaleMCP: Scaling Model Context Protocol
arXiv:2505.06416Addresses context window scalability with quarantine zones, hierarchical state management, and TTL-based memory.
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"
}
}
}