title: Gnat, self-hosted analytics as a single Go binary, with a built-in MCP server
A few months back I was crawling the web for a side project and came across an analytics platform's data that had exposed users' raw IPs. It wasn't malicious, just careless. But it stuck with me: most people using these tools have no idea their visitors' data is sitting around like that.
That's the moment that pushed me to build Gnat, a self-hosted analytics tool that doesn't cut corners on privacy, but also doesn't force you into a painful setup to get it.
No third party, no phoning home
Gnat runs entirely on infrastructure you control. There's no third party in the loop, no API calling home anywhere, and no data leaving your server. It's also completely free and open source, the whole thing is on GitHub.
One binary, zero bloat
Most self-hosted analytics tools make you choose: either something lightweight with barely any real analysis, or something with real analytical depth that also means Docker, a multi-service stack, and its own ops burden just to keep running.
Gnat is a single Go binary. No CGO, no Docker, no multi-service stack. The dashboard (HTML, CSS, JS) is compiled directly into the executable, so there's nothing else to install alongside it.
tar xzf gnat-vX.Y.Z-linux-amd64.tar.gz
cd gnat-vX.Y.Z-linux-amd64
./gnat
That's the whole install.
Real analytical depth
Despite being one binary, Gnat doesn't skimp on features:
- Pageviews and custom events via a simple JSON POST (no per-language SDKs needed)
- Funnels, cohorts, retention curves
- Auto-discovered path analysis
- SQLite by default, or Postgres/MySQL if that's how you already run infrastructure
- CSV, JSON, jsonL, it's your data
Built for the agent era
The part I had the most fun building: Gnat ships with a native MCP server. Claude or any MCP-compatible agent can query your analytics directly, ask what changed, pull a report, whatever you need.
Where it's at
This is early, v0.1.0, and I'm actively building on it. Multi-site support, SSO/team access, and managed hosting are all on the roadmap but not built yet, the README is upfront about what's real today versus what's planned.
Gnat is licensed under AGPLv3, free to self-host and modify for any purpose, including commercially, but if you run a modified version as a service for others, the source has to stay open under the same terms.
Repo: https://github.com/var-raphael/Gnat
Feedback, issues, and contributions are very welcome. I'd love to hear what you think, especially if you've felt the same Docker-and-multi-service fatigue trying to self-host analytics.