What Is an MCP Gateway (and Why You Need One)
MCP connects agents to tools — a gateway adds policy, metering, and audit in one place.

The Model Context Protocol (MCP) lets AI hosts discover and call tools over a standard wire format. A gateway is the policy and metering layer in front of those tools.
MCP without a gateway
Each host talks directly to every tool backend. You duplicate auth, logging, and rate limits per integration. Cost controls live far from where traffic multiplies.
MCP with SmartGate
Agent host → SmartGate MCP (one URL, one API key) → smart_* toolsOne connection gives you:
- Unified Bearer auth and team isolation
- Compression and dedup before content bloats context
- Budget guard and audit trails in the Dashboard
- Seven tools with consistent schemas on
tools/list
SmartGate is not an LLM proxy — you keep Cursor, Claude, or OpenClaw for the model; SmartGate shapes tool traffic.
Next steps
- Overview — tools and plans
- MCP Endpoint — URLs and protocol
- Get started free
MCP in one paragraph
The Model Context Protocol is the wire format an AI host uses to discover and call tools it did not ship with. A host speaks JSON-RPC shapes for initialize, tools/list, and tools/call. An MCP server exposes tools, resources, and prompts behind that contract. SmartGate hosts a remote MCP server over Streamable HTTP so many clients can share one governed origin.
What a gateway adds
Without a gateway, every agent re-implements auth, metering, logging, and rate limits per tool backend. Cost controls often sit only at the model API—too late for tool-output bloat. A gateway centralizes Bearer auth, team isolation, compression, dedup, budget guard, memory, and pipe orchestration, then writes audit rows your FinOps and security stakeholders can query.
SmartGate's category line
SmartGate is an MCP-native algorithmic gateway and intelligence layer between AI and the world. It is not:
- Another AI assistant or ChatGPT alternative
- An AI search engine product for end consumers alone
- An LLM proxy or model router (keep your host model)
- A generic API gateway that only understands HTTP routes
Marketing language prefers five capabilities powered by seven primitives over a bare "seven tools" dump. Mechanism belongs in Docs; outcomes belong on Solutions and Features.
Architecture sketch
Human Web / App ──┐
├── SmartGate runtime (search, fetch, dedup, context, memory, budget, pipe)
Agent MCP / API ──┘ │
▼
Host models / worldAdoption sequence
- Read this primer for shared vocabulary with stakeholders.
- Connect a host (Connect Guide).
- Run bounded calls; inspect Activity Logs.
- Enable Token Control and Traffic Customs patterns.
- Align plan entitlements on /pricing.
Governance notes
Fair-use Free/Playground limits soft-fail with HTTP 429. Retention follows plan catalog days. Est. USD saved is a gateway counterfactual. Do not publish invented concurrent capacity or customer logos when you describe the gateway internally.
How the runtime is assembled at the edge
SmartGate ships its web surface as a Next.js 15 App Router application compiled for Cloudflare Workers through OpenNext. open-next.config.ts calls defineCloudflareConfig({}) from @opennextjs/cloudflare/config, and wrangler.jsonc names the worker smartgatepro-worker-preview, points main at workers/smartgate-entry.ts, and pins compatibility_date to 2026-03-04 with the flags nodejs_compat, global_fetch_strictly_public, and no_handle_cross_request_promise_resolution. That date is the runtime vintage the build targets, and the flags opt into Node built-ins, strict public fetch semantics, and a promise-resolution boundary that keeps cross-request work from leaking between invocations.
Static output is served from .open-next/assets through an ASSETS binding, and an AuditReadGateway Durable Object is bound as AUDIT_READ_GATEWAY with the v1-audit-read-gateway migration declaring it a new SQLite class—that tag is what lets the audit read path be deployed independently of the request path. workers/smartgate-entry.ts wraps the generated ../.open-next/worker.js, re-exports DOQueueHandler, DOShardedTagCache, and BucketCachePurge, and exposes the Durable Object alongside them. Every response then passes through injectTrustedTypesBootstrap, which installs a Trusted Types bootstrap script on all HTML responses—including OpenNext soft-404 shells—so the response contract holds even when a route renders an error page.
One stateless endpoint, one module registry
MCP is served from a single path. backend/smartgate/api/mcp.py builds a FastMCP instance named "SmartGate" with stateless_http=True and json_response=True, sets streamable_http_path="/", and mounts it so the public endpoint is exactly POST /mcp over Streamable HTTP. A no-op Starlette lifespan context manager disables a nested lifespan on the mounted sub-app, and register_mcp_tools registers all seven smart_* tools on that one server. The server binds to 0.0.0.0 deliberately, which keeps FastMCP from auto-enabling its loopback-only DNS-rebinding guard and lets hosts on the same network reach the endpoint.
Each tool resolves its work through the registry rather than embedding it. core/registry.py defines ModuleRegistry, which stores modules keyed by module.name and offers register, get, initialize_all, and shutdown_all. A get(name) miss raises a KeyError that lists the available module names, so a misconfigured dependency fails loudly instead of silently returning nothing. Tool handlers in mcp.py call registry.get("fetch"), registry.get("search"), registry.get("context_gate"), registry.get("dedup"), registry.get("budget_guard"), or registry.get("memory"), while smart_pipe constructs a PipelineEngine over the same registry. Team scoping is inherited too: the tool context falls back to the bound tenant when no override is passed, and the audit path re-binds the mcp route before writes. The registry also owns lifecycle—initialize_all walks every registered module once resources are ready and shutdown_all tears them down together, which is why adding a primitive is a registration change rather than a routing change. Rate limiting stays narrow: the tool rate helper guards only search and fetch, and every other tool flows through the audited execution wrapper, which writes the audit row before the tool returns.
Continue
- What Is an MCP Gateway? (topic library) when available in the industries hub
- Overview
- Audit & Compliance
- Introducing SmartGate
Operational playbook (shared across posts)
Treat SmartGate as shared intelligence infrastructure: one gateway URL, team-scoped keys, audit on by default. Prefer official pipe templates for recurring research so Activity Logs show a coherent chain. Keep host-model prompts focused on decisions; let Research and Context primitives prepare evidence. When FinOps asks for savings, export Usage Reports alongside an explanation that Est. USD saved is a gateway counterfactual. When security asks for evidence, export an audit window and cite retention tied to the plan catalog.
If you are migrating from scripts, replace raw HTTP fetch helpers first, then add dedup and compression, then budget guard. If you are migrating from a model-gateway mindset, stop expecting chat completions on /api/mcp and wire MCP hosts instead. If you are writing internal enablement copy, lead with Smart Research / Smart Decision outcomes for humans and with the five-capability runtime for builders.
Document team naming, key rotation, and who owns Gainshare questions before you scale agent count. Prefer bounded Playground or single-tool MCP checks when validating Connect JSON. Prefer exporting Activity Logs before plan downgrades that shorten retention. These habits prevent the two failure modes we see most: empty tool lists from incomplete MCP initialize, and missing audit evidence when a reviewer asks what an agent fetched last week.
English-first public materials stay aligned with the Positioning Bible: SmartGate is an MCP-native algorithmic gateway and intelligence layer—not a chatbot, ChatGPT alternative, AI search engine, LLM proxy, or model router. Humans research and decide through Web experiences; agents connect through MCP/API; both share the same runtime primitives and team-scoped governance.
Checklist before you ship an agent to production
- Connect JSON copied from Dashboard for the correct deployment URL.
tools/listreturns the sevensmart_*tools on the intended host.- At least one successful audited call visible in Activity Logs.
- Budget guard used before expensive jobs; optional hard cap understood for your plan.
- Team roles and key ownership written down (Teams).
- Retention window acceptable for your compliance review cycle.
- Fair-use vs paid RPM expectations communicated to builders.
- Support contact and billing owner identified (Contact).
Further product links
Closing note for operators
Ship the smallest honest loop first: Connect, one audited tool call, one compress or dedup decision, one budget check. Expand to pipes and shared team keys only after Activity Logs show the shape you expect. Keep public claims inside Positioning Bible boundaries—intelligence layer, five capabilities, seven primitives—and keep secrets out of tickets and blog comments. If something in Docs and a post disagree, Docs and the plan catalog win.
Need help wiring this up? Use Quick Start, Connect Guide, and MCP Endpoint, then email support@smartgate.network with host name, failure mode (auth, tools, limits), and a redacted Activity Log request id—never a live API key. For billing or Enterprise process questions, prefer Contact channels so the right inbox owns the thread.