CntXRay
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CntXRay (cntxray)
AI Context DevTools for Coding Agents.
See what your coding agent really loads before your first prompt — across Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI, Antigravity, Windsurf, Cline and MCP servers — measured against the agent's own session transcripts, gated in CI, and fixed with reversible rule → skill splits. Local, read-only by default, zero runtime dependencies.
Key Features
Measured, not guessed (Claude Code): Reads this workspace's own Claude Code transcripts (read-only) for API-reported numbers: median turn-1 prompt size, real prompt-cache hit ratio, and exactly which MCP servers were called. Shows what the agent injected before its first reply — built-in tool schemas, system prompt, CLAUDE.md/memory files, each
SessionStarthook (attributed to its plugin), skill listing, MCP server instructions, deferred tool names — and projects session cost from the measured prompt, not only from your config.Agent lenses:
all,claude,cursor,copilot,codex,gemini,antigravity,windsurf,cline. Each lens follows that agent's documented loading rules: Claude'sCLAUDE.md/CLAUDE.local.md/.claude/rules(withpaths:), ancestor files, auto-memory and AGENTS.md fallback; Cursor.mdcmodes; CopilotapplyToinstructions; Codex's 32 KiB AGENTS.md cap; Gemini CLI@importsandcontext.fileName; Antigravity's 24 KB cap, trigger rules and 20k budget; Windsurf/Devin trigger modes and char caps; Cline.clinerules/.cline/rules. Per-lens caps are applied per lens, so the same AGENTS.md can cost differently for each agent.Claude Code aware: installed plugins (
enabledPlugins, skills/commands/agents descriptions, context-injecting hooks, plugin MCP servers),~/.claude.jsonuser/local MCP servers, and MCP tool search (ENABLE_TOOL_SEARCH,alwaysLoad): deferred schemas count as tool names only.Live MCP schema introspection: Probes stdio MCP servers (
initialize+tools/list) for exact tool schema weights. Servers declared inside a workspace are never started unless you pass--trust-workspace.Findings no one else reports:
RULE_IGNORED(rule files an agent silently skips: Cursor.md, Antigravity rules without a valid trigger),RULE_BUDGET_EXCEEDED(Antigravity's 20k rule budget),RULE_CONFLICT(rule files loaded together that contradict each other: package manager, test runner, quotes, semicolons, indentation, reply language),VOLATILE_RULE_CONTENT(dates/status lines that churn the prompt cache),CACHE_HIT_LOW(from real transcripts),CROSS_AGENT_CONFLICT(different agents told different conventions), plusRULE_TRUNCATED,INSTRUCTION_OVERLOAD,ZERO_SIGNAL_FLUFF,SKILL_TRIGGER_COLLISION,MCP_TOOL_COLLISION,SECRET_IN_CONTEXT,STACK_MISMATCH,UNUSED_HIGH_COST_ITEMand more.Context regression gate for PRs:
--baselinecompares against the PR base and--max-increasefails the build when a PR bloats agent context; the bundled GitHub Action posts one sticky PR comment with the per-item delta (renames shown as one row), annotates the offending rule lines (--annotations), and only fails on findings the PR introduces. Per-lens budgets live in.cntxray.json("budgets": { "claude": 4000 }).Reversible rule → skill splitter: Moves bloated
##sections into.claude/skills/or.agents/skills/; revert refuses to overwrite edits made after the split.Web UI, MCP server, i18n:
cntxray uidashboard,cntxray mcp(cntxray_scan,cntxray_audit,cntxray_split_rule,cntxray_save_profile) so agents can audit their own context, English and Turkish output.
Related MCP server: context-doctor
Quick Start
Requires Node.js 20+. No runtime dependencies.
Install the cntxray command straight from GitHub (builds on install):
npm install -g github:ooemir23/cntxray
cntxray . # run inside any projectOr run once without installing:
npx github:ooemir23/cntxray .Or clone it (or double-click CntXRay.bat on Windows):
git clone https://github.com/ooemir23/cntxray.git
cd cntxray
npm install # also builds dist/
node dist/src/cli.js /path/to/your/projectCommon runs (cntxray = node dist/src/cli.js if you cloned):
cntxray . # all agents, this folder + your global agent configs
cntxray . --agent claude --lang tr # one agent's view, Turkish output
cntxray ui . # interactive dashboard in the browser
cntxray . --no-mcp-probe # faster: don't start any MCP server
cntxray mcp . # run as an MCP server inside your agent
cntxray . --ci --max-tokens 3000 # CI budget gateCLI Options
Flag | Description |
| Start the local interactive Web UI ( |
| Start CntXRay as a stdio MCP server ( |
| Output language ( |
| Agent lens for the report and CI budget ( |
| Skip live stdio MCP |
| Also spawn MCP servers declared inside the workspace ( |
| Custom UI server port (auto-falls back if busy) |
| Start UI server without launching the browser |
| Print full |
| Write standalone offline HTML report |
| Print GitHub-ready Markdown summary and fail on errors/budget overflow |
| Max startup tokens/turn allowed in |
| Session turn multiplier for cost projections (default: |
| Context window for % and compaction math ( |
| Compare against an earlier |
| With |
| Scan only the target workspace |
Exit codes: 0 pass · 1 budget exceeded or (with --baseline) new error findings · 2 invalid arguments or the tool could not run.
GitHub Action
on: pull_request
permissions:
contents: read
pull-requests: write
jobs:
context-budget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ooemir23/cntxray@main
with:
agent: claude
max-increase: 500 # fail if the PR adds >500 startup tokens/turnThe action scans the PR base and head (no MCP probing, so PR code never runs), writes the report to the job summary, and keeps one PR comment up to date.
Privacy
Everything runs locally. Transcript reading is read-only and limited to this workspace's Claude Code project folder plus a substring scan of recent sessions for unused-item detection; nothing is sent anywhere. --no-global skips home-directory configs and transcripts entirely.
Development & Tests
npm run build
npm testLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
Zero-LLM deterministic security auditor for MCP configs, SKILL.md rules, and agent budgets.
Patterns for designing and reviewing AI skills, agents, and multi-agent workflows. Find guidance on context economy, delegation, verification, and tool design; inspect claims, worked examples, maturity labels, and source references. Five read-only tools let agents discover relevant patterns, compare concise cards, read specific sections, and explore relationships. Hosted Streamable HTTP at https://agentic-atlas.dev/mcp/ — no installation, account, or API key required. Browse the atlas at https://agentic-atlas.dev/.
12 read-only MCP tools for AI communication rules, instruction linting & 25-model benchmarks.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables analyzing and optimizing context window token usage by measuring, compressing, and eliminating waste from MCP tool definitions.58 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides MCP tools to profile and optimize LLM conversation context, identifying token waste and applying deterministic fixes to reduce context window usage.1,094 npm3MIT
- AlicenseNot gradedqualityBmaintenanceEnables auditing MCP servers' tools by their estimated context token cost, ranking verbose names, descriptions, and schemas before they consume the agent window. Can run as an MCP tool so agents can budget their own context.1MIT
- AlicenseBqualityBmaintenanceEnables AI coding agents and local LLMs to store and recall project memory, compact verbose logs, look up code symbols, create and rewind workspace snapshots, detect risky commands and loops, pack context optimally, and draft tokens through MCP tools.102Apache 2.0