Skip to main content
Glama

otel-mcp

OpenTelemetryのトレース、メトリクス、ログを、3つのOTLPワイヤ形式のいずれかで、同時に1つ以上のOTLPエンドポイントに出力するMCPサーバーです。

  • grpc — OTLP/gRPC (HTTP/2上のprotobuf)

  • http/protobuf — OTLP/HTTP バイナリprotobuf

  • http/json — OTLP/HTTP proto3-JSON (仕様準拠)

また、よく知られたツール(nginx、postgres、redis、kafka、aws-lambda、kubernetes pod、汎用gRPCサービス)のような形状のリアルなシグナルバンドルを生成するツール模倣プロファイルも同梱されているため、コレクターやバックエンドに実際の環境のようなトラフィックを投入できます。

インストール

uv venv
uv pip install -e .

Related MCP server: Mock MCP Server

実行

otel-mcp           # stdio transport — wire into any MCP client

または、MCPクライアント設定(例: Claude Desktop、Claude Code)経由:

{
  "mcpServers": {
    "otel": {
      "command": "otel-mcp"
    }
  }
}

環境変数のブートストラップ

起動時に OTEL_EXPORTER_OTLP_ENDPOINT が設定されている場合、標準のOTEL環境変数を使用して default という名前のエンドポイントが登録されます:

  • OTEL_EXPORTER_OTLP_ENDPOINT

  • OTEL_EXPORTER_OTLP_PROTOCOL (grpc | http/protobuf | http/json)

  • OTEL_EXPORTER_OTLP_HEADERS (カンマ区切りの k=v ペア)

  • OTEL_EXPORTER_OTLP_INSECURE (gRPC TLSの切り替え)

ツール

エンドポイント管理

ツール

目的

add_endpoint

名前付きOTLP送信先(URL、プロトコル、シグナル、ヘッダーなど)を登録します。

remove_endpoint

名前を指定してエンドポイントを削除します。

clear_endpoints

すべてのエンドポイントを削除します。

list_endpoints

現在のエンドポイントを列挙します。

status

エンドポイントと利用可能な模倣プロファイルを表示します。

エンドポイントは呼び出しごとに選択されます。シグナルを出力するすべてのツールは endpoints: [names] 引数を受け取ります。省略した場合は、そのシグナルタイプを受け入れるすべてのエンドポイントにファンアウトします。

生シグナルの出力

ツール

入力の形状

send_trace

{service_name, spans[]} — 各スパンには name、kind、attributes、duration_ms、status、events[]、およびネスト用のオプションの parent_name が含まれます。

send_metric

{service_name, metrics[]} — 各メトリックには name、kind (counter/up_down_counter/gauge/histogram)、unit、description、points[] が含まれます。ヒストグラムはポイントごとにサンプルのリストを受け入れます。

send_log

{service_name, records[]} — 各レコードには body、severity、severity_text、attributes、timestamp_ns が含まれます。

模倣(Mimicry)

ツール

目的

list_mimic_profiles

すべてのプロファイルとそのパラメータを表示します。

mimic_tool

プロファイルを1つ実行し、そのバンドルを一度送信します。

generate_load

プロファイルをループ実行して、持続的なトラフィックをシミュレートします。

組み込みプロファイル:

プロファイル

外観

nginx / http-server

HTTPセマンティック規約、アクセスログ、リクエストカウンター、レイテンシヒストグラムを備えたサーバー・スパン。

postgres

db.system=postgresql を備えたDBクライアント・スパン + コネクションプール・メトリクス。

redis

db.system=redis を備えたDBクライアント・スパン。

kafka

メッセージングセマンティック規約を備えたプロデューサー/コンシューマー・スパン。

aws-lambda

faas.* + cloud.* リソース属性、Lambdaアクセスログ、呼び出しメトリクスを備えたサーバー・スパン。

k8s-pod

リソース = 完全な k8s.* 属性、コンテナCPU/メモリ/ネットワークメトリクス、Started イベントログ。

grpc

rpc.system=grpc を備えたサーバー・スパン。

セッション例

> add_endpoint name="otel-collector" url="http://localhost:4318" protocol="http/protobuf"
> add_endpoint name="jaeger-json"    url="http://localhost:4318" protocol="http/json" signals=["traces"]
> mimic_tool profile="nginx" options={"count": 50, "error_rate": 0.1}
> mimic_tool profile="postgres"
> generate_load profile="kafka" iterations=10 interval_seconds=2
> send_trace service_name="checkout" spans=[
    {"name": "POST /checkout", "kind": "server", "duration_ms": 42, "attributes": {"http.response.status_code": 200}},
    {"name": "charge_card",    "kind": "client", "parent_name": "POST /checkout", "duration_ms": 18,
     "attributes": {"peer.service": "stripe"}}
  ]

新しい模倣プロファイルの追加

  1. src/otel_mcp/mimics.py 内で MimicBundle を返す関数を作成します。

  2. 同ファイルの末尾にある PROFILES 辞書に登録します。

  3. list_mimic_profiles を呼び出して、パラメータが正しく読み込まれたか確認します。

プロファイルは宣言的なままです。それぞれがスパン/メトリック/ログの仕様を返し、それらが同じジェネレーターパイプラインを流れるため、リソースの適切なマージ、ワイヤ形式のサポート、ファンアウトが自動的に継承されます。

Available Tools

11 tools
add_endpointA

Register an OTLP destination.

Args: name: Unique identifier used by other tools to target this endpoint. url: Collector URL. gRPC: host:port or http://host:port. HTTP: base URL (/v1/traces etc. is appended automatically). protocol: One of grpc, http/protobuf, http/json. signals: Subset of traces, metrics, logs. Defaults to all. headers: Headers added to every request (auth tokens, tenant ids, ...). insecure: gRPC only — disable TLS. timeout_seconds: Per-request timeout. overwrite: If an endpoint with this name already exists, replace it.

Inputs: name (required), url (required), protocol, signals, +4 more. Returns: object

clear_endpointsB

Remove all endpoints.

Inputs: no named parameters. Returns: object

generate_loadA

Repeatedly run a mimic profile to simulate sustained traffic.

Blocks for roughly iterations * interval_seconds seconds. For true background loops use an external scheduler — this tool is synchronous by design so the caller sees per-iteration results.

Inputs: profile (required), iterations, interval_seconds, endpoints, +1 more. Returns: object

list_endpointsB

List registered endpoints.

Inputs: no named parameters. Returns: object

list_mimic_profilesB

List available tool-mimicry profiles.

Inputs: no named parameters. Returns: object

mimic_toolB

Emit a realistic bundle of signals mimicking a known tool.

Args: profile: One of nginx, postgres, redis, kafka, aws-lambda, k8s-pod, grpc. Call list_mimic_profiles for profile-specific parameters. endpoints: Fan-out target endpoints. Defaults to all registered. options: Keyword args passed to the profile (e.g. {"count": 50}).

Inputs: profile (required), endpoints, options. Returns: object

remove_endpointC

Remove an endpoint by name.

Inputs: name (required). Returns: object

send_logB

Send one or more log records.

Each record dict accepts: body, severity (trace/debug/info/warn/ error/fatal), severity_text, attributes, timestamp_ns.

Inputs: service_name (required), records (required), resource_attributes, endpoints. Returns: object

send_metricB

Send one or more metric instruments.

Each metric dict accepts: name, kind (counter/up_down_counter/gauge/ histogram), unit, description, points (list of {value, attributes}). For histograms, value may be a list of samples.

Inputs: service_name (required), metrics (required), resource_attributes, endpoints. Returns: object

send_traceA

Send one or more spans to the targeted endpoints.

Each span dict accepts: name, kind (internal/server/client/producer/ consumer), attributes, duration_ms, status (ok/error/unset), status_message, events (list of {name, attributes}), parent_name (to nest spans within the same batch).

If endpoints is omitted, fans out to every endpoint that accepts traces.

Inputs: service_name (required), spans (required), resource_attributes, endpoints. Returns: object

statusA

Report configured endpoints and available profiles.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. Tools like add_endpoint, remove_endpoint, and clear_endpoints handle endpoint management, while send_log, send_metric, and send_trace target specific telemetry signals. Mimic_tool and generate_load are for simulation, and list_endpoints/list_mimic_profiles/status are for querying, all with non-overlapping functions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as add_endpoint, list_endpoints, send_log, and mimic_tool. This uniformity makes the set predictable and easy to understand, with no deviations in naming conventions.

    Tool Count5/5

    With 11 tools, this server is well-scoped for OpenTelemetry management and simulation. It covers endpoint configuration, telemetry emission, mimicry, and status reporting without being overly sparse or bloated, with each tool serving a clear and necessary role.

    Completeness5/5

    The tool set provides complete coverage for the OpenTelemetry domain, including CRUD operations for endpoints (add, remove, clear, list), sending all signal types (logs, metrics, traces), simulation capabilities (mimic, generate_load), and querying (status, list profiles). There are no obvious gaps that would hinder agent workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server implementation that enables dynamic configuration of OpenTelemetry Collectors, allowing users to add, remove, and configure receivers, processors, and exporters through MCP tools.
      52
      GPL 3.0
    • A
      license
      B
      quality
      D
      maintenance
      A mock MCP server for testing MCP client implementations and development workflows. Supports tools, prompts, and resources across multiple transport protocols (stdio, HTTP, SSE).
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server for analyzing OpenTelemetry traces with performance and error diagnosis, supporting loading from files, AWS X-Ray, and CloudWatch.
      8
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.
      5
      11 npm
      2
      MIT