Skip to content

TIP

ARMS automatically instruments MCP alongside LLMs, VectorDBs, and frameworks by default.

This guide demonstrates production-ready MCP (Model Context Protocol) observability setup with OpenTelemetry-native auto-instrumentations. Get enterprise-grade AI monitoring with zero code changes using our CLI or minimal SDK integration for complete MCP performance tracking.

Learn how to implement real-time context tracking, tool usage monitoring, protocol performance analysis, and resource utilization optimization for your MCP applications with OpenTelemetry traces and metrics.

Connect to ARMS

Ensure ARMS is running. Send telemetry to https://<arms-host>/api/ingest with an x-api-key header — not collector port 4318. For on-prem access, see On-prem ARMS.

Install ARMS SDK

shell
pip install --extra-index-url https://arms-packages.elsaifoundry.ai/root/elsai-arms/ elsai-arms==3.0.3

Instrument your MCP server

TIP

Not sure which method to choose? Check out Instrumentation Methods to understand the differences.

Zero-Code instrumentation

bash
# Install ARMS
pip install --extra-index-url https://arms-packages.elsaifoundry.ai/root/elsai-arms/ elsai-arms==3.0.3

# Start MCP monitoring instantly
elsai-arms-instrument --service-name my-mcp-app python your_mcp_app.py

# With custom settings for MCP applications
elsai-arms-instrument \
  --otlp-endpoint https://<arms-host>/api/ingest \
  --otlp_headers "x-api-key=<api-key>" \
  --service-name my-mcp-app \
  --environment production \
  python your_mcp_app.py
bash
# Install ARMS
pip install --extra-index-url https://arms-packages.elsaifoundry.ai/root/elsai-arms/ elsai-arms==3.0.3

# Set environment variables
export OTEL_EXPORTER_OTLP_ENDPOINT="https://<arms-host>/api/ingest"
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<api-key>"
export OTEL_SERVICE_NAME=my-mcp-app
export OTEL_DEPLOYMENT_ENVIRONMENT=production

# Run your MCP application
elsai-arms-instrument python your_mcp_app.py

Manual instrumentation

Via function parameters

Add the following two lines to your MCP application code:

python
import elsai_arms

elsai_arms.init(
  otlp_endpoint="https://<arms-host>/api/ingest",
    otlp_headers={"x-api-key": "<api-key>"},
  service_name="my-mcp-app",
  environment="production"
)

# Your existing MCP code works the same
# MCP interactions are traced automatically
Via environment variables

Configure your OTLP endpoint using environment variables:

shell
export OTEL_EXPORTER_OTLP_ENDPOINT="https://<arms-host>/api/ingest"
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<api-key>"
export OTEL_SERVICE_NAME=my-mcp-app
export OTEL_DEPLOYMENT_ENVIRONMENT=production

Add the following two lines to your MCP application code:

python
import elsai_arms

elsai_arms.init()

Monitor, debug and test the quality of your MCP server

Navigate to ARMS at 127.0.0.1:3000 to start monitoring your MCP applications.

You should see MCP-specific traces and metrics including:

  • Context Protocol Interactions: Track context loading, management, and utilization
  • Tool Usage Metrics: Monitor tool calls and their performance within MCP workflows
  • Protocol Performance: Analyze MCP handshakes and communication efficiency
  • Resource Utilization: Monitor context window usage and memory consumption
  • Error Tracking: Identify and debug MCP protocol errors and failures

Send Observability telemetry to other OpenTelemetry backends

If you wish to send telemetry directly from the SDK to another backend, you can stop the current Docker services by using the command below. For more details on sending the data to your existing OpenTelemetry backends, checkout our Supported Destinations guide.

sh
docker compose down

If you have any questions or need support, reach out to our community.

Copyright © 2026 elsai foundry.