Skip to main content
Glama

otel-mcp

一个 MCP 服务器,可同时将 OpenTelemetry 追踪、指标和日志发送到一个或多个 OTLP 端点,支持以下三种 OTLP 有线格式中的任意一种:

  • 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[]} — 每个 span 都有 namekindattributesduration_msstatusevents[],以及用于嵌套的可选 parent_name

send_metric

{service_name, metrics[]} — 每个指标都有 namekind (counter/up_down_counter/gauge/histogram)、unitdescriptionpoints[]。直方图接受每个点的一系列样本。

send_log

{service_name, records[]} — 每个记录都有 bodyseverityseverity_textattributestimestamp_ns

模拟

工具

用途

list_mimic_profiles

显示每个配置文件及其参数。

mimic_tool

运行一个配置文件并发送一次其信号包。

generate_load

循环运行配置文件以模拟持续流量。

内置配置文件:

配置文件

外观

nginx / http-server

带有 HTTP 语义转换、访问日志、请求计数器和延迟直方图的服务器 span。

postgres

带有 db.system=postgresql + 连接池指标的数据库客户端 span。

redis

带有 db.system=redis 的数据库客户端 span。

kafka

带有消息传递语义转换的生产者/消费者 span。

aws-lambda

带有 faas.* + cloud.* 资源属性、Lambda 访问日志、调用指标的服务器 span。

k8s-pod

资源 = 完整的 k8s.* 属性、容器 cpu/内存/网络指标、Started 事件日志。

grpc

带有 rpc.system=grpc 的服务器 span。

示例会话

> 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 以确认它已获取参数。

配置文件保持声明式:每个配置文件返回的 span/指标/日志规范都会流经相同的生成器管道,因此它们会自动继承正确的资源合并、有线格式支持和分发功能。

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    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.
    26
    52
    GPL 3.0
  • A
    license
    B
    quality
    C
    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
    C
    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
    26
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • An MCP server for Arcjet - the runtime security platform that ships with your AI code.

  • MEOK MCP Test MCP — golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in

  • MCP server for managing Prisma Postgres.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/michigan-public-tech-org/otel_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server