Skip to content

Open-source Sentry alternative: Mothlog, lightweight and with MCP so AI agents can fix your errors

Mothlog is an open-source Sentry alternative: it uses the same SDKs, runs as a single binary on Postgres or SQLite, and ships an MCP server so an AI agent can find, understand and fix your errors.

Oscar Fernandez 25 min

On this page
  1. What is Mothlog?
  2. Why look for a Sentry alternative?
  3. What does Mothlog do, and what doesn't it?
  4. How do you migrate from Sentry to Mothlog?
  5. How does an AI agent fix an error with Mothlog's MCP server?
  6. Mothlog vs Sentry, GlitchTip and Bugsink
  7. How much does Mothlog use?
  8. How do we use it at Intake?
  9. How do you install Mothlog?
  10. Frequently asked questions
Two developers reviewing code on a monitor in a bright office
See how Intake’s AI agent answers from your documentation

Mothlog is an error tracker that speaks the Sentry protocol: your apps keep using the official Sentry SDKs and only the DSN changes. It runs as a single binary, on Postgres or on a SQLite file, and it ships an MCP server so an AI coding agent can find an error, read its whole context, fix it and mark it resolved.

We built it at Intake for our own production errors and released it as open source under the Apache-2.0 license. The code is at github.com/intake-es/mothlog.

What is Mothlog?

Mothlog is a self-hosted Sentry alternative that receives the errors Sentry SDKs send, groups them into issues and alerts you when a new one appears or a resolved one comes back. The web UI, a REST API and an MCP server all live in the same binary.

The name comes from the moth found in 1947 stuck in a relay of the Harvard Mark II and taped into its logbook as the "first actual case of bug being found".

Why look for a Sentry alternative?

Sentry is the reference for error tracking, and for many teams it is still the best choice. The reasons to look elsewhere tend to be three:

  • Price grows with volume. In the cloud you pay by events, and a busy SaaS can end up spending more on errors than it expected, or sampling to stay under its quota.
  • Self-hosted Sentry is heavy. Its documentation asks for at least 4 CPU cores, 16 GB of RAM plus 16 GB of swap and 20 GB of disk, and recommends 32 GB of RAM. Under the hood it runs Kafka, ClickHouse, Redis, Postgres, Snuba and several more services. Keeping it running is a job in itself.
  • Data and license. If your errors carry customer data, you may prefer it never leaves your infrastructure. And self-hosted Sentry ships under the Functional Source License (FSL), which turns into Apache 2.0 after two years but is not an open-source license from day one.

If what you need is grouped errors, alerts and a comfortable way to fix them, much of that machinery is overhead.

What does Mothlog do, and what doesn't it?

Mothlog covers error tracking end to end:

  • Grouped issues by fingerprint, with regressions, assignment to people or agents, comments, history and a search language (is:open browser:Safari release:1.4.0).
  • Releases and environments: what each release brought, "resolved in the next release", and crash-free sessions and users.
  • Source maps to see browser errors in your original TypeScript, uploaded with sentry-cli or a plain POST.
  • Cron and uptime monitors.
  • Alerts to Slack and Linear by default, and per-project rules to email, Discord, Telegram, ntfy, GitHub issues and a signed webhook. It also syncs statuses with Linear and GitHub and sends a daily or weekly digest.
  • A REST API and an MCP server, with tokens or OAuth.
  • Prometheus metrics and import from Sentry.

What it doesn't do, on purpose: performance tracing, session replay, profiling or logs. If you depend on those, Sentry or a full observability platform is still the way to go. Mothlog accepts that data from the SDKs without errors and ignores it.

How do you migrate from Sentry to Mothlog?

Since Mothlog speaks the same protocol, migrating means changing the DSN. In Python:

import sentry_sdk

sentry_sdk.init(dsn="https://<key>@errors.yourcompany.com/1", release="api@1.4.0")

In the browser it's the same: Sentry.init({ dsn: '…' }) with the new DSN. Source maps are uploaded with the same sentry-cli you already use, pointed at your server.

To avoid starting from scratch, mothlog import sentry brings over from Sentry's API (sentry.io or a self-hosted one) your projects, your issues with their latest events, and your releases with their deploys. It has a --dry-run mode to see what it would import, and running it again duplicates nothing.

No customers waiting, no team overwhelmed, with a 30-day guarantee

How does an AI agent fix an error with Mothlog's MCP server?

This is why we built Mothlog. The MCP server is designed so an AI coding agent can take an error from start to finish without leaving its session. With Claude Code you connect it like this:

claude mcp add --transport http mothlog https://errors.yourcompany.com/mcp

