Get the FREE Ultimate OpenClaw Setup Guide →

mcpcat-typescript-sdk

MCPcat is an analytics platform for MCP server owners 🐱.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mcpcat-mcpcat-typescript-sdk node path/to/server.js \
  --env MCPCAT_API_KEY="optional-api-key-if-required" \
  --env MCPCAT_ENDPOINT="optional-custom-endpoint-if-not-default" \
  --env MCPCAT_PROJECT_ID="your-project-id"

How to use

This MCP server is a TypeScript SDK for MCPcat that helps you instrument your MCP servers with analytics and telemetry forwarding. It provides a set of helpers to track server activity, identify users, redact sensitive information, and export telemetry to observability backends. By integrating mcpcat into your MCP server, you can capture user sessions, traces, and events, then forward them to platforms like OpenTelemetry, Datadog, Sentry, and PostHog, all with a consistent API. The SDK emphasizes ease of use: install the package, initialize a server instance, and start hooking into your server’s lifecycle to collect and forward telemetry automatically. The included examples show how to initialize tracking for your MCP server, identify users, redact sensitive data, and configure multiple exporters for observability.

How to install

Prerequisites:

  • Node.js (LTS) and npm or pnpm
  • Basic TypeScript tooling if you’re adding TS examples
  1. Install the MCPcat SDK package:
npm install mcpcat --save

or with yarn

yarn add mcpcat


2) Initialize and configure in your MCP server code (example in TypeScript):

```ts
import * as mcpcat from "mcpcat";

const mcpServer = new Server({ name: "echo-mcp", version: "0.1.0" });

// Start tracking with MCPcat
mcpcat.track(mcpServer, "proj_0000000");

// Register your tools or instrument your server logic as needed
  1. Run your server as you normally would (e.g., via Node.js script or your existing start script). If you’re using a build step, compile first and then run the output.

Notes:

  • Ensure your MCPcat project ID is configured (via code or environment variables) so telemetry is associated with the correct project.
  • If you plan to forward telemetry to multiple backends, configure exporters as shown in the examples.

Additional notes

Tips and considerations:

  • Environment variables: MCPCAT_PROJECT_ID should be your project identifier from MCPcat. Optional MCPCAT_API_KEY or MCPCAT_ENDPOINT can be used for custom deployments or private instances.
  • Exporters: You can enable multiple exporters (OTLP, Datadog, Sentry, PostHog) to forward traces and logs. Make sure credentials (e.g., API keys, DSNs) are kept secure, typically via environment variables.
  • Redaction: Use redactSensitiveInformation hooks to sanitize text data before it’s sent to MCPcat to meet privacy and compliance requirements.
  • OpenTelemetry compatibility: The SDK is designed to integrate with common observability stacks; verify compatibility with your existing telemetry pipeline.
  • Debugging: If telemetry isn’t appearing in MCPcat, double-check the project ID, endpoint configuration, and network access from your deployment environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers