Context Rot Detection
@milos-product-maker
About Context Rot Detection
Context Rot Detection & Healing — gives AI agents self-awareness about their cognitive state by analyzing token utilization, quality degradation, and session fatigue. Returns health scores (0-100), model-specific degradation curves for 15+ models, lost-in-the-middle risk scoring,
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"context-rot-detection": {
"command": "npx",
"args": [
"-y",
"context-rot-detection"
],
"env": {
"HEALTH_HISTORY_DB": "./health.db"
}
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Context Rot Detection?
Context Rot Detection is an MCP service that gives AI agents real-time visibility into their own cognitive health. It measures performance degradation as the context window fills up, providing a health score (0–100) based on token utilization, retrieval accuracy, and session fatigue. It is designed for developers building long-running production agent systems.
How to use Context Rot Detection?
Install via npx (zero install) or npm global install. Configure as an MCP client tool for Claude Code or Claude Desktop, or run with Docker. Use the check_my_health tool periodically to analyze the current context window health, passing required token count and optional parameters.
Key features of Context Rot Detection
- Health score (0–100) based on token utilization, retrieval accuracy, and session fatigue
- Model-specific degradation curves for 15+ curated models (Claude, GPT, Gemini, o-series)
- Auto-resolves any HuggingFace model, caching context window in SQLite
- Lost-in-the-middle risk scoring based on Stanford research
- Actionable recovery recommendations (compact context, offload, checkpoint)
- Per-agent health history tracking and service-wide utilization statistics
Use cases of Context Rot Detection
- Monitoring real-time cognitive health of long-running AI agents
- Detecting context rot before critical decisions or actions
- Analyzing per-agent health trends and service-wide degradation patterns
- Providing actionable recommendations to mitigate quality loss
FAQ from Context Rot Detection
What signals make up the health score?
The health score is a weighted composite of token utilization quality (40%), retrieval accuracy (25%), tool-call burden (20%), and session length (15%).
How are model-specific degradation curves determined?
Curves are derived from empirical research (Chroma, Stanford, Redis) and are provided for 15+ curated models. Any HuggingFace model can be auto-resolved by fetching its config.json to extract context window size.
What data is stored and where?
Health history is stored in a SQLite database configured via the HEALTH_HISTORY_DB environment variable (defaults to :memory:). The server caches HuggingFace model lookups in the same database.
Does the server require network access?
Yes, for HuggingFace model auto-resolution it fetches config.json from the HuggingFace repo. If that fails, it falls back to conservative defaults. Local model detection does not require network.
What transports and authentication are supported?
The server uses stdio transport (standard MCP). There is no built-in authentication; it is intended to be invoked by MCP clients like Claude Desktop or Claude Code.
More Other MCP servers
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
🪟 Windows-MCP
CursorTouchMCP Server for Computer Use in Windows
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Mcp
browsermcpBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
ghidraMCP
LaurieWiredMCP Server for Ghidra
Comments