SDKs
TypeScript SDK
@trackmcp/sdk wraps the official MCP server so every call, result, and client is captured automatically. Works with Node 18+ and any transport.
Install
npm i @trackmcp/sdk
# Create a key at https://app.trackmcp.com/dashboard
# or: pnpm add @trackmcp/sdk / yarn add @trackmcp/sdkWrap your server
Pass your existing server into withTrackMCP with your API key. Nothing else in your code changes.
import { withTrackMCP } from "@trackmcp/sdk";
import { server } from "./mcp";
export default withTrackMCP(server, {
apiKey: process.env.TRACKMCP_KEY!,
service: "acme-mcp-server",
environment: process.env.NODE_ENV,
});Options
Every option except apiKey is optional. See the full configuration reference for defaults.
withTrackMCP(server, {
apiKey: process.env.TRACKMCP_KEY!,
service: "acme-mcp-server", // shows up as the server name
environment: "production", // production | staging | ...
sampleRate: 1.0, // 0-1, fraction of calls captured
redact: ["args.password", "args.token"], // never leaves your process
endpoint: "https://trackmcp.com/api/v1/ingest", // self-hosted override
});Redacting sensitive fields
Redaction runs in your process before anything is sent. Point redact at any argument or result path and TrackMCP stores a [redacted] placeholder instead of the value.
redact: ["args.email", "args.apiKey", "result.rawResponse"]Custom events
Want to track something beyond tool calls? Emit a named event from anywhere.
import { track } from "@trackmcp/sdk";
track("checkout_completed", { amount: 4900, plan: "pro" });