
Intro
The Model Context Protocol (MCP) is supposed to be the clean way to connect AI agents to your tools — Jira, Cloudflare, Bitbucket, whatever. Typed tools, auto-discovery, one protocol instead of a pile of custom glue code. On paper it’s exactly what an agent wants.
In practice, after a few weeks of real use, I’ve quietly gone back to calling REST APIs directly — even for the things MCP was designed for. Here’s the whole story — the problems, the workarounds, and where I landed.
1. Claude Desktop is the worst offender
The desktop app is flaky at establishing and re-establishing MCP connections. A concrete example: my MCP connection had dropped, so I reconnected it through the Claude Desktop UI. Authentication succeeded — green light, all good. But Claude Code running inside Claude Desktop still insisted it couldn’t see the connected MCP session, and told me to restart Claude Desktop. No way. Re-authenticating in the UI simply doesn’t propagate to the agent that’s already running. On top of that, the app only surfaces a narrow set of managed connectors — not the arbitrary HTTP MCP servers I actually want to use.
2. The terminal works better — but it’s clumsy
A Claude Code session in a terminal connects MCP servers far more reliably. But the OAuth flow doesn’t open a browser for you: Claude prints an auth URL that I have to get into a browser by hand. Every time.
And even that is fiddly. In Claude Code under PowerShell, Ctrl-clicking the auth URL doesn’t work when the long URL wraps across lines — the terminal tries to open just the first-line fragment, which fails. The trick that does work: press c to copy the full URL to the clipboard, then paste it into a browser. This is a known, still-open Claude Code bug — long URLs break on Ctrl-click and on copy because of terminal line wrapping (the URL isn’t emitted as a proper OSC 8 hyperlink). See Claude Code issue #62678 and #23804.
It works, but “copy this URL into a browser by hand” is not the autonomous future we were promised.
3. Mid-session, the connection just dies
This is the real problem. MCP servers authenticate via OAuth and are bound to the process that spawned them. The token is short-lived and can’t be refreshed mid-session. So during a long agent run, the MCP works for dozens of calls — and then every call returns 401. Re-authenticating in another app doesn’t help. The only fix is restarting the whole session.
And this isn’t a me-problem. As of early 2026, not a single major MCP client fully implements OAuth refresh tokens. Claude Code, Claude Desktop, Cursor, Amazon Q CLI — none of them refresh cleanly mid-session. It’s a known, documented gap across the ecosystem.
4. Why I can’t see MCP working for autonomous agents — yet
Interactive work is one thing: a human is sitting there to re-auth or restart when the token dies. But an autonomous agent — OpenClaw, Hermes, anything running on a schedule — has no human to click the link. An auth model that silently expires mid-run and needs a manual restart is, for unattended automation, a guaranteed failure point.
5. My workarounds
Plain REST with a long-lived token
For anything long-running or unattended, I skip MCP and use the plain REST API with a long-lived token (you can mint one valid for ~a year). It’s less elegant — I lose the nice typed tools — but it survives outages, long sessions, and cron jobs. Reliability beats elegance.
Not tested yet: mcp-remote
There’s one mitigation I’m looking at but haven’t tested yet: mcp-remote, a community OAuth proxy that wraps the MCP connection and handles token rotation, so the agent doesn’t depend on the client refreshing tokens itself. On paper it’s the missing piece. Whether it actually keeps a session alive across a long autonomous run, I can’t tell you yet — I’ll report back once I’ve tried it.
Found by accident: keeping the laptop awake
A second workaround landed by accident. I’d configured PowerToys Awake to stop my laptop from sleeping — originally so my remote-control session wouldn’t drop — and then noticed my MCP connections survived for two days straight. That makes sense: sleep tears down the network connection the MCP session rides on, and Claude Code doesn’t reliably re-establish it on wake. Keep the machine awake and you sidestep that whole class of disconnects. Two caveats: it only prevents sleep-induced drops, not token expiry — and you pay for it in power consumption, which is a real cost on a laptop.
6. My rule of thumb
The rule of thumb I follow:
- Interactive, exploratory work → MCP, but do the MCP-heavy steps early before the token ages out, and keep a REST fallback ready.
- Autonomous / long-running / scheduled → REST with a long-lived token by default. MCP only where discovery genuinely pays off, wrapped in retries and a fallback.
The line I’ve settled on isn’t really MCP vs REST — it’s how predictable the task is. If I can write the steps down as a script, REST with a long-lived token wins: deterministic, debuggable, and it survives long sessions and cron jobs. MCP earns its keep at the other end — open-ended work where the agent has to discover which tools exist and decide which to use. Troubleshooting is the perfect case: “something’s broken on my Kubernetes cluster — find out what and fix it with whatever tools you have.” You can’t script that, and that’s exactly where MCP’s dynamic tool discovery pays off.
I still think MCP is the right idea — the protocol is fine. It’s the client-side OAuth story that isn’t ready for unattended use yet. Until clients ship proper token refresh, that’s the split I live by: REST when the task is predictable, MCP when it’s exploratory.
7. Afterthought: one thing I’d change in the spec
MCP standardized on OAuth 2.1 for remote servers, and for the mass-market case — connecting your AI to a SaaS you don’t control — that’s the right call: short-lived tokens, PKCE, nothing long-lived to leak. But it under-serves the other half of the world: self-hosted servers and trusted backend automation, where I am the admin and a browser consent dance every hour is pure friction.
The fix isn’t to throw out OAuth. It’s two things:
- Let the server admin choose the profile. For self-hosted or internal use, bless an optional long-lived-token (or service-account) profile a server can advertise — the way GitHub and GitLab offer personal access tokens alongside OAuth. If MCP offered that, I’d use it.
- Use — and actually implement —
client_credentials. OAuth already has a machine-to-machine grant built for exactly this: a service identity, no browser, tokens issued and refreshed automatically. It’s in the spec. The only reason it doesn’t save me today is that the clients don’t implement refresh. So half of this is a spec nudge, half is just clients finishing the job.
Because here’s the honest version of what I’m asking for: I don’t really want a long-lived token. I want access that doesn’t silently die in the middle of a task. A static token is just the bluntest way to get there — and right now it’s the only one that reliably works.
Your turn
Have you hit the same wall? What’s your strategy for keeping MCP sessions alive — or have you also fallen back to REST for the serious automation? And would you use a long-lived or service-account auth option if MCP servers offered one?
First published on LinkedIn on June 5, 2026.