Skip to main content
Gemini API Adds MCP + Background Execution: Build a Local Agent Host

Gemini API Adds MCP + Background Execution: Build a Local Agent Host

Gemini now supports MCP and background jobs — here's the Pi 4 host that runs them locally.

Google added MCP tools and background execution to the Gemini API. A Raspberry Pi 4 8GB hosts the plumbing; a used RTX 3060 handles the model calls.

You can host a small Model Context Protocol (MCP) agent stack on a Raspberry Pi 4 8GB that runs the router and long-running background tasks, and offload the actual model calls to Gemini via API. For anything requiring a local LLM inside the loop, add a used RTX 3060 12GB box. Total build under $500, and the agent survives your laptop closing.

Why this piece exists

Google's Gemini API added first-class MCP support and background-execution primitives in mid-2026 — announced at the Google Cloud AI keynote and rolled into the public SDK the same week. The combination is a bigger deal than the press release let on. MCP lets your agent talk to arbitrary tools with a common protocol; background execution lets your agent keep running when you close the client. Together they mean you can run agent workflows that survive across sessions, share tool servers across teammates, and route to a mix of Gemini + local models cleanly.

The bit the press release didn't cover: to actually use this well you need a host — a small always-on box that runs your tool servers, holds your MCP registry, and orchestrates the background jobs. Cloud hosts work, but a Pi 4 in your closet costs $80 and never gets rate-limited. This piece walks you through the hardware, the wiring, and the reasonable ceiling of what a Pi can host before you have to reach for a bigger box.

Who this is for

You already know what MCP is. You have used at least one agent framework — Aider, Claude Code, LangGraph, or a custom harness — and you have opinions about tool interfaces. You want an always-on host so your agent tasks don't die when you close your laptop. You are not trying to run frontier reasoning locally; you are trying to run the plumbing locally so cloud calls are the only thing metered.

Key takeaways

  • Gemini API now supports MCP tool servers and background job execution — details in the official Gemini docs.
  • A Raspberry Pi 4 8GB is enough to host 5-15 MCP tool servers and run the background execution loop for a solo builder — CPU-bound work only.
  • Anything that needs an in-loop LLM step (embedding, small classification, code retrieval) belongs on a proper GPU box, not the Pi.
  • Storage matters: a Samsung 970 EVO Plus 250GB NVMe via a USB-C enclosure moves the Pi's disk IO out of SD-card jail.
  • The Pi survives a Gemini rate-limit event much better than a cloud host with a per-second concurrency cap — that alone is worth the setup.

What MCP background execution actually adds

MCP by itself is a protocol for exposing tools to an LLM. Background execution changes the lifecycle: your agent submits a job (say, "monitor this repo and open a PR when tests pass"), the runtime returns a handle, and the job continues without the client attached. When the job finishes it can push results back through a webhook, a queue, or a follow-up MCP call.

The concrete shape per the Gemini API reference is roughly: runs.create with a background flag, runs.get to poll status, runs.stream to attach a stream when you want to watch. Tool calls inside the job route through MCP servers you registered on your host.

The value is straightforward: you can start a task on your phone, close the app, and pick up the result later. For a team it is bigger: shared MCP servers on a shared host mean everyone's agent uses the same tool registry, the same auth, the same rate-limit budget.

The Pi 4 host build

The reference build:

  • Raspberry Pi 4 Model B 8GB — $80. 8GB is the min; 4GB is tight once you have five MCP servers plus a monitoring stack.
  • Samsung 970 EVO Plus 250GB NVMe + a USB 3.0 NVMe enclosure — $35 SSD + $12 enclosure. Boots faster and lasts longer than any SD card.
  • A quiet case with a heatsink — $15. The Pi throttles hard under sustained load without one.
  • A short list of software: Docker, Caddy or Nginx reverse proxy, one MCP server per tool, systemd units for each.

Total landed cost: about $150. This is not a beefy machine — it is a plumbing host. It runs your tool servers and job queues; the actual heavy lifting happens on Gemini or a bigger local box.

When you'll want a GPU host too

The Pi handles orchestration. When the workflow calls for anything that runs an LLM locally — embedding generation, a small classifier, a code-retrieval reranker, an on-device speech-to-text — the Pi will not cut it. Add a modest GPU box:

  • MSI RTX 3060 Ventus 3X 12G — $220 used. Runs Qwen 3 7B at q5 comfortably, hosts a bge-large embedding model, and handles the code-retrieval reranker with room to spare.
  • AMD Ryzen 7 5700X — $180. Enough CPU cores to hold the orchestration overhead of concurrent MCP requests.

The Pi handles the small-latency plumbing (queues, tool routing, webhook fan-out) and the GPU handles the model work. This split is stable — the Pi almost never gets touched once configured, and the GPU box only needs updates when you swap models.

Sample tool inventory on the Pi

The MCP servers a solo builder tends to run:

