Files

@insights/mcp

Insights SDK for instrumenting Model Context Protocol (MCP) servers. Tracks tool calls, tool listing, initialization, user intent, identity, and errors — without changing your tool handler logic.

Install

npm install @insights/mcp

Usage

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { track } from '@insights/mcp'

const server = new McpServer({ name: 'my-mcp-server', version: '1.0.0' })

track(server, {
  apiKey: 'phc_your_project_api_key',
})

// Register your tools as usual — `track()` instruments them automatically.

See the documentation in docs/ for the full configuration reference, including identify, intentFallback, redactSensitiveInformation, eventProperties, enableConversationId, and reportMissing.