What is an MCP gateway, and how do I govern MCP tool calls?
Put your MCP servers behind Cognocient AI: per-server tool allow and deny lists, argument scanning for PII and secrets, per-call pricing, budgets and full attribution for every agent tool call. Business plan.
Agents that call tools are a spend and data-exposure surface of their own. The gateway gives MCP servers the same controls your model traffic already has.
Add a server
Open Control → MCP Gateway → Add server:
| Field | Meaning |
|---|---|
| Name | Becomes the gateway URL: https://api.cognocient.com/mcp/<name> |
| Server URL | Your server's Streamable HTTP endpoint. Public HTTPS only. |
| Credential header and value | The server's own auth (for example Authorization: Bearer …). Encrypted, injected by the gateway. Agents never hold it. |
| Tool policy | Allow every tool except those denied, or allow only those listed |
| Cost per tool call | Optional, for paid tools |
| Scan arguments | Check tool arguments for PII and secrets (on by default) |
Use Discover tools to list what the server offers and click tools to build the policy from real names.
Connect an agent
Point your MCP client at the gateway URL and authenticate with your Cognocient AI key (or a JWT) as the bearer token. The Cognocient AI key is never forwarded to your server.
What is enforced
- Authentication, Emergency Freeze, rate limits and budgets: the same as model traffic.
- Tool policy: a denied
tools/callreturns a JSON-RPC error (-32001) and never reaches the server.tools/listresponses are filtered, in both JSON and SSE form. - Argument scanning: PII and secrets in arguments follow your guardrail mode: alert, redact before forwarding, or block (
-32002). - Paid tools: the per-call price is checked against budgets before the call and recorded only if it succeeds.
Attribution
Each tools/call appears in your call log with provider mcp, the server name, the tool name, a hash of the arguments, cost, latency, status and your X-Cost-* tags, so agent activity sits next to model spend in dashboards and reports. These calls are excluded from retry and context-bloat waste detection, because agents legitimately repeat tool calls.
Denied and blocked attempts are logged too, so you can see what agents tried to do.
Limits
- Streamable HTTP transport, one JSON-RPC message per request. Batching was removed from the MCP spec and is refused. The older HTTP+SSE transport is not supported.
- Policy applies to tools. Resources and prompts are forwarded unmodified.
- Tool results are not scanned; only arguments are.
- The server URL must be reachable from the public internet.
Related articles
OpenAI Responses API
POST /v1/responses on every provider, with streaming and function tools. Budgets, guardrails and routing apply unchanged.
Audio & Rerank Endpoints
Transcription, translation, speech and rerank through Cognocient AI, with the same budgets, guardrails and cost tracking as chat.
OpenAI Batch API
Create batches through Cognocient AI and have each batch's discounted cost attributed to your tags when it finishes. Growth plan.