mcp-gate and every tools/call will be evaluated against your Sentrail policies before reaching the upstream server.
Prerequisites
- A Sentrail workspace with an MCP server connected (Tools → MCP → Connect)
- An API key with the
mcpscope
Configuration
Add the following to your Claude Code MCP configuration file. The location depends on your setup:- Global:
~/.claude/mcp_servers.json - Project:
.claude/mcp_servers.jsonin the project root
agk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your actual API key.
Verifying the connection
After saving the config, restart Claude Code and run:sentrail listed as a connected server with the tools from your upstream MCP server.
How it works
Claude Code sends all MCP calls tomcp-gate instead of your upstream server:
initialize—mcp-gateresponds with Sentrail server info and protocol version2024-11-05tools/list—mcp-gatefetches the tool list from your upstream server (cached 60 seconds) and returns it unchangedtools/call—mcp-gateevaluates the call against your policies, then either forwards it, blocks it, or defers it
_meta.sentrail.status = "require_approval" and a message explaining that approval is needed. Claude Code will surface this to you. Poll the status endpoint or wait for the dashboard notification.
Agent identity
TheX-Agent-Id: claude-code header identifies this connection in audit logs. You can create agent-specific policies using this ID:
Troubleshooting
Server not showing up in /mcp
Server not showing up in /mcp
Check that the Sentrail MCP endpoint ends with
/mcp-gate/sse. stdio is not supported by mcp-gate.401 Unauthorized
401 Unauthorized
424 No MCP server connected
424 No MCP server connected
Go to Tools → MCP in the dashboard and connect an upstream MCP server before using
mcp-gate.