Links
- Main repository — source code for the BugCapsule MCP and capsule workflow.
- Implementation and testing report — full writeup covering the implementation, determinism, stress tests, and demo results.
Inspiration
Debugging with AI agents can fail when the model has to reason over an entire repo at once. BugCapsule was inspired by the idea that agents should debug from the smallest reproducible slice of a problem, not from a giant context dump.
What it does
BugCapsule captures a runtime error, stack trace, or failing interaction and builds a focused mini-repo around the bug. The agent can then reproduce, inspect, fix, and verify the issue in a smaller deterministic environment before applying the patch back to the original project.
How we built it
We built BugCapsule as an MCP-based debugging workflow that connects runtime capture, source tracing, dependency slicing, repro generation, and apply-back verification. It uses TypeScript, Node.js tooling, browser/runtime probes, and structured capsule manifests to keep the debugging context focused and repeatable.
Challenges we ran into
The hardest part was making capsule creation deterministic enough for agents to trust, since MCP workflows can otherwise produce inconsistent results. We also had to balance reducing context aggressively while still preserving enough source files and runtime behavior for the bug to reproduce correctly.
Accomplishments that we're proud of
BugCapsule showed meaningful token savings by reducing debugging context substantially across our stress tests while still preserving the failing behavior. We are especially proud of the accuracy benefit: SWE-1.6 Fast failed on the demo repo alone, but BugCapsule plus SWE-1.6 Fast was able to fix the same issue.
What we learned
We learned that context reduction is not only about speed or token savings. A smaller, executable debugging environment can also improve accuracy by forcing the agent to focus on the actual failure path.
What's next for BugCapsule
Next, we want to make BugCapsule more robust across larger codebases and more diverse runtime failures. We also want to improve automatic repro discovery, capsule quality checks, workplace CI integrations, and other agentic integrations beyond MCP.
Built With
- model-context-protocol
- node.js
- runtime-probing
- ts-morph
- typescript
- vitest
Log in or sign up for Devpost to join the conversation.