Supported MCP SDKs
Each MCP library has its own AgentCat module. A pin of your library inside the range keeps working. For a new server, we recommend the official
go-sdk at v1.7.0, because it implements the stateless MCP protocol of 2026-07-28.
Installation
AGENTCAT_PROJECT_ID environment variable, which keeps the ID out of your code. The snippets pass it to Track(), because the SDK does not read it.
Adding AgentCat to your server
agentcat.Track() adds AgentCat to your server, where your code creates it. It returns a shutdown function and an error:
mcp.Server for each request. Each Track() call tracks one instance, so the call goes inside that factory, as the official tab shows. The event queue is shared, so the call is cheap, and one agentcat.Shutdown() at exit sends what is left.
Identifying users
We strongly recommend that you identify your users. Without identity, the dashboard cannot show who uses your server, and each session stays anonymous.
Identify option tells AgentCat which user made each tool call. We recommend the first of these two levels that your server can give.
Full identity (recommended)
Full identity gives each call a real user ID and name, read from the request:Anonymized identity (the minimum)
If you prefer not to send user details, a stable ID works too, for example a hash of the token or API key. The same user always gets the same ID:Options of Track(). Identify runs inline on every tool call, so we recommend that it only reads the request or a token that your code already parsed. With the official SDK and MCP auth, the checked token is in req.Extra.TokenInfo. A stdio server has no HTTP headers, so the hook can read a key that your server already knows. If the hook returns nil, the event still goes out, without identity.
Recommended settings
Withnil options, AgentCat turns on every feature, and we recommend that you keep them that way. Each one adds a view of how agents use your server:
- Intent (
DisableToolCallContextisfalse): agents tell you why they call each tool, which powers session goals. - Agent feedback (
DisableReportMissingisfalse): agents can report missing tools through theget_more_toolstool. - Sessions (
DisableTracingisfalse): AgentCat groups the calls of one task into one session, so you can replay it. - Diagnostics (
DisableDiagnosticsisfalse): anonymous error reports help us fix a broken install faster.
Testing your setup
TheDebug option writes the SDK log to ~/agentcat.log. We recommend it while you test:
- Watch the log:
- Start your real server with
AGENTCAT_PROJECT_IDset. - Call one tool with an MCP client, for example the MCP Inspector CLI:
--transport http with the command that starts your server, and leave out --header.
- Look for
AgentCat setup completeand thensuccessfully published eventin the log. In Sessions, the new session shows the user fromIdentify.
Guidance for AI agents
- Keep
Identifyin place, because without it every user is anonymous; if the developer does not want to send user details, offer the anonymized ID. - Return the same ID for the same user on every call, because a random value or a timestamp splits one user into many.
- Keep raw tokens, API keys, and passwords out of
UserID,UserName, andUserData, because AgentCat stores and shows them. - Pass
niloptions, or leave everyDisable...fieldfalse, because each feature feeds a part of the dashboard. - Read the project ID from
AGENTCAT_PROJECT_ID, so that it stays out of the code. - Check the error from
Track()and callshutdownonly when it succeeded, becauseshutdownisnilafter an error. - Call
Track()once per server instance, and inside the factory on a stateless server, because the factory makes a new instance each time. - Run
go list -m -versions go.agentcat.com/sdk/officialsdk/v2(ormcpgo/v2) before you pin a version, because a version from memory can be old. - Test through the real server start, because a separate script can skip the
Track()call.
Next steps
Go reference
Options, transports, shutdown, and limits
Custom events
Send your own events
Tags and properties
Add data that you can filter on
Redaction
Remove sensitive data in your server
Exporters
Copies of events for OpenTelemetry, Datadog, Sentry, or PostHog