DEV Community

Damien
Damien

Posted on

How I Built 65+ AI Tools on a Raspberry Pi 5

There's a gap in the MCP ecosystem that bothered me. If you want to give your AI coding assistant access to tools — web scraping, research, translation, agent memory — you either build everything yourself or cobble together a dozen different services. I wanted one MCP server that handled all of it.

So I built AiPayGen: 65+ tools, installable with pip install aipaygen-mcp, running on a Raspberry Pi 5 sitting on my desk.

Why I built it

MCP (Model Context Protocol) is how AI assistants like Claude Code, Cursor, and Cline access external tools. The protocol is solid, but the tool ecosystem is fragmented. Most MCP servers offer one thing — a file reader, a web search wrapper, a database connector. If you want a full toolkit, you're managing ten different MCP servers.

I wanted a single pip install that gives an AI assistant access to research, writing, code generation, web scraping, data feeds, agent memory, and workflow orchestration. One server, one API key, one bill.

The architecture

The production stack is deliberately simple:

  • Hardware: Raspberry Pi 5, overclocked to 2.7GHz, with an NVMe SSD in a Pironman 5 case
  • Backend: Flask application with modular route blueprints
  • Database: SQLite for user metadata, billing, agent memory
  • MCP transport: FastMCP with streamable-http, built on MCP SDK 1.26
  • Tunnel: Cloudflare tunnel for HTTPS ingress
  • Package: Published to PyPI as aipaygen-mcp

Here's the key architectural insight: the Pi doesn't run AI models. It routes requests. When you call the research tool, the Pi validates your API key, checks your balance, selects the best upstream model for the task (from 15 models across 7 providers), forwards the request, and deducts the cost.

User's IDE (Claude Code / Cursor / Cline)
    ↓ MCP protocol
AiPayGen MCP Server (local pip package)
    ↓ HTTPS
Flask API on Pi 5 (Cloudflare tunnel)
    ↓ Routes to best model
OpenAI / Anthropic / Google / DeepSeek / Mistral / Grok
Enter fullscreen mode Exit fullscreen mode

The tools

The 65+ tools break down into categories:

AI tools (40+): Research, summarize, write, translate, code, analyze, sentiment, classify, extract, compare, explain, plan, decide, debate, proofread, rewrite, pitch, headline, keywords, outline, and more. Each tool has a specific prompt template optimized for its task, and the router picks the best model automatically.

curl -X POST https://api.aipaygen.com/summarize \
  -H "Authorization: Bearer apk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your long article text here...", "length": "short"}'
Enter fullscreen mode Exit fullscreen mode

Web scraping (6 tools): Google Maps businesses, Twitter/X posts, Instagram profiles, TikTok videos, YouTube transcripts, and generic website scraping.

Agent infrastructure: Persistent memory (key-value with full-text search), agent-to-agent messaging, shared task boards, a knowledge base with RAG search, and a skills marketplace.

Free data feeds: Weather, crypto prices, exchange rates, holidays. No API key needed.

curl "https://api.aipaygen.com/data/weather?city=London"
curl "https://api.aipaygen.com/data/crypto?symbols=bitcoin,ethereum"
Enter fullscreen mode Exit fullscreen mode

The x402 payment experiment

Alongside traditional Stripe billing, I integrated the x402 protocol for HTTP-native micropayments. You make an API call, the server responds with HTTP 402 and includes the price in the headers. Your client signs a USDC transaction and retries with a payment receipt. No signup, no API key, no account. Just a crypto wallet.

In practice, most users still prefer Stripe. But the x402 integration has real potential for agent-to-agent commerce where there's no human to enter a credit card.

Challenges and what I learned

Model routing is harder than it sounds. Different models are better at different tasks. I built a routing layer that picks the model based on the tool being called, but there's room for improvement.

Scraping is a maintenance nightmare. Platforms change their markup regularly. Budget significant time for maintenance.

SQLite is underrated for this scale. SQLite with WAL mode handles concurrent reads fine. Having the database as a single file makes backups trivial.

MCP is a genuine distribution channel. People discover tools through their IDE. The friction is dramatically lower than traditional API integration.

The Pi 5 is surprisingly capable. Four months later, it's still handling production traffic at 2.7GHz. The NVMe SSD was the critical upgrade.

Try it

pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp
Enter fullscreen mode Exit fullscreen mode

Two commands, free trial credits, no card needed. If you find it useful, I'd like to hear about it. If you don't, I'd really like to hear about that — the honest feedback is more valuable.

Top comments (0)