Moth
Moth is a lightweight MCP server for project-local bug-fix analysis and verified fix memory.
What Moth Does
Moth receives error output through MCP, redacts likely secrets, normalizes the failure, detects the likely stack, checks project-local fix memory, and returns a structured fix brief.
Moth does not edit code, run shell commands, crawl repositories, require a backend, or maintain a global bug database.
Related MCP server: looplens-mcp
Why Moth?
Bug-fix context is often local to a project: the command that failed, the framework in use, nearby configuration, and fixes that have already worked or failed in that repo.
Moth keeps that workflow small and explicit. It analyzes provided error context, suggests a best first fix, and records only verified fix outcomes in project-local memory.
Quick Start
Requires Node.js 18+.
Run directly:
npx -y @stfade/moth moth-mcpOr install globally:
npm install -g @stfade/moth
moth-mcpGeneric MCP config
{
"mcpServers": {
"moth": {
"command": "npx",
"args": ["-y", "@stfade/moth", "moth-mcp"]
}
}
}Usage Example
When using Moth with a supported AI agent, you can include a simple prompt like this along with your error:
"Use Moth to analyze this error before fixing it."
Supported Clients
Client | Status | Setup |
Codex | Local plugin-ready | |
Claude Code | Local plugin-ready | |
Cursor | Plugin scaffold | |
Gemini CLI | Extension scaffold | |
Gemini Antigravity | MCP config-ready | |
OpenCode | MCP config-ready | |
Generic MCP | Config-ready |
“Local plugin-ready” means the integration wrapper is included and can be tested locally. Marketplace submission and approval are not included yet.
Tools
Moth exposes exactly two MCP tools.
analyze_error
Analyzes provided error output before a fix is attempted.
Input fields:
error_outputcommand?cwd?package_context?relevant_files?environment?
Output fields:
analysis_idfingerprintstacklikely_causebest_first_fixverificationprior_project_fixesavoidconfidence
remember_fix_result
Records verified project-local fix memory.
Input fields:
analysis_idfingerprintstackfix_attemptedverification_commandverification_result: "passed" | "failed"notes?
The public worked input is rejected. worked is derived from verification_result.
Verified Memory Lifecycle
analyze_error
→ apply/attempt fix
→ run verification command
→ remember_fix_resultCall remember_fix_result only when:
a fix/change was actually attempted
the verification command actually ran
the result is clearly
passedorfailed
Do not call it for suggestions, skipped changes, missing verification, ambiguous results, or guesses.
Local Memory
Verified project-local fix memory is stored at:
.moth/fix-memory.jsonlMoth keeps a small Moth-owned analysis registry outside the project so remember_fix_result can map analysis_id back to the correct project path after an MCP server restart.
Skills
Moth includes concise skills for compatible agents:
moth-debug-first-fixmoth-source-backed-researchmoth-verify-fix
The MCP server itself does not perform live web research. Compatible agents may use their own search tools, guided by Moth skills, when external sources are needed.
Safety
read-only by default
no source edits
no shell execution
no repo-wide scan
no background watcher
no external service required
redacts likely secrets before analysis, responses, and memory writes
Development
pnpm install
pnpm test
pnpm build
pnpm dev
npm pack --dry-runLicense
MIT
Available Tools
2 toolsanalyze_errorAnalyze ErrorC
Analyze provided error output and return a deterministic project-local fix brief.
Inputs: error_output (required), command, cwd, package_context, +2 more. Returns: analysis_id, fingerprint, stack, likely_cause, +5 more
remember_fix_resultRemember Fix ResultA
Record verified project-local fix memory only after a fix/change was actually attempted, the verification command was actually run, and the result is clearly passed or failed.
Inputs: analysis_id (required), fingerprint (required), stack (required), fix_attempted (required), +3 more. Returns: recorded, memory_path, timestamp
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: analyze_error generates a fix brief from error output, while remember_fix_result records the outcome of a fix attempt. There is no overlap or ambiguity.
Both tool names follow a consistent verb_noun pattern in snake_case: analyze_error and remember_fix_result. The naming is clear and predictable.
With only 2 tools, the server feels under-scoped for a typical error analysis workflow. While it may be intentionally minimal, a more comprehensive set would include tools for retrieving fix history or clearing memory.
The tool set lacks retrieval capabilities (e.g., listing or searching past fix results) and memory management (e.g., clearing or updating records). These are notable gaps that could hinder agent workflows.
Maintenance
Related MCP Connectors
Shared debugging memory for AI coding agents
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
Structured failure knowledge for AI agents — dead ends, workarounds, error chains
Failure-memory layer for coding agents: search evidence-rated failure lessons by error text.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceShared debugging memory for AI coding agents. Agents search, report, patch, and verify bug fixes through 5 MCP tools. Verified by proof, not upvotes.1Business Source 1.1
- AlicenseBqualityDmaintenanceAn MCP server for detecting retry loops and analyzing iteration patterns in agentic coding workflows, providing structured debugging intelligence to improve repair attempts.164MIT
- AlicenseNot gradedqualityDmaintenanceA deterministic AST evidence engine that forces AI agents to debug using verified execution facts instead of pattern-matching symptoms, enabling hallucination-free debugging for MCP-compatible agents.Business Source 1.1
- AlicenseAqualityBmaintenanceEnables AI agents to debug errors by providing root cause analysis and ranked fixes with code patches. Supports any MCP client.2117 npmMIT