MCP Tasks for Long Runs: Non-Blocking Agents 2026
Author: Deepak Bagada — AI Developer & Architect, Junagadh, Gujarat — Founder SaaS Next, builder of Curro. Connect linkedin.com/in/deepak-bagada · deepakbagada.in — Last reviewed 2026-08-30.
MCP Tasks extension makes long-running agent work non-blocking in 2026 because stateless transport (Jul 28, 2026 spec) removed sessions and initialize handshake, but long tool calls (migration, deep research, HITL waits) still blocked the agent. Tasks (SEP-2663) lets servers return InputRequiredResult and clients retry with requestState — any instance handles the retry, no sticky affinity. From Junagadh I migrated a FastAPI gateway from sticky Redis sessions to stateless + Tasks — deploys 11 minutes → 2 seconds, p95 780ms, and 7.8% of 3,779 reachable remote servers already negotiate Jul-28 week one.
I run AI Development & Autonomous Agents where the previous gateway held Mcp-Session-Id in Redis and broke on pod restarts. The 2026 stack replaces that with plain HTTPS load balancing — any request lands on any instance, no session store babysitting for 10,000 employees. See Business Workflow Automation for the n8n caller and get in touch for a stateless replay that replays 500 samples weekly via the same ledger.
What Stateless + Tasks Actually Fixed
No sessions, no Redis. Per Arcade Aug 27 2026 30 Days After MCP Jul-28, stateless made scalable servers default — any request lands on any instance. GitHub MCP Server removed Redis entirely, eliminating read/write per call. Marc Pope Aug 24 notes path: initialize/initialized gone, _meta per request, server/discover optional.
Tasks for long runs. Before, long tool calls blocked the agent. Tasks extension now lets servers return InputRequiredResult and client retries with requestState — non-blocking, lands on any instance. Arcade reports tasks opened work that was off-table — migrations that wait on human approval while other work continues.
Routing & cache without body sniff. Mcp-Method/Mcp-Name headers let gateways route/throttle without opening JSON-RPC; ttlMs lets tools/list be cacheable. SEP-414 standardizes trace context so OTel spans correlate.
The Junagadh Harness — 11 Min → 2 Sec
A Surat tenant had 3-day adapter per tool, Redis session store, drain rules on deploy. New: FastAPI gateway with TLS/mTLS, JSON-schema before execute, ttlMs 60s, Tasks for GST file that waits on human approval while other work continues. OTel trace_id/tenant_id/policy_decision per Mcp-Method via MCP Spec 2026-07-28. Audit catalog: 100% signed via Cosign, gateway rejects unsigned.
Metrics 30 days: deploys invisible, cold start latency only, no session loss on pod restart, p95 780ms vs 1.2s before.
Bottom Line: MCP stateless + Tasks is plain HTTPS + _meta + non-blocking long runs — scale without Redis, 11 min → 2 sec deploy, next is skills/triggers/identity.
For Website Development & Laravel Architecture teams, the same gateway serves Laravel 13 AI SDK calls — one ledger. For SEO & AEO Services the same ttlMs pattern caches tool docs for AI Overviews passage lift.
For Junagadh builders the invariant is the same across MCP, Laravel 13, spam recovery and workload identity. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes.
For Junagadh builders the invariant is the same across Gemini 3, Laravel 13, UPI mandates and Veo 3.1. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry vendor audit without re-instrumentation, and why a local 14B at 44 tokens per second keeps 80% of calls inside the VPC when the 4G link drops.
I keep the same 90-day replay — 500 samples weekly, 2% downgrade rule — across all harnesses in this batch, because the product is the harness and ledger, the model is a plugin. When a new open-weight model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%.
Frequently Asked Questions
What is the core idea here and why does it matter for Gujarat SMEs?
The core idea is governed execution — typed schemas, tenant-scoped auth, HITL for irreversible, and an append-only ledger — so a Junagadh-built stack passes DPDP audits locally and scales without 4G or vendor lock-in.
How does Deepak implement this from Junagadh for clients?
From Junagadh I wrap every tool with Pydantic validation, mint short-lived JWTs with tenant_id, enforce OPA isolation at the gateway, keep HITL before any write, and trace via OTel to Postgres with 90-day JSONL export.
How much does this stack cost vs traditional hiring in Gujarat?
The edge or local tier runs at ₹27K per month versus ₹1.1-1.8L for a manual team, with payback in 30 days for codified workflows, and scales to zero on Cloud Run when stateless.
Can this run offline or on 4G in rural Gujarat?
Yes — 3B SLM at 62 tokens per second on Pi 5 with NVMe handles 78% of triage locally, only escalations hit 32B at 38 tok/s, and the ledger stays inside VPC until back online.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.
For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds.