# otel-server

MCP server for Docker container inspection and OpenTelemetry trace querying via Jaeger. Tools for container logs, stats, status, and distributed trace analysis.

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add cruz-andr/otel-server

# Browse available tools
npx -y @smithery/cli@latest tool list cruz-andr/otel-server

# Get full schema for a tool
npx -y @smithery/cli@latest tool get cruz-andr/otel-server list_containers

# Call a tool
npx -y @smithery/cli@latest tool call cruz-andr/otel-server list_containers '{}'
```

## Direct MCP Connection

Endpoint: `https://otel-server--cruz-andr.run.tools`

**Optional config:**
- `dockerSocketPath` (query) — Path to Docker socket
- `jaegerBaseUrl` (query) — Jaeger HTTP API URL
- `jaegerTimeoutMs` (query) — Timeout for Jaeger API requests (ms)
- `maxLogLines` (query) — Maximum number of log lines returned
- `defaultLogLines` (query) — Default number of log lines when not specified
- `maxTraceSpans` (query) — Maximum number of spans in a trace tree
- `defaultLookback` (query) — Default time window for trace searches
- `redactPatterns` (query) — Enable/disable PII scrubbing (set to false to disable)

## Tools (6)

- `list_containers` — Discover Docker containers by name or status. Use this first to find container IDs before inspecting them.
- `get_container_status` — Get detailed status of a Docker container including health, exit code, uptime, restart count, and OOM status.
- `get_container_stats` — Get a resource snapshot of a Docker container: CPU, memory, network I/O, block I/O, and PIDs. Useful for diagnosing OOM…
- `fetch_logs` — Fetch logs from a Docker container. Supports tail count, time range filtering, and regex grep. Logs are redacted for PI…
- `search_error_traces` — Search for error traces in Jaeger by service name. Returns a summary table of traces with errors.
- `get_trace_tree` — Render a trace as an indented span tree. Shows service, operation, duration, and errors at each level. Content is redac…

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get cruz-andr/otel-server <tool-name>
```

## Resources

- `otel://info` — Server capabilities and available tools

## Prompts (2)

- `diagnose_container` (container_id) — Step-by-step diagnostic workflow for a Docker container
- `investigate_errors` (service, lookback) — Investigate error traces for a service using Jaeger
