looplens-mcp
Enables ingestion of events from GitHub repositories, such as commits, issues, and pull requests, for debugging and iteration analysis.
Enables ingestion of events from GitLab repositories, similar to GitHub integration, for debugging and iteration analysis.
Allows importing issue tracking events from Jira to incorporate into debugging sessions.
Allows importing issue tracking events from Linear to incorporate into debugging sessions.
Allows importing error events from Sentry to correlate with debugging iterations and detect failure patterns.
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., "@looplens-mcpAre we stuck in a retry loop?"
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.
LoopLens MCP ๐๐
See the loop. Break the loop.
LoopLens MCP is an iteration observability and loop-detection MCP server for Claude Code and agentic coding workflows.
It is built for a very specific pain point:
You ask the model to fix something. It tries. The fix fails. You ask again. It retries. Same issue. More edits. More noise. ๐ตโ๐ซ
LoopLens turns that messy retry cycle into structured debugging intelligence.
โจ What is LoopLens MCP?
LoopLens is not a memory MCP. LoopLens is not just another logger.
It is a focused debugging intelligence layer that helps AI coding workflows understand:
what has already been tried ๐
what changed between attempts ๐งฉ
which failures keep repeating ๐จ
whether the workflow is converging or thrashing ๐๐
what the next most promising debugging step should be ๐ฏ
Related MCP server: trw-mcp
๐ค Why LoopLens exists
AI coding tools can be amazing on first-pass fixes.
But repeated repair attempts often become chaotic:
same failing command again and again
same files edited repeatedly
same tests still red
new wording, same failure
regressions introduced while fixing something else
retries that look different but are actually the same loop
That is exactly where LoopLens helps.
๐ง Core capabilities
1. Iteration logging
Capture repair/debug attempts across a task.
2. Attempt linking
Detect whether a prompt is:
a new task
a continuation
a retry
a regression check
a strategy branch
3. Loop detection
Identify patterns such as:
identical retry loops
repeated error signatures
command retry loops
file oscillation
validation stagnation
evidence-free retries
regression after partial success
4. Attempt comparison
Compare attempt N vs N-1:
files changed
tools used
commands run
validations changed
hypothesis shifts
outcome shifts
5. Convergence analysis
Estimate whether the workflow is:
converging โ
weakly converging ๐ค
stagnant ๐
diverging ๐
regressing โ ๏ธ
6. Next-fix suggestions
Recommend the best next move:
gather more evidence
isolate root cause
narrow validation
revert harmful change
inspect external signals
stop editing and compare attempts
split task into subproblems
7. Connector observations
LoopLens can ingest signal from:
GitHub / GitLab
CI systems
Sentry
Jira / Linear
test runners
filesystem metadata
other MCP servers
LoopLens is the debugging brain ๐ง Other tools are signal sources ๐ก
๐ก Philosophy
Don't just log the attempt. Understand the iteration.
That means:
structured trajectories instead of flat logs
failure fingerprints instead of noisy raw output
loop diagnosis instead of generic analytics
actionable next-step guidance instead of passive storage
๐ซ Not a memory MCP
LoopLens does not try to become long-term user memory.
It focuses on:
observable debugging events
tool calls
validation results
explicit summaries
failure patterns
retry trajectories
It is built for debugging, evaluation, and improvement of coding workflows.
๐ Example use cases
"Why did the last 3 fixes fail?"
"Are we editing the same files without real progress?"
"Did the failure actually change?"
"Are we stuck in a retry loop?"
"Which attempt got us closest to success?"
"What should Claude try next?"
"Export the last 20 failed repair loops as eval cases."
๐ Quick Start
# Install
uv sync
# Run the MCP server
uv run looplens-mcp๐ Claude Code Integration
Add to ~/.claude/settings.json:
{
"mcpServers": {
"looplens": {
"command": "uv",
"args": ["run", "--directory", "/path/to/looplens-mcp", "looplens-mcp"],
"env": {
"LOOPLENS_LOG_LEVEL": "INFO"
}
}
}
}โ๏ธ Configuration
All settings use the LOOPLENS_ prefix:
Variable | Default | Description |
|
| Base data directory |
|
| SQLite database path |
|
| Log level |
|
| Min repeats to flag a loop |
|
| Sliding window size for detection |
|
| Auto-redact secrets from payloads |
|
| Days before old sessions are pruned |
๐ง MCP Tools Reference
Tool | Description |
| Create a new debug session |
| Get session details |
| List sessions with filters |
| Mark session complete/abandoned |
| Record a single tool event |
| Record multiple events at once |
| Retrieve session event history |
| Run loop detection algorithms |
| Get detected loop patterns |
| Mark a false detection |
| Get convergence score |
| Analyze trend over time |
| Export as eval dataset |
| Server health metrics |
| Add metadata to an event |
| Search by tool name |
๐ Loop Types Detected
infinite โ same tool called with identical input repeatedly
oscillating โ alternating between states without converging
thrashing โ high-frequency oscillation across many tools
stuck โ no meaningful progress for extended period
tool_retry โ same tool retried after repeated failures
๐ Architecture
looplens/
โโโ server/ # MCP server wiring (app.py, __main__.py)
โโโ tools/ # 16 MCP tool handlers
โโโ resources/ # 4 MCP resource handlers
โโโ prompts/ # 3 MCP prompt builders
โโโ domain/ # Immutable domain models (Pydantic v2)
โโโ storage/ # SQLAlchemy 2.0 async repositories
โโโ ingestion/ # Event normalization pipeline
โโโ loop_detection/ # 4 detection algorithms + classifier + scorer
โโโ convergence/ # 5-metric scoring engine
โโโ analytics/ # Orchestrator for detection + convergence
โโโ security/ # Redactor, path guard, rate limiter
โโโ connectors/ # Claude Code, JSON, JSONL event parsers
โโโ exports/ # Eval case exporter๐ Why it matters
One of the biggest weak points in AI coding today is what happens after the first fix fails.
LoopLens helps make retries:
measurable
comparable
diagnosable
learnable
Instead of:
"try something else"
you get:
"Attempt 3 repeated the same failure signature as attempt 2, edited the same files, and did not reduce validation severity โ likely retry loop. Best next step: gather more evidence before editing again."
That is the kind of debugging intelligence coding agents need.
๐ Vision
LoopLens aims to become the iteration intelligence layer for agentic debugging:
better local debugging
better repair observability
better eval datasets
better failure analysis
better coding-agent improvement loops
๐งช Status
Early project / active build.
If this resonates with you, ideas, contributions, and feedback are very welcome ๐
๐ License
MIT
๐๐ LoopLens MCP
See the loop. Break the loop.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/musaceylan/looplens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server