mcp-context-inspector
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-context-inspectorshow me the context timeline for session abc-123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-context-inspector
A drop-in MCP server + execution-metrics recorder for any tool-calling
agent. Point your agent's loop at record_session(prompt, model_id, loop_result) after each run, and this gives you, for free:
A real MCP server (Streamable HTTP) any MCP client can connect to — Claude Desktop, Cursor, your own chat UI — exposing 7 read-only tools over session history, cost, token/tool metrics, and...
The Context Window Explorer — full transparency into exactly what entered the model's context window, block by block, with honest (explicitly-labeled-estimated) token counts, a proportional segmented bar, and a click-to-expand detail panel per block:

(screenshot from the reference chat UI this was built alongside —
sre-investigation-agent; the panel above is what any MCP client gets once it queriesget_context_timeline.)
Most agent observability tools re-show you data your own UI already displayed. This one shows you something you can't normally see at all: system prompt vs. tool specs vs. reasoning vs. tool call/result vs. final answer, in the order they actually entered context, with a running token total against the model's real context window — and which of those blocks are ever visible to the end user vs. invisible overhead.
Install
uv add mcp-context-inspector # or: pip install mcp-context-inspector
# while co-developing locally against an editable checkout:
uv add --editable ../mcp-context-inspectorRelated MCP server: ai-usage-metrics-mcp
Wire it into your agent
from metrics import store
session_id = store.record_session(prompt, model_id, loop_result)loop_result is whatever your agent loop returns — this package only
needs it to look like:
{
"trace": [{"tool": "...", "args": {...}, "status": "ok"}, ...],
"turns": [{"input_tokens": int, "output_tokens": int, "latency_ms": int}, ...],
"input_tokens": int, "output_tokens": int, "total_tokens": int, "latency_ms": int,
"context_blocks": [ # optional — omit and you just lose the Explorer, nothing crashes
{"category": "system", "label": "...", "char_count": int, "token_estimate": int, "turn_n": int | None},
...
],
}context_blocks categories: system, tools, user, reasoning,
thinking, tool_call, tool_result (optionally carries a "status"
key for color-coding failures), answer.
Run the server
uv run python -m mcp_server.serverNo MCP_AUTH_TOKEN set → generates and prints one on startup, same
trust model as a Jupyter server's printed token. Set it yourself for a
stable value across restarts. Point any MCP client at
http://127.0.0.1:8787/mcp with Authorization: Bearer <token>.
Storage backends
STORAGE_BACKEND=sqlite (default, local dev — data/metrics.db) or
STORAGE_BACKEND=dynamodb (set METRICS_TABLE/AWS_REGION) — same
function signatures either way, callers never know which is active.
The 7 MCP tools
get_session_metrics, get_token_breakdown, get_tool_metrics,
get_agent_trace, get_cost_estimate, get_recent_sessions,
get_context_timeline. Plain REST equivalents are also exposed under
/api/* — a curl-friendly debugging alternative, calling the same
underlying metrics/store.py functions.
Related repos
sre-investigation-agent —
the reference chat UI + Bedrock agent this package was extracted from
and is developed alongside.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP-native agent evaluation and observability server. Log traces, evaluate output quality with 12 built-in rules (PII detection, prompt injection, cost thresholds), and track agent costs. Real-time dashboard, OTel-compatible spans. Self-hosted, MIT licensed.93467MIT
- Alicense-qualityDmaintenanceA MCP server for tracking AI usage metrics and structured logs across applications. Monitor model calls, analyze usage patterns, track costs, and debug AI interactions.10MIT
- AlicenseAqualityBmaintenanceAn MCP server that provides cost and reliability observability for LLM and agent workflows. It records model calls and allows querying and aggregating telemetry data through MCP tools.6MIT
- Alicense-qualityAmaintenanceAn MCP server that gives AI agents observability over their own tool calls, enabling auditing, cost tracking, latency analysis, and alerting.MIT
Related MCP Connectors
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sohaibsohail98/mcp-context-inspector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server