DEV Community

Cover image for I Built a Self-Hosted Image Hosting Platform in Go — and Gave It an MCP Interface
Beta
Beta

Posted on

I Built a Self-Hosted Image Hosting Platform in Go — and Gave It an MCP Interface

The Backstory

I spent the latter half of last year Vibe Coding — a lot. First came RelayCraft (an AI-native network traffic debugging tool, built with Tauri + Rust). Then PicFast, released more recently.

PicFast is a self-hosted image hosting platform you can spin up in one Docker command. Clean management UI, multiple storage backends, ShareX integration, and a built-in MCP interface so your AI tools can actually talk to your image host.

PicFast

Here's how it came together.


Why Build Another Image Host?

If you've been around the block, you know the deal: image hosting services change policies, shut down, or start charging. Your images are on someone else's server — and that server isn't yours.

With AI tools generating screenshots, document images, and visual assets constantly, images have become a real data asset. Letting someone else hold them feels... wrong.

I actually looked. I spent real time searching for a self-hosted image host that didn't feel like a relic from 2010 — something with a modern UI, multi-user support, and ideally an API that AI tools could actually use. I came up empty.

Most self-hosted options are either abandoned GitHub repos, PHP-era projects with no maintenance, or solutions so over-engineered they defeat the purpose of "simple."

So I built one.

PicFast exists for three reasons:

  • Data sovereignty — your images, your server, your rules
  • Predictable cost — PostgreSQL + Docker, nothing else
  • AI-native by design — MCP support out of the box

One Command to Running

No lengthy tutorial here (the README covers that). The gist:

git clone https://github.com/atbeta/picfast.git
cd picfast/docker
cp .env.example .env
# edit .env — replace with your domain、password and JWT salt
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Point your browser at http://your-server:18080, go through the setup wizard, and you're done. Production deploy with a domain + Caddy/Nginx reverse proxy for HTTPS takes another few minutes.


The Stack: Why Go + React

I'm going to be honest — I had no production Go experience before this project. Here's why I picked it anyway:

Backend: Go's concurrency model is a natural fit for I/O-heavy workloads like an image host. I went with Chi Router + pgx/v5 + sqlc. Type-safe SQL without the ORM baggage. Compile to a single binary, deploy anywhere.

Frontend: React 19 + TypeScript + Vite. Tailwind CSS v4 — honestly, it feels like it was built for the AI era. Fast iteration, utility-first, plays well with AI-generated styles. A proper multi-user admin dashboard needs a real UI framework.

Database: PostgreSQL 16. User accounts, albums, storage policies — the metadata here is relational and pgx makes interacting with it clean.


MCP: Talk to Your Image Host with Natural Language

This is the part that usually gets people's attention.

PicFast implements the Model Context Protocol. Once configured, you can manage your image host from any MCP-compatible AI tool — Claude Desktop, Cursor, whatever you're using.

{
  "mcpServers": {
    "picfast": {
      "command": "npx",
      "args": ["-y", "@picfast/mcp"],
      "env": {
        "PICFAST_BASE_URL": "https://your-picfast.example.com",
        "PICFAST_API_TOKEN": "img_xxxxxxxxxxxx"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Then you can just ask:

"Upload all my screenshots from today to PicFast and give me the links in Markdown."

The AI calls the PicFast API directly. No tab switching. No manual uploads. This is what a self-hosted image host looks like in the AI era.


Other Stuff Worth Mentioning

  • Storage backends: Local disk, AWS S3 / MinIO (S3-compatible), Alibaba OSS, Tencent COS, Qiniu Kodo, WebDAV. Drop in a CDN-backed S3 bucket and your image URLs are fast globally.
  • ShareX ready: Download the config file from the admin panel, import it, done. Screenshots go straight to your server.
  • Multi-user + permissions: Admin / regular user / guest, per-group storage limits, optional approval queue for public-facing instances.
  • API tokens: Fine-grained rate limits, great for automation scripts and CI pipelines.

What I Learned

The upper limit of what AI can do far exceeded my expectations. Ideas that used to require a team, or months of grinding, can now become real products in weeks — sometimes days.

That changes what it feels like to be a software engineer. You're no longer bottlenecked by whether you can theoretically build something. You're bottlenecked by what you can actually think to build.

PicFast started as a vague idea. I shipped the entire thing over one Labor Day holiday — a functional, deployed project in just a few days of focused work. RelayCraft took two months by comparison. That contrast still amazes me — the same AI tooling that powered RelayCraft compressed an entire traditional development cycle into a long weekend.

I'm grateful for this era.


Try It Out

Give it a star if you find it useful. Issues and PRs welcome.

Top comments (0)