Repository navigation
Releases
v2.2.1
Security
- The SDK now masks sensitive values in every event before the event leaves your server. It
tests each key inparameters,responseanderror, at any depth. When the key names a
secret, the SDK keeps the key and replaces the value with[redacted]. A key names a secret
when it is a known credential header (authorization,cookie,x-api-keyand others) or
has a word such astoken,secret,password,signatureorapi-key, in any spelling
(X-Api-Key,HTTP_X_API_KEY,xApiKey). Before, the SDK sent the HTTP headers of each MCP
request as received, inparameters.extra.requestInfo.headers(MCP SDK v1) or
parameters.extra.http.req.headers(v2). Tool arguments and results under such key names
lose their values too, for examplepageTokenandauth_type.null,trueandfalse
stay. No option turns the mask off (#88).
v2.2.0
Added
- Tool-call events (
mcp:tools/call) now carryinput_tokensandoutput_tokens: estimates of
the tokens that the calling model spends on the tool arguments and reads back from the tool
result. No option changes. The SDK computes both before yourredactSensitiveInformationand
redactEventhooks run, so they describe the original size; to keep that size on your server,
drop the two fields inredactEvent. The estimate isceil(utf8_bytes / 3.5), the same in the
TypeScript, Python and Go SDKs. Expect counts about 10 percent lower than the earlier
server-side estimates, because the JSON envelope no longer counts (#71). - The SDK now sends AgentCat a description of your MCP server: its name, version, title and
instructions, and the lists of its tools, resources, resource templates and prompts. About
once an hour per process and server name, after your server answers a request, the SDK calls
your server's own list handlers and sends the result in the background. In a runtime that
keeps no memory between requests, it sends only on atools/listrequest or a
get_more_toolscall.redactSensitiveInformationruns on every text; item names and URIs
stay as they are. No option changes: the send is on when tracking is on, and a failed send
never reaches your server (#84).
Changed
AgentCat v2.1.0 — sturdier session handles: IDs issued first, structured mcp_session status
AgentCat v2.1.0 makes explicit session handles sturdier and easier for agents to consume. There are no track() API changes — the delta is in the wire contract between your server and the agent.
What's new
- IDs are issued at the start of the response. The issuance text block is now the first content element instead of the last, so it survives client-side truncation of long results. Published events are unaffected: they still carry your original, undecorated response.
session_idis required, with an explicit value contract — the pattern^(start|ses_[0-9A-Za-z]{27})$. An agent sends the literalstartto begin a new task, or theses_ID issued for the task underway, so sessions never split by accident. Calls that omit it are still accepted and treated exactly likestart, so requiredness binds only schema-aware clients.mcp_sessionreplaces_mcp_instructionsas the structured mirror instructuredContent:{session_id?, agent_id?, status?}, with a machine-readablestatusenum (issued/active/unrecognized) in place of the proseinstructionsmember. Every response state an agent can encounter is pre-announced in the output schema.- Recovery is explicit. An unrecognized value comes back as
mcp_session.status: "unrecognized"plus a leading[session_id unrecognized …]text block, with the recovery path — re-send the ID issued earlier, orstartif none was — stated in the schema. No replacement ID is issued in that response. - Leaner, self-describing copy. The
session_idandagent_iddescriptions explain the mechanism in terms of what your server does and pre-announce both text-block headers; the twoagent_idvariants collapse into one, used in both modes. The strings stay byte-identical across all three AgentCat SDKs, pinned by golden tests.
Breaking wire changes
Only for consumers that assert on response internals or advertised schemas — tests, proxies, clients that read structuredContent:
- Mirror key renamed
_mcp_instructions→mcp_session; itsinstructionsmember is replaced bystatus. - The issuance block moved from the last to the first content position, and its headers changed:
[session_id issued — see this tool's session_id parameter description]/[session_id unrecognized — see this tool's session_id parameter description]. session_idandagent_idnow appear in each tool'srequiredarray, andsession_iddeclares the validation pattern above.
Everything else — argument stripping, handle validation, the agentcat_session_id_source tags, hook mode, redaction, exporters, AgentCatOptions — is unchanged.
Also in this release
serverName,serverVersion,clientName, andclientVersionare system-reported MCP metadata, not user content, and are no longer passed throughredactSensitiveInformation— they always reach the dashboard intact (#57).- Dependabot now delivers security updates only, with no automated merges, and 13 HIGH dev-scope advisories are cleared (#63, #64).
Install
npm install agentcatFull changelog: v2.0.0...v2.1.0
AgentCat v2.0.0 — explicit handles for sessionless MCP, and MCP TypeScript SDK v2 support
AgentCat v2 rebuilds task correlation for the sessionless MCP era — and adds full support for MCP TypeScript SDK v2.
Why v2
The MCP 2026-07-28 specification removed protocol-level sessions. SEP-2567 eliminated the initialize handshake and the Mcp-Session-Id header — every request is now self-contained. Sessions were the built-in thread tying related tool calls together; without them, a stateless deployment sees each call in isolation.
The MCP core team's guidance for cross-call state is explicit: mint an explicit handle from a tool and have the model pass it back as an argument. AgentCat v2 rebuilds correlation on exactly this pattern. track() mints an explicit session_id handle and delivers it to the agent, which threads it back on every subsequent call — correlation that holds across stateless HTTP, load balancers, and per-request server instances, where transport-session inference gives you nothing at all.
What it costs you: session_id adds 323 tokens to a tool's schema — 0.03% of a 1M-token context window. Tokens scale with the tools loaded into a given request, not with the size of your catalog.
What's new
Task correlation via explicit handles
session_idis injected into every tracked tool's input schema. Agents echo it back on each call, grouping related calls into one task — even across stateless HTTP, load-balanced deployments, and per-request server instances.- Issued IDs are delivered via
_mcp_instructionsand, for tools declaring an output schema, mirrored intostructuredContentso clients that only read structured results still receive them. - Injected parameters are stripped before your handler runs — your tool code never sees them — and mint-back instructions never appear in published events.
- Session IDs land in the same
sessionIdevent field with the sameses_prefix, so your existing dashboards, queries, and exporter pipelines keep working untouched. - Already track your own correlation IDs? Pass a
resolveSessionIdhook and AgentCat derives its session from your identifier instead of injectingsession_idat all.
Agent attribution (opt-in)
agent_id— enable withenableAgentTracking: true. Each agent self-generates amodel|harness|nonceID, so parallel agents collaborating on one task stay individually attributable. Off by default; no server-side minting.
MCP TypeScript SDK v2 support
track()now supports both SDK v1 and v2 servers through a unified engine with per-object SDK detection — high-levelMcpServerand low-levelServerflavors on both majors.- Full 2026-07-28 protocol support: envelope-first client identity, the protocol version ladder, fully-qualified reserved keys, and MRTR tagging.
- Per-request serving is first-class: call
track()inside yourcreateMcpHandler/serveStdiofactory; queues, exporters, and diagnostics initialize once and are shared across instances. get_more_toolsis annotated read-only via MCP tool annotations.
Fault containment
An adversarial audit of every failure path between AgentCat and the host server hardened v2 around one guarantee: an AgentCat failure never takes your server down with it. Each fix landed with a reproducing test.
- A failure while decorating or recording a completed tool call can no longer replace your tool's response: the post-handler stage contains its own errors and returns your result untouched, forfeiting only that call's analytics.
- One tool whose schema the injection pipeline can't process no longer fails
tools/list: that tool is listed unmodified, every other tool keeps its injected parameters, and a pipeline-wide failure serves your original listing verbatim. - Customer hooks —
identify,resolveSessionId,eventTags,eventProperties— now run concurrently with your tool handler and are resolved in the background event pipeline under a fixed budget. A slow, throwing, or even permanently hanging hook costs analytics data for that one event, never tool-call latency. - The on-demand schema-registry rebuild (stateless per-request deployments) is bounded at 5 seconds, so a hanging
tools/listhandler cannot stalltools/call. - When the log file can't be created (containers without a resolvable home directory), logging goes silent instead of falling back to stdout — on stdio transports, stdout is the JSON-RPC wire.
- Termination handlers now flush and re-raise, so the first SIGINT/SIGTERM stops your server exactly as it would without AgentCat.
Known limitations, accepted for 2.0.0 and tracked for a follow-up: the event queue is bounded by count (10,000) but not bytes and the API client has no request timeout, so a long AgentCat API outage combined with very large tool results can hold significant memory; and log-file writes are synchronous, so an unresponsive network-mounted home directory would stall the process.
Reliability
- Cloudflare Workers support hardened, with a dedicated Workers test lane.
- Opt-in real-HTTP e2e matrix across five deployment topologies, behavior-parity suites twinning v1 and v2, and engine fault-containment coverage.
Breaking changes
- Session-id machinery, identity caches, and identify events are removed. Correlation now flows through explicit
session_idhandles. - Agent tracking is opt-in —
enableAgentTrackingdefaults tofalse. publishCustomEventtakes verbatim session ids;CustomEventData.sessionIdreplaces session references.
Most integrations upgrade with a version bump and no code changes — track() and its options are purely additive in 2.0.0. The migration guide covers the schema changes your MCP clients will see, the cases that do need a code change, and how to bring your own session IDs.
Compatibility
| MCP TS SDK v1 | MCP TS SDK v2 | |
|---|---|---|
High-level McpServer |
✅ | ✅ |
Low-level Server |
✅ | ✅ |
| Stateless 2026-07-28 transports | ✅ | ✅ |
| Node 18 | ✅ | — (SDK v2 requires Node ≥ 20) |
| Node 20 / 22 | ✅ | ✅ |
| Cloudflare Workers | ✅ | ✅ |
Also since v1.0.0
redactEventhook (shipped in 1.0.1) — an event-level redaction hook that runs after field-levelredactSensitiveInformation, letting you rewrite or drop entire events before they're published.- Void joined the community cats gallery 🐈⬛
Install
npm install agentcatMigrating from mcpcat? Same team, same product, new name — see the migration guide.
Full changelog: v1.0.0...v2.0.0
v0.1.17 — final mcpcat release (renamed to agentcat)
MCPcat is now AgentCat 🐱 — same team, same product, new name.
This is the final release of the mcpcat package. It has been renamed to agentcat (npm install agentcat, starting fresh at v1.0.0). No functional or dependency changes — this release only adds the rename notice on every surface npm gives us:
- README callout linking the migration guide
[DEPRECATED — mcpcat is now agentcat: npm install agentcat]package description- A one-time notice line in
~/mcpcat.logwhentrack()runs (never stdout/stderr — STDIO MCP safety) - The npm registry entry is marked deprecated, so npm/pnpm/yarn print the notice at install time
Nothing you have deployed will break — ever. The mcpcat package, api.mcpcat.io, and MCPCAT_API_URL stay alive permanently. Migrate on your own schedule — new features land only in agentcat.
Migration guide: MIGRATION.md · PR: #46
agentcat v1.0.0 — MCPcat is now AgentCat 🐱
Same team, same product, same cats — new name. MCPcat is now AgentCat, and this SDK's first release under its own name is agentcat@1.0.0 on npm.
What's new
- 📦 npm package:
mcpcat→agentcat(fresh start at v1.0.0) - 🌐 Default endpoint:
api.mcpcat.io→api.agentcat.com - 🏷️ Public types:
MCPCatOptions/MCPCatData/MCPCatIDPrefixes→AgentCatOptions/AgentCatData/AgentCatIDPrefixes - ⚙️ Env vars: reads
AGENTCAT_API_URLfirst;MCPCAT_API_URLstill honored - 📝 Local log:
~/mcpcat.log→~/agentcat.log
Nothing you have deployed will break — ever
The mcpcat package stays published and functional, api.mcpcat.io keeps accepting events forever, and your project, data, and history stay unified regardless of which SDK reports. Migrate on your own schedule — new features land here.
Migrating
npm uninstall mcpcat && npm install agentcatThen rename imports and types 1:1 — full steps (and a paste-into-your-coding-agent prompt) in MIGRATION.md.
v0.1.14
What's New
Event Tags & Properties
- New
eventTagsandeventPropertiescallbacks ontrack()options for attaching custom metadata to every auto-captured event - Tags: indexed string key-value pairs (validated client-side, max 50 entries)
- Properties: flexible JSON metadata with no constraints
- Also available on
publishCustomEvent()via theCustomEventDataobject
PostHog AI Observability Integration
- New
enableAITracingoption onPostHogExporterConfig - Emits
$ai_spanevents for tool calls alongside regular capture events - Maps MCPCat sessions to
$ai_session_id/$ai_trace_idand tool calls to$ai_span_id/$ai_span_name - Customer tags can override any
$ai_*default for custom trace/span grouping
Exporter Improvements
- All exporters include
source: "mcpcat"for attribution - Datadog: customer tags namespaced with
mcpcat.prefix, key/value sanitization - Sentry: customer properties in
contexts.mcpcat(moved from deprecatedextra), tags namespaced withmcpcat. - OTLP: customer tags as
mcpcat.tag.*span attributes - PostHog: customer tags and properties spread directly as top-level event properties
Other
$now allowed in tag key names (for PostHog$ai_*overrides)- Tags and properties exempt from redaction pipeline
MCPCAT_SOURCEconstant replaces hardcoded strings across all exporters
Full Changelog: v0.1.13...v0.1.14
v0.1.13
What's Changed
Features
- Add PostHog telemetry (#24)
- Add content sanitization for non-text MCP data types (#25)
- Add client-side event truncation (100KB max) (#27)
Bug Fixes
- Stop publishing error events for identify function failures (#21)
Maintenance
- Upgrade mcpcat-api to 0.1.7 (#23)
Full Changelog: v0.1.11...v0.1.13