Skip to content

talkops-ai/opentelemetry

v0.2.1Apache-2.0

OpenTelemetry on Kubernetes — collector provisioning, workload auto-instrumentation, eBPF/OBI zero-code telemetry, OTTL processing, tail sampling, spanmetrics/servicegraph connectors, pipeline diagnostics, and security auditing.


Let your AI assistant run OpenTelemetry on Kubernetes: set up collectors, auto-instrument workloads, configure sampling and processing, and debug pipelines that drop data. It checks every change before applying it.

What you get

  • 17 MCP tools (7 read-only) that work against your live OpenTelemetry setup
  • 14 resources your assistant can read for context, under otel://
  • 7 Agent Skills: step-by-step playbooks that teach your assistant how to use the tools well
  • Safe by default: only read-only tools are loaded until you turn on writes, and changes are previewed or confirmed before they happen

Quick start

You'll need:

  • Python 3.12+ and uv, or Docker
  • Access to a Kubernetes cluster with the OpenTelemetry Operator installed (through a kubeconfig file)

1. Add the server to your MCP client. For Claude Desktop, Cursor, Windsurf, and most other clients, add this to your MCP config file:

{
  "mcpServers": {
    "opentelemetry": {
      "command": "uvx",
      "args": [
        "--from",
        "talkops-opentelemetry-mcp-server",
        "opentelemetry-mcp-server"
      ],
      "env": {
        "KUBECONFIG": "/path/to/your/kubeconfig"
      }
    }
  }
}

Using Claude Code? Run this instead:

claude mcp add opentelemetry -e KUBECONFIG=/path/to/your/kubeconfig -- uvx --from talkops-opentelemetry-mcp-server opentelemetry-mcp-server

uvx downloads talkops-opentelemetry-mcp-server from PyPI and runs it, so there's nothing else to install. Prefer a normal install? Run pip install talkops-opentelemetry-mcp-server and use opentelemetry-mcp-server as the command.

Prefer Docker? Pull talkopsai/opentelemetry-mcp-server from Docker Hub—no Python setup needed:

{
  "mcpServers": {
    "opentelemetry": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_TRANSPORT=stdio",
        "-v",
        "/path/to/your/kubeconfig:/app/.kube/config:ro",
        "talkopsai/opentelemetry-mcp-server:latest"
      ]
    }
  }
}

2. Restart your client and try asking:

  • "Give me an overview of OpenTelemetry in my cluster."
  • "Which workloads in shop aren't instrumented yet?"
  • "My collector is dropping spans. What's wrong?"

Allowing changes

Out of the box the server is read-only. To let your assistant make changes (creating and changing collectors, instrumentation, and pipeline settings), add "--allow-write" to args (or pass -e MCP_ALLOW_WRITE=true to docker run). Even then, changes are previewed first and destructive actions ask for confirmation.

Configuration

Set these as environment variables (the env block in your client config, or -e with docker run) or pass the matching flag.

VariableFlagDefaultWhat it does
K8S_KUBECONFIG / KUBECONFIG--kubeconfig~/.kube/configKubeconfig file to use
K8S_CONTEXT--contextcurrent contextKubernetes context to use
MCP_ALLOW_WRITE--allow-writefalseEnable tools that change your cluster
MCP_TOOLSETS--toolsetsallLimit tools: discovery, collector, instrumentation, pipeline, diagnostics, governance, readonly
OTEL_COLLECTOR_VERSION_DEFAULT--collector-version-default0.152.1Collector version used for new collectors
MCP_TRANSPORT--transportstdiostdio or http
MCP_PORT--port8768 (8771 in Docker)Port when using HTTP

Run uvx --from talkops-opentelemetry-mcp-server opentelemetry-mcp-server --help to see every option.

Running over HTTP

To share one server between several clients or run it remotely, start it in HTTP mode with Docker or uvx:

# With Docker (starts in HTTP mode by default)
docker run --rm -p 8771:8771 \
  -v ~/.kube/config:/app/.kube/config:ro \
  talkopsai/opentelemetry-mcp-server:latest

# Or with uvx
MCP_TRANSPORT=http MCP_PORT=8771 uvx --from talkops-opentelemetry-mcp-server opentelemetry-mcp-server

Then point your client at http://localhost:8771/mcp:

{
  "mcpServers": {
    "opentelemetry": {
      "url": "http://localhost:8771/mcp"
    }
  }
}

Agent Skills

Skills live in skills/. Each one is a SKILL.md playbook (plus optional references/ and offline scripts/) that teaches your AI assistant how to do a job safely, while the MCP server does the actual work. Tools are the hands, skills are the know-how.

To use them, copy the folders into your assistant's skills directory, for example:

