Welcome to FlowZap, the App to diagram with Speed, Clarity and Control.

MCP Gateway Proxy Architecture

DevOps

An API gateway pattern that sits between agents and MCP servers to handle authentication, rate limits, and auditing. The gateway enforces OAuth 2.0, SAML, SSO, tool-level rate limiting, and team-based quotas. Essential for multi-team or multi-tenant MCP deployments.

Full FlowZap Code

Host { # Host Application
  n1: circle label="User sends prompt"
  n2: rectangle label="Agent builds tool call"
  n3: rectangle label="Send request to gateway"
  n4: rectangle label="Receive gateway response"
  n5: rectangle label="Agent responds to user"
  n1.handle(right) -> n2.handle(left)
  n2.handle(right) -> n3.handle(left)
  n3.handle(bottom) -> Gateway.n6.handle(top) [label="Tool request"]
  n4.handle(right) -> n5.handle(left)
}

Gateway { # MCP Gateway
  n6: rectangle label="Receive and log request"
  n7: diamond label="Authorized?"
  n8: rectangle label="Forward to MCP server"
  n9: rectangle label="Receive MCP response"
  n10: rectangle label="Log response and return"
  n6.handle(right) -> n7.handle(left)
  n7.handle(right) -> n8.handle(left) [label="Yes"]
  n7.handle(top) -> Host.n4.handle(left) [label="401 Unauthorized"]
  n8.handle(bottom) -> MCPServer.n11.handle(top) [label="Forwarded request"]
  n9.handle(right) -> n10.handle(left)
  n10.handle(top) -> Host.n4.handle(bottom) [label="Authorized response"]
}

MCPServer { # MCP Server
  n11: rectangle label="Execute tool"
  n12: rectangle label="Return result"
  n11.handle(right) -> n12.handle(left)
  n12.handle(top) -> Gateway.n9.handle(bottom) [label="Tool result"]
}

Related templates

MCP Direct Connect Architecture

DevOps

The simplest MCP pattern — direct connection between host application and MCP server over stdio or HTTP. No extra hops, lowest latency, easiest debugging. Perfect for MVPs, hackathons, and single-team setups where security governance is not yet a concern.

MCP Tool Router Architecture

DevOps

A routing pattern that puts a semantic router in front of MCP tools so the LLM only sees the subset it needs. Uses vector embeddings and cosine similarity to match user intent to tools dynamically. Achieves up to 96% reduction in input tokens when dealing with large tool catalogs.

MCP Agent Mesh Architecture

DevOps

A multi-agent mesh pattern where agents communicate through a shared context broker backed by MCP. Enables coordinated tool access and state synchronization across multiple specialized agents (planner, coder, reviewer, operator). Supports both orchestrated and choreographed interaction patterns.

MCP Circuit Breaker Architecture

DevOps

A resilience pattern that wraps MCP calls with health-aware gates using three states: Closed (normal), Open (failures detected, fast-fail), and Half-Open (testing recovery). Prevents cascading failures when tools become unresponsive. Essential for production-grade reliability.

MCP Context Proxy Architecture

DevOps

A caching and compression layer that sits between agents and MCP servers, intercepting redundant context requests before they hit the wire. Uses TTL-based cache invalidation, Brotli compression, and semantic caching. Can achieve up to 95%+ token reduction and significantly lower LLM bills.

Microservices API Gateway Architecture

Architecture

A microservices API gateway architecture diagram showing request routing, JWT authentication, rate limiting, service discovery, and response aggregation across distributed backend services. This template models the entry point for all client traffic in a microservices ecosystem, enforcing security policies before requests reach internal services. Ideal for platform engineers designing scalable API infrastructure with centralized cross-cutting concerns.

Back to all templates