MCP Server for OpenTelemetry collector provisioning, auto-instrumentation, and pipeline governance
162
An MCP server that gives AI assistants the power to discover, provision, instrument, validate, and govern OpenTelemetry pipelines on Kubernetes — from intent-driven collector provisioning to cardinality control, sampling optimization, and security auditing.
This Docker image runs an MCP server that connects to your Kubernetes cluster to manage OpenTelemetry resources. AI assistants (Claude, Cline, Cursor, or any MCP client) connect to the server over HTTP, SSE, or stdio.
docker run --rm -it \
-p 8771:8771 \
-v ~/.kube:/app/.kube:ro \
-e K8S_KUBECONFIG=/app/.kube/config \
-e MCP_TRANSPORT=http \
talkopsai/opentelemetry-mcp-server:latest
The server is now listening on http://localhost:8771/mcp.
Tip: Mount the full
~/.kubedirectory (not justconfig) so certificate paths referenced in your kubeconfig (e.g. minikube, kind) are available inside the container.
Then configure your MCP client to connect:
{
"mcpServers": {
"opentelemetry": {
"url": "http://localhost:8771/mcp",
"description": "MCP Server for OpenTelemetry Kubernetes observability"
}
}
}
When running inside a Kubernetes pod, use in-cluster config:
docker run --rm -it \
-p 8771:8771 \
-e MCP_TRANSPORT=http \
-e K8S_IN_CLUSTER=true \
talkopsai/opentelemetry-mcp-server:latest
The OpenTelemetry Operator must be installed in the cluster. The server's service account needs:
get, list, watch on OpenTelemetryCollector and Instrumentation CRDscreate, patch on OpenTelemetryCollector and Instrumentation CRDs (for provisioning)create, patch, get on ClusterRole and ClusterRoleBinding (for k8sattributes RBAC)To use this image over stdio transport directly inside Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"opentelemetry-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "/Users/YOUR_USERNAME/.kube:/app/.kube:ro",
"-e", "K8S_KUBECONFIG=/app/.kube/config",
"-e", "MCP_TRANSPORT=stdio",
"-e", "MCP_LOG_LEVEL=INFO",
"talkopsai/opentelemetry-mcp-server:latest"
]
}
}
}
Replace /Users/YOUR_USERNAME/.kube with your actual kubeconfig path (e.g. C:\Users\YourUser\.kube on Windows).
| Variable | Default | Description |
|---|---|---|
MCP_TRANSPORT | stdio | Transport protocol: http, sse, streamable-http, or stdio |
MCP_HOST | 0.0.0.0 | Host interface to bind to |
MCP_PORT | 8771 | Port for HTTP server |
MCP_PATH | /mcp | MCP endpoint path |
MCP_LOG_LEVEL | INFO | Log level: DEBUG, INFO, WARNING, ERROR |
MCP_LOG_FORMAT | json | Log format: json or text |
MCP_HTTP_TIMEOUT | 300 | HTTP server timeout (seconds) |
| Variable | Default | Description |
|---|---|---|
K8S_KUBECONFIG | (empty) | Path to kubeconfig file inside the container |
K8S_IN_CLUSTER | false | Set true when running inside a Kubernetes pod |
K8S_ENABLED | true | Enable/disable Kubernetes features entirely |
| Variable | Default | Description |
|---|---|---|
OTEL_CRD_GROUP | opentelemetry.io | API group for OTel CRDs |
OTEL_CRD_API_VERSION | v1beta1 | API version for Collector CRDs |
OTEL_INSTRUMENTATION_API_VERSION | v1alpha1 | API version for Instrumentation CRDs |
| Variable | Default | Description |
|---|---|---|
PROMETHEUS_BASE_URL | (empty) | Prometheus HTTP API base URL (for cardinality queries) |
PROMETHEUS_TIMEOUT | 30 | HTTP timeout for Prometheus API calls (seconds) |
| Tool | Description |
|---|---|
otel_list_collectors | List OpenTelemetryCollector CRDs with namespace filtering, label selectors, and pagination |
otel_query_a2ui | Retrieve collector status and pipeline metrics formatted for A2UI Status Datatables |
otel_get_collector | Get detailed collector info — pipelines, status, raw YAML config |
otel_list_instrumented_services | List workloads with auto-instrumentation status, annotations, and 4-tier language detection |
| Tool | Description |
|---|---|
otel_provision_collector | Smart, intent-driven collector provisioning with backend auto-discovery, best-practice configs, and auto-RBAC |
otel_patch_collector | Expert-level CRD management — create or replace OpenTelemetryCollector CRDs with full spec |
| Tool | Description |
|---|---|
otel_lookup_instrumentation | Map language and framework to OTel instrumentation support |
otel_patch_instrumentation | Create or patch an Instrumentation CRD with dry-run safety |
otel_annotate_deployment | Apply auto-instrumentation annotation to Deployments |
| Tool | Description |
|---|---|
otel_validate_k8sattributes_order | Validate processor ordering against recommended order |
otel_check_filelog_safety | Check filelog receiver for safety issues |
otel_inspect_target_allocator_state | Inspect Target Allocator configuration |
otel_recommend_collector_topology | Recommend collector deployment mode and resource sizing |
| Tool | Description |
|---|---|
otel_detect_cardinality | Detect metric cardinality issues from SpanMetrics |
otel_gen_drop_attribute_rules | Generate transform processor YAML to drop high-cardinality attributes |
otel_analyze_ebpf_footprint | Scan eBPF pods for security posture |
| Tool | Description |
|---|---|
otel_inspect_sampling_configuration | Inspect head + tail sampling config with conflict detection |
otel_toggle_sampling_strategy | Generate config patches to switch sampling strategies |
| Tool | Description |
|---|---|
otel_inspect_spanmetrics_config | Inspect SpanMetrics connector configuration and cardinality |
otel_enable_spanmetrics_for_service | Generate SpanMetrics connector YAML with custom dimensions |
| Resource | Description |
|---|---|
otel://system/health | Server health: K8s connectivity, OTel CRD availability, version |
otel://collector/{namespace}/{name} | Full collector config: pipelines, receivers, processors, exporters |
otel://k8s-enrichment/{namespace}/{collector} | k8sattributes processor profile |
otel://logs-profile/{namespace}/{collector} | Filelog receiver config and safety analysis |
otel://spanmetrics/{namespace}/{collector} | SpanMetrics connector profile and cardinality estimates |
otel://instrumentation/{namespace}/{name} | Instrumentation CRD details |
otel://target-allocator/{namespace}/{name} | Target Allocator state and configuration |
otel://lang/{language} | Per-language instrumentation capabilities |
otel://registry/languages | Full language support matrix |
:ro so the container cannot modify your credentials.otel_provision_collector, otel_patch_collector, otel_patch_instrumentation, otel_annotate_deployment) default to dry_run=True. Review output before applying.otel_provision_collector creates ClusterRole/ClusterRoleBinding for k8sattributes — review the spec before applying with dry_run=False.services:
opentelemetry-mcp-server:
image: talkopsai/opentelemetry-mcp-server:latest
ports:
- "8771:8771"
environment:
- MCP_TRANSPORT=http
- K8S_IN_CLUSTER=true
- MCP_LOG_LEVEL=INFO
If you find this MCP server useful, consider leaving a ⭐ on the GitHub repository!
Content type
Image
Digest
sha256:39347fa91…
Size
82.1 MB
Last updated
3 months ago
docker pull talkopsai/opentelemetry-mcp-server