Skip to lesson
supraj.dev THE ENGINEERING HANDBOOKS
LEARN / BUILD / VERIFY2026 edition · checked 06 Oct

CHAPTER 24 / 30 · Operate the integration

Deploying a stateless protocol service

Separate request handling from durable application state and tenant authority.

4 min read + practiceWorked exerciseInterview practice

The mechanism

Stateless protocol requests can simplify load balancing, but the application still owns durable business state. Incident records, approvals, idempotency records and task handles must remain consistent across workers. A request that reaches another instance must not lose its authorization or duplicate an effect.

Derive tenant identity from authenticated context. Do not trust a model-supplied tenant_id as the source of authority. Bind database queries, caches and operation records to the same verified context. Test isolation across tenants and across different grants within one tenant.

Control-plane configuration and execution-plane access should have different privileges. The service that approves which tools are available does not need unrestricted access to every incident record, and a worker does not need permission to change global policy.

Authenticated ingress
Request worker
Scoped durable state
Restricted dependencies

Worked example

This is a deployment boundary map, not a cloud provisioning plan. No infrastructure is created by the handbook. Each arrow should receive an identity, timeout and failure policy before production implementation.

Host -> authenticated MCP ingress -> bounded worker
Worker -> tenant-scoped incident store
Worker -> approval + idempotency store
Worker -> redacted telemetry
Control plane -> reviewed capability and policy configuration
No worker path -> global policy administration

Practice: predict, inspect, explain

Offline exercise. Route two attempts of the same intended write to different workers. Explain where deduplication must live. Then use the same incident ID in two synthetic tenants and show why the cache and storage keys must not collide.

Expected observation: process-local state is insufficient for distributed guarantees. Add a restart between approval and execution and define how the second worker validates the same intent. Keep proposed deployment claims separate from fixture checks until real failure and concurrency tests exist.

Troubleshooting and trade-offs

If a horizontally scaled service works only with sticky sessions, identify which application state depends on one process. Do not confuse that limitation with a protocol requirement. If workers inherit administrator credentials, reduce their identity and dependency scope. Define quotas for request size, concurrency, duration and output volume before admitting untrusted callers.

Interview practice

Does stateless MCP eliminate databases?

No. It removes dependence on a protocol session for understanding requests. Durable business state and distributed coordination remain application responsibilities.

Where should tenant identity come from?

Verified authentication and authorization context, then enforced consistently at data, cache and operation boundaries. A request argument alone is not authoritative.

Completion check

Demonstrate a two-worker retry design and a cross-tenant negative test on paper.

Sources and version notes

This edition targets MCP 2026-07-28, checked 6 October 2026. SDK examples are version-sensitive and labelled when not executed. Synthetic fixtures are learning material, not protocol conformance evidence.

YOUR NEXT STEP

Make the understanding yours.

Use the completion check above. Mark this chapter when you can explain the mechanism and its limits.

Self-assessed reading progress. This does not certify that a lab ran or a system is secure.