The first time, the browser opens: you sign in with your Mothlog account and choose whether the agent may only read or also comment, assign and change statuses. Agents without a browser, like the ones in CI, use an API token.

From there, the workflow is the one a person would follow:

  1. list_issues to find the error, with the same search as the UI.
  2. assign_issue to take it, so the team knows someone is on it.
  3. get_issue_context, which returns everything needed in a single Markdown document: the stack trace with the code of each of your frames, breadcrumbs, the request, the user, affected releases and environments, and the comment history.
  4. Fix it in the code.
  5. add_comment to record the cause and the change, and set_issue_status with resolved_next, which marks it resolved once the next release is deployed. If the error comes back later, it reopens as a regression.

Everything the agent does is recorded in the issue's history under its name, so you can see what it touched and why.

Mothlog vs Sentry, GlitchTip and Bugsink

These are the most cited self-hosted Sentry alternatives, with the figures from their official documentation:

MothlogSelf-hosted SentryGlitchTipBugsink
LicenseApache-2.0FSL (Apache 2.0 after two years)MITPolyForm Shield (source-available, no competing use)
What it runsOne binary with the UI insideKafka, ClickHouse, Redis, Postgres, Snuba and moreThe service and Postgres 14+; Valkey optionalOne container
DatabasePostgres 16 or SQLitePostgres and ClickHousePostgresSQLite by default; MySQL or Postgres
ResourcesUnder 50 MB of RAM at 214 events/s on 0.25 vCPUAt least 4 cores and 16 GB of RAM + 16 GB of swap512 MB of RAM recommendedWell under 100 MiB per worker; fits a 2 GiB server
MCP serverBuilt in and on, with OAuth or a tokenYes, through the Sentry CLI running locallyBuilt in, off by defaultNot official; community projects exist
Performance tracingNoYes, plus session replayYesNo, errors only

Sources: self-hosted Sentry requirements, Sentry MCP, GlitchTip installation, GlitchTip MCP, GlitchTip performance, Bugsink license and Bugsink on a single server.

In short: if you need tracing, replay and the whole ecosystem, go with Sentry. If you want something small, MIT-licensed and with tracing too, GlitchTip is a good choice. Mothlog fits when you want the least to maintain (one binary, and SQLite if you don't run Postgres) and AI agents working your errors from day one.

How much does Mothlog use?

On 0.25 vCPU and under 50 MB of memory, Mothlog takes 214 events per second sustained, with peaks of 323. The load test is in the repository (make carga) and anyone can rerun it.

With SQLite you don't need a database server: everything sits in one file, which you copy to back it up. With Postgres you can run several replicas that share the work without sending duplicate alerts.

How do we use it at Intake?

Since November 2026, every production error from Intake's backend and integrations goes to Mothlog. It receives more than 50,000 sessions a day on a single 0.25 vCPU, 512 MB task, and each new error posts to Slack and opens a Linear issue. The coding agents we work with read each error's context through the MCP server, and when they fix it they leave a comment and mark it for the next release.

How do you install Mothlog?

With Docker and Compose, in a minute:

git clone https://github.com/intake-es/mothlog.git && cd mothlog
docker compose up -d
docker compose logs mothlog | grep dev/login
docker compose exec mothlog /mothlog projects create demo

The third command gives you the link to sign in to the UI, and the fourth the project's DSN. For production, with GitHub or OIDC sign-in, the deployment guide walks you through it. There are also binaries for Linux and macOS, and a Docker image for amd64 and arm64.

Frequently asked questions

Is Mothlog free?

Yes. It's open source under the Apache-2.0 license: you can use it, modify it and deploy it in your company with no limit on events, users or projects.

Does it work with the Sentry SDKs?

Yes. Mothlog receives what the official Sentry SDKs send, so only the DSN changes. We test it with sentry-python and @sentry/browser, and it works the same with framework integrations such as FastAPI, Django, React or Angular.

Does Mothlog have performance tracing or session replay?

No. It focuses on errors, release sessions, crons and uptime. If the SDKs send traces, it accepts them without errors and discards them.

Do I need Postgres?

No. With DATABASE_URL=sqlite:///… everything goes in a SQLite file, for a single instance. Postgres 16 is needed if you want several replicas.

Which AI clients can connect to the MCP server?

Over OAuth, MCP clients that return to an https or local address, such as Claude Code. Any other client or agent connects with an API token, which works with every tool.

Where is the data stored?

On your server. Mothlog sends nothing out except the alerts you configure (Slack, Linear, email…).

Get the updates by email

RSS

Only the updates, with an unsubscribe link in every email. Read the privacy policy.

Every request resolved well, a more loyal customer

30-day guarantee: if it does not work, you do not pay.