MCP Lens
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.
MCP Lens (v2.6.0)
MCP Lens (mcp-lens) is a zero-dependency Python 3.10+ traffic sniffer, BPE token-weight schema auditor, JSON Schema minifier, Dual-Theme Web Cockpit (127.0.0.1:8109), and stdio JSON-RPC 2.0 MCP server for the Model Context Protocol (MCP). It wraps any child MCP stdio process transparently while streaming JSON-RPC 2.0 frames over Server-Sent Events (/api/events/stream) with zero external CDN requests and hardened loopback security.
Zoth Studio v2 Route: https://zoth.nullai.tech/tools/mcp-lens
Repository: https://github.com/1nc0gn30/mcp-lens
Default Loopback Endpoint:
http://127.0.0.1:8109
What It Does
Large MCP tool registries can consume thousands of context-window tokens per agent turn before any tool runs. mcp-lens instruments MCP servers without modifying client or server source code:
Transparent Stdio Proxy (
StdioProxy): Wraps any child MCP command (mcp-lens proxy -- <cmd>), tapping inbound and outbound newline-delimited JSON-RPC 2.0 frames into a thread-safe ring buffer (TrafficStore) with a bounded worker queue (queue.Queue(maxsize=256)) for remote forwarding.BPE Token Estimator (
MCPTrafficAnalyzer): Estimates token overhead acrossinitialize,tools/list,tools/call,resources/read, andprompts/getframes.Lossless Schema Minifier (
SchemaMinifier): Strips redundant schema boilerplate, verbose examples, and multi-paragraph docstrings while preserving structural JSON Schema constraints (type,properties,required,enum).Interactive Tool Replay (
/api/replay): Replays MCPtools/callpayloads directly against the local:8109daemon (recording inbound/outbound frames live) with deterministic in-browser fallback when offline.Real Stdio MCP Server (
mcp-lens mcp): Exposes 6 JSON-RPC 2.0 tools over stdio (mcp_audit_schema_tokens,mcp_minify_schema,mcp_parse_frame,mcp_get_traffic,mcp_replay_tool,mcp_diagnostics).Dual-Theme Zero-Egress Web Cockpit: Full Editorial Ivory Light (
#FAF8F3) and Obsidian Gold Dark (#08080B) themes with?theme=light|dark,?embed=1, andpostMessagesynchronization, zero external CDN requests, and strict DOMtextContentXSS safety.
Related MCP server: mcp-production-mastery
Architecture
MCP Host Client (Claude Code / Cursor / ZothOS)
│ JSON-RPC 2.0 over stdio
▼
mcp-lens StdioProxy ──► TrafficStore / bounded queue ──► MCPLensServer (127.0.0.1:8109)
│ ├── Strict Host/Origin 403 + CSP
▼ ├── MCPTrafficAnalyzer + SchemaMinifier
Child MCP Server └── SSE /api/events/stream + Dual-Theme UIQuickstart
git clone https://github.com/1nc0gn30/mcp-lens.git
cd mcp-lens
# Launch the Web Cockpit & Telemetry Server on 127.0.0.1:8109 (both forms supported)
python3 server.py --port 8109
python3 server.py serve --port 8109
# Or via the CLI wrapper
./bin/mcp-lens serve --host 127.0.0.1 --port 8109Open http://127.0.0.1:8109 in your browser.
CLI, Braille TUI & Stdio MCP Commands
# Start standalone Web Cockpit & REST/SSE server
mcp-lens serve --host 127.0.0.1 --port 8109
# Wrap a child MCP server transparently (embedded cockpit on :8109)
mcp-lens proxy --port 8109 -- npx -y @modelcontextprotocol/server-filesystem /tmp
# Shorthand proxy (headless stdio forwarding to an existing :8109 daemon)
mcp-lens --no-server -- python3 my_mcp_server.py
# Run real stdio JSON-RPC 2.0 MCP server (6 tools)
mcp-lens mcp
# Launch desktop workstation (Electron wrapper or local browser)
mcp-lens desktop
# Inspect live daemon status and token savings
mcp-lens --status
mcp-lens --json
mcp-lens status --port 8109 --json
# Live Unicode U+2800 Braille TUI telemetry inspector
mcp-lens-tui --status
mcp-lens-tui --json --benchmark
# Run internal parser, BPE estimator, and schema minifier diagnostics
mcp-lens testStdio MCP Tools (mcp-lens mcp)
Tool | Purpose |
| Compute raw vs minified BPE token weights and savings across one or more tool schemas |
| Minify an MCP tool schema while preserving |
| Parse and classify a raw JSON-RPC 2.0 frame string with byte size and token count |
| Fetch recent captured frames from |
| Replay a |
| Report MCP Lens |
REST API & Security Invariants
All endpoints enforce strict loopback Host validation (127.0.0.1[:port], localhost[:port], [::1][:port]), exact-port browser Origin allowlisting (:<activePort> and :3000) across GET/HEAD/POST/OPTIONS, a 1 MiB (1,048,576 B) POST body limit (413), HTTP/1.1 Transfer-Encoding: chunked support, 400 on malformed JSON or invalid ?limit=, disabled directory listing (404), stripped Python version (Server: MCPLens/2.6), and all 4 security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Content-Security-Policy).
Method | Endpoint | Description |
|
| Dual-theme Web Cockpit ( |
|
| Service health, dynamic bound port, version ( |
|
| Frame count, bytes streamed, |
|
| Recent captured JSON-RPC 2.0 frames ( |
|
| Per-tool token audit ( |
|
| Real-time Server-Sent Events (SSE) frame stream |
|
| Minify an MCP tool JSON schema ( |
|
| Replay a |
|
| Ingest a tapped JSON-RPC frame ( |
Testing & Verification
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=src python3 -m pytest -v
./bin/mcp-lens --version
./bin/mcp-lens test
./bin/mcp-lens --json
./bin/mcp-lens-tui --jsonSupport & License
100% free and open-source software under the MIT License (zero paywalls or telemetry).
Buy Us a Coffee (Stripe): https://buy.stripe.com/3cIfZg27PdKo2D64Ocfw40X
Solana Tip Address:
GG2eQbVh8ut1BK6j1A2tz7pSySdLpD38BgyEhGcxdXoK(solana:GG2eQbVh8ut1BK6j1A2tz7pSySdLpD38BgyEhGcxdXoK)Engineered by Neal Frazier Tech (@1nc0gn30 • https://github.com/1nc0gn30/mcp-lens) • NullAI Platform (https://nullai.tech)
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
Free, no-key MCP server: token estimates, JSON Schema conversion, MCP configs, tool search.
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
Free MCP debugging tools for AI agents and developers. Diagnose failed API and MCP tool calls, identify HTTP errors, validate tool arguments against supported JSON Schema rules, and get actionable troubleshooting recommendations.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables LLMs to inspect and test other MCP servers by listing and calling their tools, reading resources, and getting prompts. Supports stdio, SSE, and HTTP transports for both local and remote MCP server inspection.76 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to discover and execute operational tools such as database mutations and system diagnostics over stdio, with deterministic structured outputs and Langfuse observability.ISC
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude Code, Codex, and Cursor to debug failing traces, sessions, and exceptions, inspect route decisions, prompts, datasets, and metrics, and control token overhead via compact output, file dumps, and selective tool loading. It supports local stdio or HTTP deployment with optional read-only mode for safer observability workflows.-
- AlicenseAqualityBmaintenanceEnables fully offline diagnostics on local inputs: scrubbing secrets from HAR captures, pinpointing PostgreSQL EXPLAIN JSON hotspots, estimating GPU VRAM for local LLM quantizations, and linting mcp.json configs. Runs with zero dependencies over stdio, requiring no build step or external npm packages.41MIT