mcplens
Debug AI agents by looking at what they actually did: a transparent MCP stdio proxy that records, and an offline audit that finds the loops.
$ mcplens proxy --out session.ndjson -- python server.py # drop-in: relays untouched, records
$ mcplens analyze session.ndjson
frames 22, tool calls 11, 21.0s
[WARN] repeated-calls (search) L6-L16
search called 6 times with identical arguments ({"query": "config.toml"}…)
[WARN] ping-pong (search) L19-L25
search <-> read_file alternated 4 times without progress
[WARN] unanswered (read_file) L18
read_file was called but no response ever arrived — server hung?
Commands
mcplens proxy --out <trace> -- <server cmd> # drop-in stdio server; records every frame
mcplens analyze <trace> [--json] # repeats, ping-pong, unanswered, grouped errors
mcplens session <transcript-jsonl> # Claude Code / Codex saved transcripts (autodetected)
mcplens demo [dir] # synthetic looping-agent trace to try everything
- proxy: the client spawns mcplens instead of the real server; mcplens spawns the real one and relays every line untouched (newline-delimited JSON-RPC — the MCP stdio framing; both protocol eras pass). Its own logs go to stderr — never stdout, per the spec. Recordings are NDJSON with directions.
- analyze: repeated calls (identical tool+args, N times), near-repeats within a window, ping-pong alternation, unanswered calls, tool errors grouped per tool with samples and line ranges.
--json, exit 1 on warns. - session: the same engine over
~/.claude/projects/<dir>/*.jsonl(tool_use/tool_result blocks, usage tokens, synthetic lines skipped, api-error markers) and~/.codex/sessions/**/rollout-*.jsonl(function_call/function_call_output joined by call_id, cumulative token_count diffed). Formats autodetect; 100+ MB transcripts audit in seconds (streamed). Token totals from the transcript's own usage fields.
Python 3.11+, stdlib only — no MCP SDK dependency: a transparent tracer doesn't need one, and neither do the transcripts.
Install: pip install agent-mcplens — or from this repo:
pip install "git+https://github.com/juzorei/mcplens#subdirectory=tools/mcplens"
The companion agent skill lives in skills/agent-wire-audit: record → analyze → fix → prove with a before/after trace. Skills: npx skills add juzorei/mcplens.
Metadata
Release files for agent-mcplens 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_mcplens-0.1.0.tar.gz | 15.8 kB | With provenance | Details for agent_mcplens-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_mcplens-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agent_mcplens-0.1.0-py3-none-any.whl |
Total release size: 30.5 kB
Release files / agent_mcplens-0.1.0.tar.gz
| Download URL | agent_mcplens-0.1.0.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e8deda7fa38ecbb9541f9827f361a9db81610b0acd990fc73be4d73aa38d8c0
|
|
BLAKE2b-256 checksum How to use checksums |
949cf5a6f90441a4b830718b4c6a73b6d1bf90977722e69efc2c5447c359782c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logRelease files / agent_mcplens-0.1.0-py3-none-any.whl
| Download URL | agent_mcplens-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9f434c08a9bb48f75976857d839bda42dc05e6d8668e2baf46ddb98ee7c0f5c
|
|
BLAKE2b-256 checksum How to use checksums |
7badcd46608621de069bcf7b5d73ad27318f23dde8ad266bc678d7271954d3cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logSecurity for agent-mcplens 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agent_mcplens-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.