Supported MCP SDKs
One
agentcat/sdk package supports all three. AgentCat does not test symfony/mcp-bundle 0.15 yet, and the known limits show how to stay on 0.14.
Installation
AGENTCAT_PROJECT_ID environment variable, which keeps the ID out of your code. The SDK reads it by itself.
Adding AgentCat to your server
Withmcp/sdk, AgentCat::track() adds AgentCat to the Mcp\Server\Builder where your code creates it. In Laravel and Symfony, the bridge tracks every server, also one built per request, so you add no track() call:
build(), because after build() a few calls give no event. Under PHP-FPM, each request tracks a new server, as a stateless server needs. The reference page has a complete HTTP script.
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 hook 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 session a real user ID and name, read from the request. In Laravel and Symfony, the hook is an invokable class that the container builds: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:$call->headers holds the HTTP headers, with lower-case names. On stdio it is empty, so the hook can read your server’s own key. If the hook throws, the event goes out without identity.
Recommended settings
AgentCat turns on every feature by default, and we recommend that you keep them that way. Each one adds a view of how agents use your server:- Intent (
enableToolCallContext): agents tell you why they call each tool, which powers session goals. - Agent feedback (
enableReportMissing): agents can report tools that they looked for and did not find, through theget_more_toolstool. - Sessions (
enableTracing): AgentCat records each tool call and groups the calls of one task into one session, so you can replay it. - Diagnostics (
disableDiagnosticsturns it off): the SDK’s own log lines, which can include user IDs, help us fix a broken install faster.
Testing your setup
The PHP SDK always logs its setup and each event that it sends, so it needs no debug option.- Watch the log:
- Start your real server with
AGENTCAT_PROJECT_IDset, as you start it in production. - 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
Successfully sent event ... | mcp:tools/call | ...in the log. The line ends with the user ID fromidentify, oranonymous. In Sessions, the new session shows the user name.
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. - Leave
enableToolCallContext,enableReportMissing, andenableTracingat their defaults, because each one feeds a part of the dashboard. - Read the project ID from
AGENTCAT_PROJECT_ID, so that it stays out of committed code. - Add no
track()call in Laravel or Symfony, because the bridge tracks every server. - Give Laravel and Symfony hooks as an invokable class, because the bridge cannot store a closure.
- Install
agentcat/sdkwithout a version constraint, because a version from memory can be old. - Test through the real server start, outside PHPUnit and Pest, because tests turn AgentCat off and a separate script can skip
track().
Next steps
PHP reference
Options, frameworks, runtimes, 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