Client-Side Redaction
Sanitize sensitive data before it leaves your environment with custom redaction functions.
Server-Side Redaction
Automatic pattern-based redaction of sensitive values in event payloads.
Certifications
SOC 2 Type II compliance, encryption, and infrastructure security.
Disabling Telemetry
While AgentCat provides valuable analytics, we understand that some users may want to disable telemetry entirely. You can implement this in your MCP server by conditionally calling the track function.Disabling Tracking Entirely
Add environment variable support to your MCP server so users can opt out:AGENTCAT_ENABLED=false also turns AgentCat off everywhere, in Laravel and Symfony applications too, with no code.
In C#, AGENTCAT_ENABLED=false also turns AgentCat off everywhere, with no code, and AgentCat stays off while your tests run (see C#: turn AgentCat on or off).
In Rust, AGENTCAT_ENABLED set to false, 0, no or off, in any case, turns AgentCat off with no code: a tracked server then forwards every request to your handler untouched, and custom events publish nothing (see Rust options).
Disabling Auto-Capture
By default, AgentCat automatically captures all MCP protocol events (tool calls, initialization, tool listings). If you only need custom events without automatic event capture, setenableTracing to false:
enableTracing is false; publish it with a session ID string to send it.
In C#, no hook runs while EnableTracing is false, and a custom event that you publish with an McpServer is dropped; publish it with a session ID string to send it.
In Rust, the enable_tracing(false) setter of Options turns tracing off. Nothing is recorded, and the tools get neither session_id nor agent_id. They still get context, and the tool list still gets get_more_tools. A custom event that you publish with CallContext::publish_custom_event or Tracked::publish_custom_event is dropped while tracing is off. Publish it with AgentCat::publish_custom_event and a session ID string to send it.
When tracing is disabled:
- Tool call events are not recorded
- User identification still works normally
- Custom events via
publishCustomEventare still sent - Exporters (OpenTelemetry, Datadog, Sentry) still receive custom and identify events
Anonymizing User Sessions
For users who want analytics without user identification, pass anidentify function that returns null:
identify hook unset, or return Ok(None) from it: the call then has no user.
Implementation Best Practices
- Document Environment Variables: Clearly document telemetry options in your MCP server’s README
- Default to Privacy: Consider making telemetry opt-in rather than opt-out
- Respect User Choice: Always check environment variables before initializing tracking
- Provide Granular Control: Allow users to disable specific types of tracking
AGENTCAT_ENABLED turns tracking off with no code (see Disabling Tracking Entirely), and a server that leaves the identify hook unset has no user on its calls (see Anonymizing User Sessions).
What the PHP SDK sends
The PHP SDK sends the same events as the other SDKs. Two things to know, which the PHP differences and limits cover in full:- Request headers. The event of a call over HTTP carries every request header of that call, verbatim,
AuthorizationandCookieincluded. Remove the ones you do not want in aredactEventhook. - Diagnostics. To find broken installs, the SDK sends AgentCat every line it logs, including the line it logs for each event it sends, with the session ID and the user ID. Turn diagnostics off with
new Options(disableDiagnostics: true)orAGENTCAT_DISABLE_DIAGNOSTICS=true.
What the C# SDK sends
The C# SDK sends each tool-call or custom event, in its own request, to the AgentCat API athttps://api.agentcat.com, and to the exporters that you configure. The ApiBaseUrl option, or the AGENTCAT_API_URL environment variable, changes that URL. Two things to know, which the C# reference covers in full:
- Request headers and URL. On an ASP.NET Core server, the event of a tool call carries every request header of that call, verbatim,
AuthorizationandCookieincluded, and the full URL with its query string, underparameters.extra.requestInfo. AnX-Forwarded-Forheader goes out like any other header, and AgentCat records no IP address of its own. On the legacy SSE transport, the headers and the URL are those of the session’sGET /sserequest, not of the call. Stdio servers and .NET Framework hosts send none. Remove what you do not want in aRedactEventhook, as in the sample below. - Diagnostics. To find broken installs, the SDK sends AgentCat every line it logs: the line it logs for each event it sends, with the session ID and the user ID, tool names, error messages from any code that threw, the answers of exporters that failed, and the keys of the tags that it drops. Turn diagnostics off with
options.DisableDiagnostics = trueon the firstWithAgentCat()orTrack()of the process, or withAGENTCAT_DISABLE_DIAGNOSTICS=true.
RedactEvent hook removes the authorization and cookie headers and the query string of the URL. It also gets custom events, whose parameters can have any shape, and an exception in the hook drops the event, so it tests each level by type:
What the Rust SDK sends
The Rust SDK sends one event for each tool call, and the custom events that your code publishes, to the AgentCat API athttps://api.agentcat.com. The api_base_url option, or the AGENTCAT_API_URL environment variable (then MCPCAT_API_URL), changes that URL. Three things to know, which the Rust differences and limits cover in full:
- Request headers and URL. On a streamable HTTP server, the event of a tool call carries every request header of that call,
authorizationandcookieincluded, and the URL of the request, underparameters.extra.requestInfo. Stdio servers send none. Remove what you do not want in aredact_eventhook (see Client-Side Redaction). - No diagnostics. The SDK sends none of its log lines to AgentCat. They stay in
~/agentcat.log, or go to yourtracingsubscriber. - No exporters. The SDK sends nothing to other observability platforms yet.