Vol. 01 — 2026

MCP Security 2026: OAuth, Scoped JWT & Catalog Governance

MCP Security 2026: OAuth, Scoped JWT & Catalog Governance

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-29.

MCP security in 2026 needs OAuth, scoped JWT and catalog governance because the protocol now counts 500+ servers and dozens of clients, and enterprises have moved from POC to production where audit logs, RBAC and private transports are mandatory. From Junagadh I migrated a brittle mess of custom OpenAI wrappers to MCP-native — deployment time for new tool integrations dropped from three days to eleven minutes — by putting a FastAPI gateway with TLS/mTLS, rate limiting and JSON-schema validation before any tool executes. The catalog signs every server; the gateway rejects unsigned.

I run AI Development & Autonomous Agents where the first zero-trust failure in March 2026 was a leaked DB credential in a prompt after two days of direct-prompt tool wiring. That failure became our enterprise template: catalog, gateway, RBAC and lifecycle, now with OAuth scopes. See featured projects for hardened servers and get in touch for a security audit that replays 50 hostile prompts in staging.

The Three Pillars — What Production Actually Enforces

OAuth + JWT scopes per session. Tools declare scopes inventory:read, invoices:write, payments:initiate. The gateway mints short-lived JWTs per agent session with explicit scopes and tenant_id. A customer-support agent can query_order_status but cannot refund_payment. The gateway validates Pydantic schema before execution, so prompt injection cannot escalate scope. For SEO & AEO Services crawlers, same scopes gate AI crawler access.

OPA tenant isolation. OPA/Rego policies check tenant isolation before any tool executes. A Surat tenant's agent cannot enumerate Mumbai's MCP resources even if it guesses an ID — policy denies at gateway, not inside LLM. That is the POSIX-like boundary MCP gives you.

Catalog governance + lifecycle. Dev → Staging (50 hostile prompts) → Signed via Cosign → Prod. Gateway rejects unsigned servers. Rollback is catalog pointer flip in two seconds. That is how a regulated client survives audit without data residency breach — all components run inside client's VPC in Gujarat, and credentials never enter prompts via Business Workflow Automation.

Harness That Holds — 3 Days → 11 Minutes

Before: custom OpenAI function adapter per tool — 3 days per integration, no versioning. After: MCP server with FastAPI gateway, TLS/mTLS between agents and tools, rate limiting, JSON-schema validation before any tool executes, OTel trace_id per Mcp-Method. New tool is a new MCP server, signed, cataloged, gateway-allowed in 11 minutes. Audit needs: OTel trace_id/tenant_id/policy_decision per MCP Spec 2026-07-28 OTel.

from fastapi import FastAPI
from pydantic import BaseModel
class ToolCall(BaseModel):
    tool: str
    tenant_id: str
    scope: str
def gate(call: ToolCall, jwt_scope: str):
    assert call.scope in jwt_scope
    assert call.tenant_id == jwt_scope.split(':')[1]
    return call

Bottom Line: MCP 500+ servers in 2026 needs OAuth scopes + OPA + catalog-signed servers — gateway mints JWT per session, Pydantic validates, OTel logs, unsigned rejected, 11-min deploy.

For Junagadh builders the invariant is the same across Mastra, OpenAI SDK, zero-trust and vibe coding. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision.

For Junagadh builders the invariant is the same across MCP, Laravel 13, RBI mandates and YouTube citations. 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's 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. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation. I keep the 90-day replay — 500 samples weekly, 2% downgrade rule — because the product is the harness and ledger, the model is a plugin. When a new model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%. From Junagadh I ship this with VPC Postgres, pgvector HNSW and HITL gates so Gujarat SMEs can audit in one JSONL.

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. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation. I keep the 90-day replay — 500 samples weekly, 2% downgrade rule — because the product is the harness and ledger, the model is a plugin. When a new model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%. From Junagadh I ship this with VPC Postgres, pgvector HNSW and HITL gates so Gujarat SMEs can audit in one JSONL.

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. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation. I keep the 90-day replay — 500 samples weekly, 2% downgrade rule — because the product is the harness and ledger, the model is a plugin. When a new model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%. From Junagadh I ship this with VPC Postgres, pgvector HNSW and HITL gates so Gujarat SMEs can audit in one JSONL.

← All journal articles Get in touch →