@awarecorp/mcp-logger
v0.1.2
Published
Generic MCP-to-OTLP forwarder. Wraps any MCP server and emits OTel traces to OTEL_EXPORTER_OTLP_ENDPOINT.
Downloads
520
Readme
@awarecorp/mcp-logger
Generic MCP-to-OTLP forwarder — wrap any MCP server, intercept JSON-RPC messages, and emit OpenTelemetry traces to your collector of choice.
Install
# Stable (legacy 0.0.x — backend-direct, requires Pinta API key)
npm install -g @awarecorp/mcp-logger
# v0.1.x (generic OTLP forwarder — manager-relay or self-hosted collector)
npm install -g @awarecorp/mcp-logger@devThe
latestdist-tag still points at 0.0.14 to protect existing users — they keep working without any change. Thedevtag tracks the generic forwarder (currently 0.1.1-dev.0). See CHANGELOG for breaking changes.
Usage
With Pinta Manager (recommended for Pinta users)
Pinta Manager v0.2+ auto-installs this adaptor from the dev tag via its catalog and wraps your MCP servers — for Claude Desktop, Cursor, and Claude Code — injecting the OTel env vars. No manual configuration. The manager forwards traces to the Pinta backend with proper authentication and identity attribution.
When Manager wraps a server, any legacy PINTA_API_KEY/PINTA_MEMBER_*/PINTA_TOKEN env vars on the wrapped command are stripped and replaced with OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_EXPORTER_OTLP_HEADERS. Existing users who upgrade to Manager v0.2+ are migrated automatically on the next reconcile.
With your own OTel collector
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
mcp-logger -- npx -y @modelcontextprotocol/server-slackWith a vendor (Datadog, Honeycomb, etc.)
OTEL_EXPORTER_OTLP_ENDPOINT=https://trace.agent.datadoghq.com/api/v0.2/traces \
OTEL_EXPORTER_OTLP_HEADERS='DD-API-KEY=xxx' \
mcp-logger -- npx -y your-mcp-serverWhat's emitted
OTLP HTTP+JSON traces with:
service.name— extracted from the wrapped command (e.g.@modelcontextprotocol/server-slack)service.version— extracted or resolved vianpm viewmcp.*attributes — full Bronze-flat encoding of every JSON-RPC message (see@pinta-ai/typesfor the schema)
Identity attribution (member.identity.*) is not added by this adaptor — it is the relay/collector's responsibility (Pinta Manager attaches on forward; OSS users attach via their own pipeline).
Configuration
All configuration via OTel SDK standard env vars.
| Env | Purpose | Default |
|---|---|---|
| OTEL_EXPORTER_OTLP_ENDPOINT | Where to send traces | http://localhost:4318 |
| OTEL_EXPORTER_OTLP_HEADERS | Auth headers (key1=val1,key2=val2) | none |
| PINTA_DEBUG | mcp-logger debug logs to stderr | off |
| PINTA_RAW_DEBUG | verbose logs (raw OTLP, MCP messages) | off |
See the OpenTelemetry SDK docs for the full env spec.
Development
npm install
npm test # unit (vitest)
npm run build # rollup → dist/
cd e2e && bash run.sh # mock OTLP server + integrationLicense
MIT
