Secure MCP servers
Put every MCP server behind one gateway: filtered tool catalogues per key, pinned tool definitions and an explicit Allow for every call.

Contents
If you are working out how to secure MCP servers, start by stopping clients from connecting to them directly. Route every MCP client through the DeepintShield MCP gateway, where each Virtual Key sees a filtered tool catalogue, tool definitions are pinned, and every governed call needs an explicit Allow before it runs.
The challenge
The Model Context Protocol makes it easy to give a model tools. It also makes it easy to give a model too many tools, from servers nobody has reviewed:
- Broad tool sets. One server can expose both “search orders” and “refund order”, and every client sees both.
- Definitions change after approval. A tool can be re-described upstream so its description carries new instructions that the model reads.
- Credentials are scattered. OAuth tokens and API keys for each server live in many client configs.
- No single record. Direct connections leave no shared log of which agent called which tool, with what result.
The approach
Put one gateway between clients and servers. Give each client the smallest tool set it needs. Separate discovery from execution: seeing a tool should never mean permission to run it. Pin each approved tool definition so a change is caught. Authenticate upstream servers properly and keep their secrets encrypted. Record every decision. For the full list of checks, use the MCP security checklist.
How to secure MCP servers with DeepintShield
- Register servers and filter tools per key. Connect servers over HTTP or SSE with headers, or with OAuth 2.1 using PKCE. STDIO servers are off in production by default, outbound URLs are validated, and cloud metadata endpoints are refused. Set
DEEPINTSHIELD_ENCRYPTION_KEYso stored server secrets are encrypted. Clients use the/mcpendpoint (JSON-RPC 2.0 and SSE) with a Virtual Key; the key’s MCP configuration is the outer boundary, an empty list means no tools, and request headers can narrow the list but never widen it. See connecting to MCP servers. - Require an exact Allow for execution. With Agentic Security (Business plan and above),
tools/call,POST /v1/mcp/tool/execute, Agent Mode and every nested Code Mode call go through one decision point. It checks the Virtual Key and agent binding, the registered action and OpenFGA relationships. Discovered actions count as write and high risk until an operator classifies them, and write-like actions need a live approval. Auto-execute lists and OAuth grants cannot turn a Deny into execution. - Pin definitions and keep evidence. Approving a tool pins a digest of its name, description and argument schema. If the server changes any of them, the console shows “Definition changed” and calls are denied until someone selects “Approve new definition”. Each decision is appended to a hash-chained ledger before the call proceeds. See tool execution.
The MCP registry, Agent Mode and Code Mode are on every plan. MCP servers per plan: Developer 1, Team 25, Business 50, Enterprise unlimited.
What you can show afterwards
- The tools each Virtual Key can see, and the servers behind them.
- Every governed call with its outcome: Allow, Deny or Require approval.
- Definition drift events and who re-approved each change.
- An AIBOM export of governed tool contracts, signed when a signing key is configured (Business plan and above).
To check the setup, run six cases against one server: list the tools a key can see, make an allowed read, attempt a restricted write, trigger a pending approval, change a tool description upstream, and disconnect the server. Each case should produce the expected outcome and a record you can show a reviewer.
For background, read what an MCP gateway is and how tool fingerprint drift is reviewed.
Related
- MCP Gateway: registry, filtering, OAuth and pinned definitions
- AI governance for global capability centres: shared tool platforms across teams
- Control what AI agents can do: authorise each agent action
- Add human approval to AI agents: hold risky tool calls for review