MCP gateway for AI agents that gives each agent only its own tools
Put one MCP gateway in front of every tool server. Each agent sees only the tools you grant it, and Amiril logs each refused call and finds grants nobody uses.
Put one MCP gateway in front of every tool server. Each agent sees only the tools you grant it, and Amiril logs each refused call and finds grants nobody uses.
Your agents connect to one MCP gateway instead of to each tool server. Amiril runs it for you. Each agent gets its own token and sees only the tools you granted it. The gateway refuses a call to any other tool before the request reaches the tool server, and the vendors' keys stay in Amiril instead of in the agent's environment.
Without one, per-tool access is up to each server. The MCP spec's tools page lets a server return fewer tools from tools/list depending on the caller's authorization, but it doesn't require it. A server that skips it hands every tool to anyone with a valid key. So a support agent that only looks up payments and a back-office agent that issues them end up holding the same key to the same payments server, and both can call issue_payment. When a security review asks which of your agents can move money, somebody has to go and read each agent's code.
When you register a tool server, Amiril reads its tool list and marks each tool Read, Write or Destructive from the readOnlyHint and destructiveHint the server sends. The spec calls those hints untrusted, so you look over the levels and correct any that are wrong before the tools are added.
Every tool starts denied, including tools the server adds later. You grant tools on the agent's Access tab, one switch per tool, or a whole server at Read, Read and write, or Full. The change reaches the gateway within a few seconds, and the message confirming a revoke has an Undo. An agent belongs to one environment, so the production support agent and its development twin keep separate lists.
When the support agent lists its tools, it gets back payments__get_payment and nothing else. The payments__ in front is the server's slug. Every call is checked against the agent's per-tool grants, so a request for payments__issue_payment gets this answer:
This agent doesn't have access to payments__issue_payment. An admin can grant it in Amiril.
The agent's environment holds one secret, its gateway token. You name it after where the agent runs, such as Production deployment. It works only for that agent, and only in the environment it was made in, so revoking it disconnects nobody else. The agent's MCP client settings take the gateway's address and the token, both from the agent's Connect tab:
{
"mcpServers": {
"amiril": {
"url": "<gateway URL>",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}The tool server's own credentials stay in Amiril, which adds them to each call after the access check. You pick how Amiril signs in when you register the server. A server that answers anyone needs nothing, and the others take one of these:
If a vendor stops renewing a login, the server shows Reconnect needed and admins see a banner that names it. Amiril emails the person who connected the server and the owners of every agent that uses it. Reconnecting changes no grants.
Amiril encrypts every key, secret and token with AES-256-GCM before storing it. Neither the app nor the API shows a saved one again.
Because every call passes through the gateway, Amiril can tell which granted tools an agent actually uses. When a tool was granted more than 30 days ago and the agent hasn't called it in the last 30, Amiril raises an access suggestion, which shows on the Access tab and the Suggestions page. Revoke on the suggestion takes the tool off the agent, and the access log records the suggestion as the reason.
Access suggestions also come out of issues, for agents that send their traces to Amiril. When an issue's runs show an agent calling a tool it has no business calling, the suggestion to revoke it carries those runs as evidence.
Everything lands in the access log. The app writes tool names with a dot there and on every other page, and only the agent sees the underscores.
| When | Who | Action | Target | Agent | Detail |
|---|---|---|---|---|---|
| 4 minutes ago | Support | Denied | payments.issue_payment | Support | Not granted |
| Today, 09:12 | admin@example.com | Revoked | payments.refund_payment | Back office | Revoked from a suggestion. The agent hadn't used it in 30 days. |
| Yesterday | admin@example.com | Token created | Production deployment | Back office |
Server and token changes are logged too, down to a tool that appeared on the last sync. Calls the gateway let through are on each agent's Calls tab, with the decision and how the tool server answered. On the Agents page, the Needs review column counts the granted tools each agent hasn't called in 30 days and the destructive tools it can call.
The back-office agent is meant to have issue_payment, so the gateway lets its calls through, including a second payment for an invoice it paid ten minutes earlier. To catch that repeat, add the Amiril SDK to the agent. It runs Amiril rules on each call's arguments in the agent's own process, before the call leaves it. A rule on a gateway tool names the tool the way the gateway does:
@id("one-payment-per-invoice") @per("invoice_id") @sentence("This invoice has already been paid") block ( agent == "back_office", tool == "payments__issue_payment" ) when { payments__issue_payment{} };
The when block matches an earlier call to payments__issue_payment, and @per("invoice_id") counts only those with the same invoice_id. It searches every run with the same session id, so a repeat counts even when it comes in a later run. The first payment for an invoice runs, a repeat is blocked, and the model is told why.
A published rule starts in Shadow. It records what it would have done and lets every call through. Test on past calls replays any version of the rule, a draft included, over as much as the last 30 days of real calls, and you switch it to Enforce once the list holds only calls you meant to stop.
Plenty of agents keep their tools as functions in their own code, with an API key sitting next to them. A function like that can move onto a tool server by following a guide that ends with the agent's first call over the gateway. An API that has no MCP server at all can be wrapped as one in about sixty lines of TypeScript with the official MCP SDK. Give each action its own tool when you do, so Amiril can grant reading a payment and issuing one separately.
A proxy forwards MCP traffic, sometimes changing the transport on the way, and treats every caller alike. An MCP gateway identifies the agent from its token, so two agents on one server can get different tools, and it signs in to the server for them and records who called what.
No. Amiril keeps the API key, the client credentials or the person's login, encrypted, and adds it to the request only once the call has passed the access check. The agent holds a gateway token that reaches its own grants and nothing more.
Amiril finds it on the next sync, adds it as denied and records it in the access log. No agent can call it until someone grants it.
The gateway and access suggestions come with every plan, including Free. The pricing page lists what each plan includes.
Amiril's MCP server points the other way, at Claude and other AI assistants. They sign in with OAuth, read your runs and issues, and write and test rules. The gateway sits between your agents and their tools.
Our comparison of ten MCP gateways puts them side by side on per-agent access, the access log, unused grants and sign-in to tool servers. Our post on MCP security takes apart the attack on GitHub's MCP server, where the agent was allowed every call it made.