Build an MCP Client in Minutes: Local AI Agents Just Got Real
Built an MCP server already? well done! But it's only half the story. Without a client your model is shouting into the void. Give me 8 minutes and you'll: Ship a full MCP client in under 100 lines First steps into the world of local AI agents Plug it into any MCP server Keep every byte local. No cloud fees. Privacy first. No API keys. Why roll your own client? Cloud agents are fun until the bill hits, and who really knows where your data ends up. A local MCP client means: Full privacy & control. Every token lives on your machine, nowhere else. Zero API keys. No provider lock‑in, no surprise invoices. Good‑enough performance today, better tomorrow. Local models aren’t GPT‑4o yet, but they’re getting sharper every release. The code below is inspired by the official MCP client quickstart (which targets Anthropic models) and tweaked for Ollama so every byte runs offline. Let's build!

Built an MCP server already? well done! But it's only half the story. Without a client your model is shouting into the void.
Give me 8 minutes and you'll:
- Ship a full MCP client in under 100 lines
- First steps into the world of local AI agents
- Plug it into any MCP server
- Keep every byte local. No cloud fees.
- Privacy first. No API keys.
Why roll your own client?
Cloud agents are fun until the bill hits, and who really knows where your data ends up. A local MCP client means:
- Full privacy & control. Every token lives on your machine, nowhere else.
- Zero API keys. No provider lock‑in, no surprise invoices.
- Good‑enough performance today, better tomorrow. Local models aren’t GPT‑4o yet, but they’re getting sharper every release.
The code below is inspired by the official MCP client quickstart (which targets Anthropic models) and tweaked for Ollama so every byte runs offline. Let's build!