Skip to content

MCP tools and approvals

spec:
mcp:
approvalTimeout: 2m
servers:
- name: github
allowTools: ["get_*", "list_*", "create_pull_request", "merge_pull_request"]
denyTools: ["delete_*"]
requireApproval: ["merge_pull_request"]

Register the server in the gateway’s mcpServers and point the agent at http://leash-gateway.leash-system.svc:8080/mcp/<server>. Denied tools are removed from the server’s tool list, and refused if the agent calls them anyway.

Held calls

A call to a requireApproval tool waits while the gateway creates a ToolApproval. If nobody decides before approvalTimeout, the call is refused.

Terminal window
kubectl leash approvals -n agents
kubectl leash approve merge-pull-request-x7k2p -n agents
kubectl leash deny merge-pull-request-x7k2p -n agents --reason "not on a Friday"

Approve from Slack

With a Slack app, each held call is posted to a channel with Approve and Deny buttons:

  1. Create a Slack app with incoming webhooks and interactivity, with its Request URL at https://<your host>/slack/interactions.
  2. Add SLACK_WEBHOOK_URL and SLACK_SIGNING_SECRET to the gateway’s credentials Secret.
  3. Set gateway.slack.interactive: true and expose the Slack port with gateway.slack.ingress. Only that path is routed, never the agents’ port.
  4. Optionally, limit who can decide with gateway.slack.approvers.

Every click is checked against Slack’s signature and must be under five minutes old. The full walkthrough, with a Slack app manifest, is in Approving from Slack.