Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@traceloop/instrumentation-mcp

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@traceloop/instrumentation-mcp

MCP (Model Context Protocol) Instrumentation

latest
Source
npmnpm
Version
0.27.0
Version published
Maintainers
3
Created
Source

OpenTelemetry MCP Instrumentation for Node.js

NPM Published Version Apache License

This library allows tracing of agentic workflows implemented with MCP (Model Context Protocol) framework using the @modelcontextprotocol/sdk.

Installation

npm install --save @traceloop/instrumentation-mcp

Usage

const { McpInstrumentation } = require("@traceloop/instrumentation-mcp");
const { registerInstrumentations } = require("@opentelemetry/instrumentation");

registerInstrumentations({
  instrumentations: [new McpInstrumentation()],
});

Privacy

By default, this instrumentation logs prompts, completions, and embeddings to span attributes. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs.

However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also want to disable this logging to reduce the size of your traces.

To disable logging, set the traceContent config option to false:

const { McpInstrumentation } = require("@traceloop/instrumentation-mcp");

const mcpInstrumentation = new McpInstrumentation({
  traceContent: false,
});

Instrumented Operations

This instrumentation tracks the following MCP operations:

Client Operations

  • Session lifecycle management
  • Tool invocations
  • Resource access
  • Prompt templates
  • MCP protocol methods

Server Operations

  • Request handling
  • Tool execution
  • Resource serving
  • Server-side spans

License

Apache 2.0 - See LICENSE for more information.

Keywords

opentelemetry

FAQs

Package last updated on 01 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts