Three Major Pitfalls of Remote MCP Servers
Objective_Speed_5885 · reddit · 2026-07-18
The author summarizes three key pitfalls encountered when building a remote MCP server:
- Remote services must use OAuth 2.1: The server doesn't issue tokens but validates tokens issued by an external authorization server, using protected-resource metadata to tell the client where to authenticate.
- stdout cannot be misused under stdio: Any console.log can break the protocol stream; logs must be written to stderr.
- Tools should be as "thin" as possible: Splitting a large, catch-all managenotes(action, ...) into multiple narrow tools and adding clear constraints to each field significantly improves model selection and reduces parameter hallucinations.
The author also turned the whole setup into a reusable template: including an OAuth verifier (JWKS + RFC 7662), two transport types, session management, a demo AS, Docker/Fly configurations, and 42 tests covering the entire flow from registration to PKCE and MCP calls.
More from coding & agent
- GPT-6 Astra beats Factorio with enemies in 44 in-game hours at ~$4,500 API cost — liminal_bardo · 2026-09-11
- Investment Analyst Asks How to Build a Claude-Based Diligence Agent Stack — Careless_Tie2286 · 2026-09-11
- How Do You Catch Behavioral Regressions in LLM Agents Between Releases? — Beautiful_Belt_601 · 2026-09-11
- Treating agents like 50 First Dates: a 3-layer context system so every conversation doesn't start from zero — evielync · 2026-09-11
- Running the Firefox MCP on Android via Termux, ngrok, and mcp-proxy — Nervous-Strain7544 · 2026-09-11
- Run Firefox MCP on Android: Termux + ngrok tunnel tutorial — Nervous-Strain7544 · 2026-09-11