#code
Why I Self-Host Every MCP Server I Use with Claude Code
Most MCP guides are lists of servers to install. I run almost none off-the-shelf — I wrote my own instead.
I keep two Claude profiles: personal, and work in a separate macOS user account (Securify). Managed connectors tie their auth to a profile and session, so across two profiles on two machines they keep dropping it: a token expires or a profile grabs the wrong credential, and you're logging in again instead of working. The fix is to move the auth off the client and onto the server, where switching profiles or machines doesn't touch it.
Each server is a small Cloud Run service, same shape every time:
- Dual transport — stdio for local, Streamable HTTP for remote, same logic behind both.
- A fixed domain per server, so the URL survives a backend rewrite.
- Secrets injected from a secret manager at deploy. The server holds the auth; the client just hits a URL.
Client side, that's one line:
claude mcp add --transport http linear https://my-linear-server/mcp -s user
What I run, about eighty tools total: Linear (agents read and file issues), Notion (shared context), Perplexity and Firebase (research, product data), and email/Telegram/support inbox.
What I left off-the-shelf, because they don't have the auth problem: GitHub (token-based), Puppeteer/chrome-control (screenshots, UI checks), and Context7 (current docs). They install with npx.
It's worth it only at this scale — many agents, many machines. One laptop and one account: managed connectors are fine. I switched when I was spending more time fixing connector auth than using it.