Skip to main content

Bug Ledger

Bug Ledger

Never fix the same bug twice.
A local MCP server that gives AI coding agents a permanent memory of the bugs you already fixed.

PyPI Python CI License

What it does

Your agent fixes a bug. You confirm the record. From then on, every session on that project checks the ledger before writing code in that area and can search it while debugging.

  • Before coding, the agent calls get_patterns and sees the past bugs for that feature area.
  • While debugging, it calls search_bugs with the error text.
  • After a fix, you run /logbug. The agent drafts the record, you approve, it is stored.

Everything stays on your machine: one SQLite file in ~/.bugledger/. No account, no cloud, no telemetry.

Install

Requires uv. It downloads Python if needed.

Claude Code

claude mcp add bugledger -- uvx bugledger-mcp

Cursor, in .cursor/mcp.json:

{ "mcpServers": { "bugledger": { "command": "uvx", "args": ["bugledger-mcp"] } } }

Any other MCP client: command uvx, argument bugledger-mcp, transport stdio.

Whole team: commit that JSON as .mcp.json (Claude Code) or .cursor/mcp.json (Cursor) in the repo. Everyone who opens the project gets the server.

Restart the client. /mcp lists bugledger as connected and /mcp__bugledger__logbug is available.

Use

  1. Fix a bug as usual.
  2. Run /mcp__bugledger__logbug. The agent checks that the session really contained a bug fix, drafts the symptom, root cause, feature area, and stack, shows you the draft, and stores it only after you say yes. Feature work and refactors are refused.
  3. Keep working. On connect, the server tells the agent to call get_patterns before coding and search_bugs while debugging. Nothing else to set up.

To make the check a hard rule, add one line to CLAUDE.md or .cursorrules:

Before implementing anything in a feature area, call bugledger get_patterns with that area and this project's name, and account for every returned bug. After fixing a bug, run /mcp__bugledger__logbug.

Tools

Tool Purpose
get_patterns(feature_area, project, stack?) Past bugs for an area, one line each, capped at 30 lines
search_bugs(query) Full-text search over symptoms and root causes; paste the error as is
record_bug(...) Store a confirmed bug with its root cause and fix diff
list_areas() Existing feature areas and projects, so names stay consistent
update_bug / delete_bug Correct or remove a record
resolve_bug(id, project) Hide a bug from get_patterns for one project once a guardrail covers it
get_guardrails(stack) Starter Semgrep rules and the CI workflow that installs them

Guardrails

get_guardrails returns hand-written Semgrep rules for the classic mistakes agents make: SQL and shell injection, hardcoded secrets, unsafe deserialization, eval, open CORS, debug mode, insecure random, plain HTTP. The agent writes them to .bugledger/ in your repo and adds one workflow file. Existing CI files are never touched. ERROR rules block the pull request, WARNING rules only report. Delete a rule file to drop it.

Data and privacy

  • The ledger is ~/.bugledger/ledger.db. Set BUGLEDGER_HOME to move it. Delete it any time; it is recreated on next start.
  • record_bug runs git show <commit> locally to store the fix diff. Diffs are never returned by get_patterns and never leave your machine.
  • The server makes no network calls.

Contributing

Bug reports, new rules, and pull requests are welcome. Setup, tests, and the release process are in CONTRIBUTING.md.

License

MIT

Metadata

Release files for bugledger-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bugledger-mcp 0.1.2
File Size Uploaded Provenance Actions
bugledger_mcp-0.1.2.tar.gz 33.8 kB Without provenance Details for bugledger_mcp-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bugledger-mcp 0.1.2
File Interpreter ABI Platform Actions
bugledger_mcp-0.1.2-py3-none-any.whl Python 3 none any Details for bugledger_mcp-0.1.2-py3-none-any.whl

Total release size: 79.3 kB

Release files / bugledger_mcp-0.1.2.tar.gz

Download URL bugledger_mcp-0.1.2.tar.gz
Size 33.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1b60765461b0525ce357c0fa7d49674956a6b057d1c9731c4367971e3d50863c
BLAKE2b-256 checksum
How to use checksums
c4f3f10479d842251afa45af43246dd596104c2e4cd16d5e316f02d25ac0bdc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bugledger_mcp-0.1.2-py3-none-any.whl

Download URL bugledger_mcp-0.1.2-py3-none-any.whl
Size 45.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
344d090b804b111d980feda26cc9ef42df1272b91633087274d1cac14c5fcd2e
BLAKE2b-256 checksum
How to use checksums
4cd4d33cf9c26a44fad0e53a44257e77b744ee12351d490924952389a413032e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bugledger-mcp 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page