git clone https://github.com/talkops-ai/talkops-mcp.git
cp -r talkops-mcp/src/opentelemetry-mcp-server/skills/* ~/.claude/skills/

This folder is also a portable Agent Plugin (plugin.json + mcp.json + skills/), so plugin-aware clients can load the server and skills together.

SkillUse it to
provisioning-opentelemetry-collectorsPick a collector layout and set it up with the right size and permissions.
instrumenting-kubernetes-workloadsAuto-instrument apps in any language, or use eBPF where you can't.
troubleshooting-telemetry-pipelinesFind out why telemetry is missing or the collector is crashing.
tuning-sampling-and-trace-derived-metricsSet up head and tail sampling and span metrics.
controlling-telemetry-cardinality-and-noiseDrop noisy attributes and redact sensitive data.
auditing-observability-security-postureCheck for leaked secrets, missing TLS, and over-broad permissions.
upgrading-opentelemetry-componentsUpgrade collectors and the Operator without breaking configs.

Reference

All 17 tools

ToolAccessWhat it does
otel_audit_security_postureReadAudit the security posture of OpenTelemetry collectors, instrumentation, eBPF/OBI agents, and RBAC.
otel_configure_connectorsWrite (destructive)Configure spanmetrics and/or servicegraph connectors on a collector.
otel_configure_processingWriteConfigure OTTL transform and filter processors for PII masking, JSON parsing, attribute dropping, and noise reduction.
otel_configure_receiversWrite (destructive)Configure Kubernetes infrastructure, log, and Prometheus TA receivers.
otel_configure_samplingWrite (destructive)Configure trace sampling strategy across collector and Instrumentation CRs.
otel_delete_resourceWrite (destructive)Delete an OpenTelemetry Custom Resource after confirmation.
otel_diagnose_collectorReadPerform a comprehensive single-call runtime and configuration diagnosis of a collector.
otel_list_workloadsReadList Kubernetes workloads and their OpenTelemetry instrumentation state.
otel_manage_workload_instrumentationWrite (destructive)Enable, disable, or restart OpenTelemetry auto-instrumentation on a workload.
otel_patch_collectorWrite (destructive)Create or patch an OpenTelemetryCollector CRD with pre-apply validation.
otel_patch_instrumentationWrite (destructive)Create or patch an OpenTelemetry Instrumentation CRD.
otel_provision_collectorWrite (destructive)Provision an OpenTelemetry Collector CRD and least-privilege RBAC from intent.
otel_query_a2uiReadRetrieve the status of all OpenTelemetry Collectors and their pipelines.
otel_revert_collector_configWrite (destructive)Revert a collector to its pre-mutation config snapshot (one-level undo).
otel_survey_clusterReadSurvey the cluster's complete OpenTelemetry posture in a single call.
otel_validate_collector_configReadValidate a live OpenTelemetryCollector CR or raw YAML configuration.
otel_verify_instrumentationReadVerify end-to-end auto-instrumentation for a workload in a single call.

All 14 resources

ResourceWhat it returns
otel://cluster/contextsAvailable Kubernetes contexts from kubeconfig and which context this MCP server instance is bound to.
otel://operator/statusOpenTelemetry Operator pod health, mutating webhook diagnostics, recent redacted error logs, and per-namespace Instrumentation CR counts.
otel://server/capabilitiesServer execution mode (write_enabled, read_only, toolsets), bound kubeconfig context, Kubernetes API connectivity, and default Collector version.
otel://collector/{namespace}/{name}Configuration summary, pipeline topology, deployment mode, GitOps ownership, and runtime status of an OpenTelemetryCollector CRD.
otel://collector/{namespace}/{name}/configRedacted YAML configuration of an OpenTelemetryCollector CRD (inline secrets masked with REDACTED).
otel://collector/{namespace}/{name}/historyMetadata and redacted preview of the pre-mutation config snapshot stored in otel.mcp/last-known-good.
otel://collectors/{namespace}Summary list of OpenTelemetryCollector CRDs in a namespace (use namespace='all' for cluster-wide listing).
otel://instrumentation/{namespace}/{name}Redacted Instrumentation CRD details: exporter endpoint, propagators, sampler config, per-language specs, and resource attributes.
otel://instrumentations/{namespace}Summary list of Instrumentation CRDs in a namespace (use namespace='all' for cluster-wide listing).
otel://k8s-enrichment/{namespace}/{collector}k8sattributes processor profile showing extracted metadata, labels, annotations, node filtering, pod association, and pipeline positions.
otel://logs-profile/{namespace}/{collector}Filelog receiver configuration, checkpoint storage, self-exclusion, and pipeline wiring for log collection.
otel://sampling/{namespace}/{collector}Combined head sampling (Instrumentation CRD) and tail sampling (collector tail_sampling processor) configuration and conflict warnings.
otel://spanmetrics/{namespace}/{collector}SpanMetrics connector configuration showing dimensions, histogram config, pipeline wiring, and cardinality estimates.
otel://target-allocator/{namespace}/{name}Target Allocator configuration and state: allocation strategy, ServiceMonitor/PodMonitor selectors, CRD API version, and Prometheus CR status.

Development

git clone https://github.com/talkops-ai/talkops-mcp.git
cd talkops-mcp/src/opentelemetry-mcp-server
uv sync --dev
uv run pytest
uv run opentelemetry-mcp-server --help

Get help

License

Apache 2.0. See LICENSE.