Designing a Production-Grade MCP Server: 3 Principles for Unsupervised Agents
Capable-Necessary814 · reddit · 2026-08-01
The author shares insights from building the MCP (Model Context Protocol) server for Aethra, a self-hosted deploy platform. Unlike the 3,000+ read-only wrappers on the market, this server allows agents to trigger builds, swap production traffic, and provision databases. To leave it running unsupervised, the author highlights three core design decisions:
- Asymmetric Privileges: While the agent's API key carries granular deployment write scopes, endpoints for minting keys or reading secrets are strictly cookie-only. This structurally prevents a compromised agent key from escalating privileges or reading deployed credentials.
- Responses Include nextactions: Instead of exposing a flat REST surface, every tool response explicitly tells the agent what to call next, why, and with which suggested arguments. This prevents the model from hallucinating non-existent endpoints and offloading domain logic.
- Return Outcomes, Not Acknowledgements: The deployment tool doesn't just return a 201 Queued; it waits and returns the actual health check result (including container output on failure). This ensures the agent reports the actual state rather than blindly narrating based on HTTP status codes.
Furthermore, the author abandoned the stateless spec, embedding the MCP server in the same process as the resource authorization, using a single Postgres transaction for scope checks and mutations to eliminate cache coherency issues at the cost of horizontal scaling.
More from coding & agent
- SuperDev: Open-Source MCP Server Giving AI Agents Runtime Breakpoints & Browser Control — Tough-Reach1134 · 2026-08-01
- ChicagoHAI Explores Using Agents to Evaluate Model Behavior Trustworthiness — ChenhaoTan · 2026-08-01
- Voice Agent in Production for 5 Weeks: Why Prompt Guardrails Fail and Server-Side Checks Win — Dustersvk · 2026-08-01
- Enterprise AI Dilemma: Build a Bespoke Agent Harness or a Meta-Harness? — JouVashOnGold · 2026-08-01
- Automating Frontend Design: An Agent Workflow with MCP and Cron Jobs — EXM7777 · 2026-08-01
- Driving Fuzzing with Claude Code to Automatically Find and Fix Bugs — ricklamers · 2026-08-01