> For the complete documentation index, see [llms.txt](https://docs.visdom.virtuslab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/mcp-gateway.md). Agents can also search and read this documentation through its [MCP server](https://docs.visdom.virtuslab.com/~gitbook/mcp).

# MCP gateway

The MCP gateway puts your approved tool servers behind one gateway: one endpoint per project, its own tokens, risk classes, approvals and guardrails on every tool call.

The MCP gateway federates the tool servers your organisation has approved (an issue tracker, a core-banking API, a document store) behind one gateway. Clients never connect to a tool server directly. They connect to a **virtual server**: one MCP endpoint per project, exposing only the tools chosen for it, with **client tokens** that work for that endpoint alone. The tool server's own credentials stay encrypted in the gateway.

The MCP gateway is built on IBM MCP Context Forge (v1.0.10, pinned) and administered in the console under **MCP gateway**.

<figure><img src="https://2020465637-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe29EtUChYm1v2qbe6hDa%2Fuploads%2Fgit-blob-d4f2fe46d0ab5c9517ed6a476228824e10263bfe%2Fconsole-mcp-servers.png?alt=media" alt="MCP servers page: two registered tool servers, both connected, with their tool counts and switches"><figcaption><p>MCP servers: the registry of approved tool servers, each with its status, transport, tool count and switch.</p></figcaption></figure>

## What the gateway controls

| Control                  | What it does                                                                                                                                                                         | Page                                                                                                                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Registry of tool servers | Only registered servers are reachable; internal addresses only inside `MCP_ALLOWED_NETWORKS`. Credentials (bearer, basic, custom header, OAuth client credentials) stored encrypted. | [Tool servers](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/tool-servers.md)                                           |
| Catalogue                | Every tool, resource and prompt the servers offer, with a switch each and a risk class per tool.                                                                                     | [Tools, risk classes and approvals](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/tools-risk-and-approvals.md)          |
| Approvals                | A high-risk tool reaches a virtual server only after a second person approves it.                                                                                                    | [Tools, risk classes and approvals](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/tools-risk-and-approvals.md)          |
| Virtual servers          | One endpoint per project with a chosen subset of tools; tokens scoped to one virtual server, revoked within about 5 seconds.                                                         | [Virtual servers and client tokens](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/virtual-servers.md)                   |
| Guardrails               | Secrets and the bank's refusing rules refused in tool arguments; personal data masked in tool results; rate limits; an optional OPA policy.                                          | [Guardrails, limits and emergency stop](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/guardrails-and-emergency-stop.md) |
| Kill switches            | Per tool, per tool server, per virtual server, per token; an emergency stop for every tool server at once.                                                                           | [Guardrails, limits and emergency stop](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/guardrails-and-emergency-stop.md) |
| Activity                 | Per tool and per call, with CSV.                                                                                                                                                     | [MCP activity](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/activity.md)                                               |

## A tool call

```mermaid
sequenceDiagram
  autonumber
  participant C as MCP client
  participant V as MCP gateway<br/>/servers/{id}/mcp
  participant T as Tool server
  participant R as Console
  participant A as AI Tracing / SIEM
  C->>V: tools/call (Authorization: Bearer client token)
  V->>V: token valid for this virtual server? tool on it and switched on?
  V->>V: OPA policy (if on), rate limit
  V->>V: visdom-guard: refuse secrets, bank rules, denied tools and arguments
  V->>T: the call, with the server's stored credentials
  T-->>V: result
  V->>V: visdom-guard: mask personal data and the bank's masking rules
  V-->>C: result (or isError with the reason)
  R->>V: reads the call (tool, virtual server, outcome, latency)
  R->>A: mcp_call record (signed for AI Tracing, OTLP log for the SIEM)
```

A refused call stops at the step that refused it. The client gets HTTP 401 for an unknown, expired or revoked token, HTTP 403 for a token of another virtual server, and a tool error (`isError: true`) with a code for a guardrail, a rate limit, a policy denial or a switched-off tool. The codes are listed in [Guardrails, limits and emergency stop](https://docs.visdom.virtuslab.com/visdom-ai-gateway/mcp-gateway/guardrails-and-emergency-stop.md).

The console reads each call from the gateway after the fact and turns it into a record: the call itself never waits for the console, AI Tracing or the SIEM. See [Records and sessions in AI Tracing](https://docs.visdom.virtuslab.com/visdom-ai-gateway/visdom-platform/ai-tracing.md) and [Export to a SIEM](https://docs.visdom.virtuslab.com/visdom-ai-gateway/visdom-platform/siem-export.md).

## Who can do what

Roles are global: the same role applies to every project. See [Sign-in and roles](https://docs.visdom.virtuslab.com/visdom-ai-gateway/visdom-platform/sign-in-and-roles.md).

| Action                                                                         | Viewer | Operator | Admin |
| ------------------------------------------------------------------------------ | ------ | -------- | ----- |
| See servers, catalogue, virtual servers, approvals, activity                   | yes    | yes      | yes   |
| Create, switch off and delete virtual servers, change their tools              | –      | yes      | yes   |
| Issue and revoke client tokens                                                 | –      | yes      | yes   |
| Switch tool servers, tools, resources and prompts on and off; rediscover tools | –      | –        | yes   |
| Emergency stop and resume                                                      | –      | –        | yes   |
| Register and delete tool servers                                               | –      | –        | yes   |
| Set risk classes                                                               | –      | –        | yes   |
| Decide approvals (never your own)                                              | –      | –        | yes   |

## Not yet

* **Per-user OAuth to a tool server** (each person authorises, for example, the issue tracker on first use and the tool runs with that person's rights). Today every call to a tool server uses the server's shared credentials.
* **Approval of each individual high-risk call.** Today the approval is given once, when the tool is added to a virtual server.
* **Rate limits per person.** Console-issued tokens share one owner, so the per-user limit is a gateway-wide ceiling.

{% hint style="info" %}
The gateway connects to tool servers that already run somewhere. To run your own MCP server as a container in the cluster, use the Visdom Orchestrator; then register its address here like any other tool server.
{% endhint %}
