Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 2 min read

Building 11 Zero-Proxy Remote MCP Servers in 256MB Containers (Architecture + Free Config Generator)

Most tutorials for Model Context Protocol (MCP) servers assume two things: Users want to install Node/Python locally and babysit stdio processes. Web-data tools need heavyweight Playwright containers and residential pr

Most tutorials for Model Context Protocol (MCP) servers assume two things:

  1. Users want to install Node/Python locally and babysit stdio processes.
  2. Web-data tools need heavyweight Playwright containers and residential proxies.

In practice, neither scales well for real AI agents in Claude Desktop, Cursor, Windsurf, or n8n.

Over the past week I built and deployed 11 hosted Streamable HTTP Remote MCP servers (/mcp), every single one running in a 256 MB Node.js 22 container with zero headless browsers and zero proxies.

Here are the architectural lessons that actually mattered in productionβ€”plus the open-source STDIO/HTTP bridge and a free 1-click JSON config generator.

1. Stateless Streamable HTTP (/mcp) Beats Long-Lived Sessions

For hosted remote MCP servers behind serverless/standby autoscalers, sticky in-memory sessions break on cold restarts. Using @modelcontextprotocol/sdk's StreamableHTTPServerTransport in stateless JSON-response mode (sessionIdGenerator: undefined, enableJsonResponse: true) creates a clean server + transport per request and tears it down cleanly on res.on('close').

Result: Zero memory leaks, sub-200ms warm tool execution, and 256 MB RAM ceiling.

2. Two-Stage Docker Builds Cut Image Size & Avoid NODE_ENV=production Traps

Base Node production images often run with NODE_ENV=production, causing npm install to silently skip TypeScript (tsc). Using a clean 2-stage Dockerfile (npm install --include=dev && npm run build in builder, copying only dist/ to the runtime stage with --omit=dev) keeps deployments fast and deterministic.

3. Real-World Public API Gotchas We Hit (So You Don't Have To)

  • Substack: /api/v1/archive migrated from offset= (now returns HTTP 400) to cursor=<nextCursor>.
  • Kalshi v2: Live prices now live in dollar-denominated fields (yes_bid_dollars, yes_ask_dollars) and querying /trade-api/v2/events?status=open&with_nested_markets=true avoids noisy combo-parlay clutter.
  • SEC EDGAR XBRL (companyfacts): Always merge across multiple US-GAAP revenue tags (Revenues, RevenueFromContractWithCustomerExcludingAssessedTax, SalesRevenueNet) and filter duration length (300+ days for annual 10-K) so prior-year comparative rows never overwrite current fiscal years.
  • Empty-Input QA Hardening: Always provide real default values in schemas and runtime fallbacks when {} is passed so automated health checks never fail.

Try Them Live or Generate Your MCP Config in 1 Click

If you are building automated workflows on top of these endpoints, I also bundled 5 ready-to-run self-hosted n8n workflows + Docker Compose here: https://fengyetnot.gumroad.com/l/skuqx

Curious what remote MCP data sources developers here still struggle to find without paying $200/mo in proxiesβ€”drop them below!

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.