# mottibec/otelcol-mcp architecture

> Architecture diagram of the GitHub repository mottibec/otelcol-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mottibec/otelcol-mcp
- Repository: https://github.com/mottibec/otelcol-mcp

## Overview

This is an OpenTelemetry Collector configuration MCP server. An MCP client connects over SSE and requests component catalogs, component schemas, or semantic conventions; the server serves local Collector metadata and can refresh it from GitHub. The main implementation is visible in the excerpts. The resource directory is represented as local data, while component catalogs and schemas are grouped to avoid enumerating every JSON file. The graph omits unverified request dispatch details beyond the documented MCP interface.

Main entry points: [`src/otelcol-contrib/index.ts`](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/index.ts) (Collector resources), [`src/otelcol-contrib/github.ts`](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/github.ts) (GitHub component fetch), [`src/index.ts`](https://github.com/mottibec/otelcol-mcp/blob/main/src/index.ts) (SSE server), [`src/semantic-conventions/index.ts`](https://github.com/mottibec/otelcol-mcp/blob/main/src/semantic-conventions/index.ts) (Semantic convention resource)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MCP runtime"]
  node_server["SSE server<br/>[index.ts]"]
end

subgraph group_collector["Collector metadata"]
  node_collector_tools["Collector resources<br/>[index.ts]"]
  node_github_fetch["GitHub component fetch<br/>[github.ts]"]
  node_config_parser["Config schema parser<br/>[config.ts]"]
  node_readme_parser["README metadata parser<br/>[readme.ts]"]
  node_component_types["Component data types<br/>[types.ts]"]
  node_catalogs[("Component catalogs")]
  node_schemas[("Component schemas")]
end

subgraph group_semantic["Semantic conventions"]
  node_semantic_tools["Semantic convention resource<br/>[index.ts]"]
end

subgraph group_shared["Shared internals"]
  node_logger["Logger<br/>[logger.ts]"]
end

node_client(("MCP client"))
node_github["OpenTelemetry GitHub"]
node_convention_repo["Semantic conventions repository"]

node_client -->|"connects over SSE"| node_server
node_server -->|"registers resources"| node_collector_tools
node_server -->|"registers resources"| node_semantic_tools
node_collector_tools -->|"fetches components"| node_github_fetch
node_github_fetch -->|"reads component metadata"| node_github
node_github_fetch -->|"parses config"| node_config_parser
node_github_fetch -->|"extracts README metadata"| node_readme_parser
node_github_fetch -->|"uses component types"| node_component_types
node_collector_tools -->|"reads and updates"| node_catalogs
node_collector_tools -->|"reads and saves"| node_schemas
node_semantic_tools -->|"fetches conventions"| node_convention_repo
node_collector_tools -->|"logs operations"| node_logger
node_semantic_tools -->|"logs operations"| node_logger
node_server -->|"logs connections"| node_logger

click node_server "https://github.com/mottibec/otelcol-mcp/blob/main/src/index.ts"
click node_collector_tools "https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/index.ts"
click node_github_fetch "https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/github.ts"
click node_config_parser "https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/parser/config.ts"
click node_readme_parser "https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/parser/readme.ts"
click node_component_types "https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/types.ts"
click node_catalogs "https://github.com/mottibec/otelcol-mcp/tree/main/resources"
click node_schemas "https://github.com/mottibec/otelcol-mcp/tree/main/resources/schemas"
click node_semantic_tools "https://github.com/mottibec/otelcol-mcp/blob/main/src/semantic-conventions/index.ts"
click node_logger "https://github.com/mottibec/otelcol-mcp/blob/main/src/logger.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_client toneBlue
class node_collector_tools,node_github_fetch,node_config_parser,node_readme_parser,node_component_types,node_catalogs,node_schemas toneAmber
class node_semantic_tools toneMint
class node_logger toneRose
class node_github,node_convention_repo toneIndigo
```

## Components

### MCP runtime

- [SSE server](https://github.com/mottibec/otelcol-mcp/blob/main/src/index.ts): `src/index.ts`

### Collector metadata

- [Collector resources](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/index.ts): `src/otelcol-contrib/index.ts`
- [GitHub component fetch](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/github.ts): `src/otelcol-contrib/github.ts`
- [Config schema parser](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/parser/config.ts): `src/otelcol-contrib/parser/config.ts`
- [README metadata parser](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/parser/readme.ts): `src/otelcol-contrib/parser/readme.ts`
- [Component data types](https://github.com/mottibec/otelcol-mcp/blob/main/src/otelcol-contrib/types.ts): `src/otelcol-contrib/types.ts`
- [Component catalogs](https://github.com/mottibec/otelcol-mcp/tree/main/resources): `resources`
- [Component schemas](https://github.com/mottibec/otelcol-mcp/tree/main/resources/schemas): `resources/schemas`

### Semantic conventions

- [Semantic convention resource](https://github.com/mottibec/otelcol-mcp/blob/main/src/semantic-conventions/index.ts): `src/semantic-conventions/index.ts`

### Shared internals

- [Logger](https://github.com/mottibec/otelcol-mcp/blob/main/src/logger.ts): `src/logger.ts`

### Other components

- **MCP client**
- **OpenTelemetry GitHub**
- **Semantic conventions repository**

## Connections

- MCP client → SSE server: connects over SSE (evidence: `README.md`)
- SSE server → Collector resources: registers resources (evidence: `src/index.ts`)
- SSE server → Semantic convention resource: registers resources (evidence: `src/index.ts`)
- Collector resources → GitHub component fetch: fetches components (evidence: `src/otelcol-contrib/index.ts`)
- GitHub component fetch → OpenTelemetry GitHub: reads component metadata (evidence: `src/otelcol-contrib/github.ts`)
- GitHub component fetch → Config schema parser: parses config (evidence: `src/otelcol-contrib/github.ts`)
- GitHub component fetch → README metadata parser: extracts README metadata (evidence: `src/otelcol-contrib/github.ts`)
- GitHub component fetch → Component data types: uses component types (evidence: `src/otelcol-contrib/github.ts`)
- Collector resources → Component catalogs: reads and updates (evidence: `src/otelcol-contrib/index.ts`)
- Collector resources → Component schemas: reads and saves (evidence: `src/otelcol-contrib/index.ts`)
- Semantic convention resource → Semantic conventions repository: fetches conventions (evidence: `src/semantic-conventions/index.ts`)
- Collector resources → Logger: logs operations (evidence: `src/otelcol-contrib/index.ts`)
- Semantic convention resource → Logger: logs operations (evidence: `src/semantic-conventions/index.ts`)
- SSE server → Logger: logs connections (evidence: `src/index.ts`)