ServerRAM footprintNotes
filesystem (read/write scoped)~50MBStandard MCP filesystem server
github-tools~100MBAuth cache + rate-limit shaping
shell-runner~60MBRuns make, pytest, etc.
web-fetch (allow-listed)~80MBGuards outbound HTTP
sqlite / postgres tools~150MBDatabase read/write
ollama-proxy (routes to GPU box)~40MBForwards LLM calls to the RTX box
cron/scheduler~30MBFires background jobs on a clock

Total: comfortably under 1GB. The Pi's remaining 7GB is available for job state, log buffers, and the reverse proxy.

Prefer NVMe over SD

The Pi 4 boots from USB 3.0. Boot from a small NVMe SSD in a USB-C enclosure and skip the SD card entirely — community measurements from Tom's Hardware and other sources put NVMe-over-USB at 4-6x SD-card throughput, and the endurance on a decent NVMe drive is measured in years of always-on service instead of the months you get out of a heavily-written SD card.

Common pitfalls

  • Using a 5V/2A phone charger. The Pi 4 needs 5V/3A. Undervolt logs and random reboots at load are the number-one home-lab failure.
  • Running the model on the Pi. A quantized 3B model technically runs — it does about 4-6 tokens/sec, which is unusable for interactive work. Route model calls to a GPU box or the cloud.
  • Skipping the reverse proxy. Direct-exposing MCP ports on the Pi is a bad idea; Caddy with automatic TLS is a five-minute install and eliminates a whole class of misconfiguration.
  • Forgetting to isolate the shell-runner MCP server. Give it a scoped user with nosuid mount options. An unrestricted shell tool is the exact wrong thing to expose to any LLM.
  • Underestimating log volume. Background jobs generate a lot of logs. Rotate aggressively with logrotate or you'll be surprised how quickly the NVMe fills.

When the Pi is no longer enough

Move up when:

  • More than ~20 concurrent MCP requests per second. The Pi's networking stack starts to feel it around then.
  • You want to co-locate a real LLM on the same box. The Pi has no PCIe worth using; add a mini-PC or the RTX box next to it.
  • You need HA. Two Pis in a failover pair works but a $250 mini-PC gives you the memory headroom to skip the failover complexity.

For solo builders and small teams the Pi 4 8GB is the right first host — cheap, silent, and adequate.

Bottom line

Gemini's MCP + background-execution combo is worth adopting; the pattern gets meaningfully better once you have a small always-on host to run your tool servers and background jobs. A Pi 4 8GB does the job for well under $200, and pairing it with a used RTX 3060 12GB box gives you a local-model tier when the workflow needs one. Start with the Pi, add the GPU when you feel the limits.

Related guides

Citations and sources

This piece is editorial synthesis based on publicly available information. No independent first-party benchmarking is reported.

Products mentioned in this article

Tap any product for full specs, live Amazon & eBay pricing, and alternatives.

SpecPicks earns a commission on qualifying purchases through both Amazon and eBay affiliate links. Prices and stock update independently.

Watch a review

What the 5800X Should Have Been: AMD Ryzen 7 5700X CPU Review & Benchmarks — Gamers Nexus on YouTube

Frequently asked questions

Do I need a GPU to run an MCP server locally?
No — an MCP server is a lightweight tool/resource endpoint that a model calls; it runs fine on a Raspberry Pi 4 8GB or any small box. You only need a GPU when the agent's reasoning model runs locally too. Many builders split it: a Pi hosts the MCP tools while a separate GPU rig or a cloud API supplies the model brain.
What does 'background execution' change for agent builders?
Background execution lets managed agents keep working on long-running tasks without a held-open request, so an agent can plan, call tools, and resume across minutes rather than a single synchronous call. For self-hosters it raises the bar: your local MCP servers must stay available and stateful for the duration, favoring an always-on low-power host.
Can a Raspberry Pi 4 8GB really keep up as an MCP host?
For I/O-bound tool servers — file access, web fetches, database queries, shell wrappers — yes, the Pi 4 8GB is adequate and sips power. It is not the place to run the inference model itself; heavy token generation belongs on a GPU box. The Pi's value is being an always-on, cheap, low-heat endpoint the agent can call.
How much VRAM does a local agent 'brain' need on a 3060?
A 12GB RTX 3060 hosts 7B-14B models at q4-q5 with room for a few thousand tokens of context, which covers most tool-using agent loops. Larger 30B-class models need offload or a bigger card. For agentic coding the sweet spot on a 3060 is a well-quantized 14B model kept resident to avoid reload latency between tool calls.
Is a fast SSD important for an agent host?
Yes for the model box — an NVMe like the Samsung 970 EVO Plus cuts model cold-load time and speeds up any RAG or vector-store reads the agent triggers. The Pi-side MCP host benefits less from raw speed but still wants a reliable boot medium; SD-card wear is a real failure mode for always-on services.

Sources

— SpecPicks Editorial · Last verified 2026-07-08

Ryzen 7 5700X
Ryzen 7 5700X
$224.00
View price →

More guides & deep dives from the SpecPicks archive

Browse all articles & guides →

More reviews from the SpecPicks archive

Browse all reviews →

More buying guides from SpecPicks

Browse all buying guides →