OpenTelemetry MCP Server Configuration
The TalkOps OpenTelemetry MCP Server is configured using standard environment variables. You can pass these via .env files for local development, inject them through Docker flags, or mount them from Kubernetes ConfigMap and Secret objects in production.
Server & Transport Settings
Configure how MCP clients (Claude Desktop, Cursor, Cline, or backend orchestrators) connect to the server.
| Variable | Default | Allowed Values | Description |
|---|---|---|---|
MCP_TRANSPORT | stdio | stdio, http, sse, streamable-http | Communication protocol for MCP JSON-RPC messages. |
MCP_HOST | 0.0.0.0 | Valid IP Address | Network interface to bind for HTTP/SSE transports. |
MCP_PORT | 8771 | Valid TCP Port | Listening port for HTTP/SSE servers. |
MCP_PATH | /mcp | URL Path | Base endpoint path for JSON-RPC message handling. |
MCP_LOG_LEVEL | INFO | DEBUG, INFO, WARNING, ERROR | Logging verbosity for operational diagnostics. |
MCP_LOG_FORMAT | json | json, text | Structured JSON or human-readable plain text output. |
MCP_HTTP_TIMEOUT | 300 | Integer (Seconds) | Maximum client request duration before timing out. |
Kubernetes & Operator Integration
The server directly queries and modifies OpenTelemetry Operator custom resources. Adjust these if your cluster uses customized CRD group names or legacy API versions.
| Variable | Default | Description |
|---|---|---|
K8S_ENABLED | true | Enable or disable Kubernetes API interactions. (Set false for standalone registry testing). |
K8S_IN_CLUSTER | false | Set to true when running inside a Pod with an attached ServiceAccountToken. |
OTEL_CRD_GROUP | opentelemetry.io | API Group name for OpenTelemetry Custom Resource Definitions. |
OTEL_CRD_API_VERSION | v1beta1 | API version for OpenTelemetryCollector CRDs. |
OTEL_INSTRUMENTATION_API_VERSION | v1alpha1 | API version for Instrumentation CRDs (promoted independently from Collectors). |
OTEL_COLLECTOR_PLURAL | opentelemetrycollectors | Plural resource name for Collector CRDs. |
OTEL_INSTRUMENTATION_PLURAL | instrumentations | Plural resource name for Instrumentation CRDs. |
OTEL_TA_SERVICE_DISCOVERY | true | Enable Target Allocator service discovery across namespaces. |
OTEL_TA_DEFAULT_PORT | 8080 | Default listening port for Target Allocator instances. |
Backend Discovery & Language Registry
| Variable | Default | Description |
|---|---|---|
PROMETHEUS_BASE_URL | (empty) | Optional HTTP endpoint for Prometheus (used to validate live series counts during cardinality audits). |
PROMETHEUS_TIMEOUT | 30 | Request timeout for Prometheus queries in seconds. |
PROMETHEUS_VERIFY_SSL | true | Enable SSL certificate verification for remote backend queries. |
OTEL_LANG_REGISTRY_PATH | (builtin) | Custom filesystem path to override the bundled language support matrix JSON. |
Kubernetes RBAC Requirements
When running in-cluster or using intent-driven collector provisioning (otel_provision_collector), the MCP server's ServiceAccount needs permissions to manage OTel CRDs, inspect Pods/Deployments, and create the necessary ClusterRole / ClusterRoleBinding resources for the k8sattributes processor:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: talkops-opentelemetry-mcp-role
rules:
# OpenTelemetry Operator CRDs
- apiGroups: ["opentelemetry.io"]
resources: ["opentelemetrycollectors", "instrumentations"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
# Workload inspection & auto-instrumentation injection
- apiGroups: ["apps"]
resources: ["deployments", "daemonsets", "statefulsets"]
verbs: ["get", "list", "watch", "update", "patch"]
# Pod, namespace, and service discovery
- apiGroups: [""]
resources: ["pods", "services", "namespaces", "configmaps", "secrets"]
verbs: ["get", "list", "watch"]
# Dynamic RBAC creation for k8sattributes enrichment
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterroles", "clusterrolebindings"]
verbs: ["get", "create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: talkops-opentelemetry-mcp-binding
subjects:
- kind: ServiceAccount
name: talkops-opentelemetry-mcp-sa
namespace: monitoring
roleRef:
kind: ClusterRole
name: talkops-opentelemetry-mcp-role
apiGroup: rbac.authorization.k8s.io
Production Deployment Manifest
Here is a ready-to-apply Kubernetes Deployment manifest for running the OpenTelemetry MCP server in your monitoring namespace:
apiVersion: apps/v1
kind: Deployment
metadata:
name: opentelemetry-mcp-server
namespace: monitoring
labels:
app.kubernetes.io/name: opentelemetry-mcp-server
app.kubernetes.io/part-of: talkops
spec:
replicas: 1
selector:
matchLabels:
app: opentelemetry-mcp-server
template:
metadata:
labels:
app: opentelemetry-mcp-server
spec:
serviceAccountName: talkops-opentelemetry-mcp-sa
containers:
- name: server
image: talkopsai/opentelemetry-mcp-server:latest
imagePullPolicy: IfNotPresent
env:
- name: MCP_TRANSPORT
value: "http"
- name: MCP_PORT
value: "8771"
- name: K8S_IN_CLUSTER
value: "true"
- name: MCP_LOG_LEVEL
value: "INFO"
ports:
- containerPort: 8771
name: http-mcp
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /mcp
port: http-mcp
initialDelaySeconds: 10
periodSeconds: 15