Tool Calls
When you’d rather not wire up your own MCP client, the SDK exposesigris.mcp —
a small JSON-RPC client that speaks to the Igris gateway directly. Calls are
identity-tagged and audit-logged exactly the same way external MCP clients are,
and callTool is policy-evaluated like any other tools/call.
When to use this
Both paths route through the same gateway, hit the same policies, and produce the same audit events.
API
McpConfigOptions:
Quick Start
https://api.igrisecurity.com/v1/mcp/<slug> and carries Authorization: Bearer <apiKey>. callTool is policy-evaluated server-side before being forwarded to the upstream MCP server with its real credential injected. initialize and listTools are logged and forwarded without a policy decision.
Threading multiple calls under one trace
If a single user request triggers several tool calls, share the trace id so the audit trail can show the whole chain as one operation:traceId = "trace-...", which lets you
filter the audit trail to the full sequence.
Error handling
The gateway reports a policy denial as a JSON-RPC error inside an HTTP 200 response, not as an HTTP error:Policy denied: <reason>, where the reason names the matched rule (or “No matching rule (default deny)”). Policies never produce a 429 on MCP calls: rate limits apply to LLM rules only. See Policies.
igris.mcp maps responses to the SDK’s typed errors, all subclasses of IgrisError:
What gets logged
Everyinitialize, listTools, and callTool produces an audit event with:
- The actor (
user, derived fromX-Igris-User) - The connection slug
- The tool name and arguments (for
callTool) or the MCP method name - The policy decision (
allow/deny/alert/redact).initializeandlistToolsare always logged asallowwith rulepassthrough. - Any matched rule
- The trace id (
X-Igris-Trace-Id) - All metadata fields (
X-Igris-Metadata) - The timing and outcome (
callTool)
Related
- Connections — how to register the upstream MCP server and store its credential
- Identity & Metadata — what the gateway does with
user,traceId, andmetadata - Policies — how to gate
tools/callby tool name, user, or metadata - MCP Client Config — the alternative path: drive an external MCP client