# mp-tool/komodo-mcp-server architecture

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

- Interactive diagram: https://gitdiagram.com/mp-tool/komodo-mcp-server
- Repository: https://github.com/mp-tool/komodo-mcp-server

## Overview

Komodo MCP Server exposes infrastructure-management tools to MCP clients. The workflow is client request → registered tool handler → authenticated Komodo API call → structured and Markdown response. The tool surface covers resource lifecycle operations, terminal and log access, Docker inspection, user API keys, updates, and TOML export. Startup, auth, connection monitoring, configuration, and shared response/security utilities form supporting layers. README supplies broader capability coverage; sampled source confirms startup, registration, client/auth behavior, and server-tool calls, but not the internal wiring of every tool.

Main entry points: [`src/client.ts`](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/client.ts) (Komodo client), [`src/tools/server.ts`](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/server.ts) (Server tools), [`src/index.ts`](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/index.ts) (MCP server), [`src/auth/komodo-identity.ts`](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/auth/komodo-identity.ts) (Login and identity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP runtime"]
  node_server["MCP server<br/>[index.ts]"]
  node_registration["Tool registration<br/>[index.ts]"]
end

subgraph group_identity["Identity and connection"]
  node_auth["Login and identity<br/>[komodo-identity.ts]"]
  node_loginpage["Login page<br/>[login.ts]"]
  node_client["Komodo client<br/>[client.ts]"]
end

subgraph group_infra["Infrastructure tools"]
  node_servers["Server tools<br/>[server.ts]"]
  node_containers["Container tools<br/>[container.ts]"]
  node_stacks["Stack and deployment tools<br/>[stack.ts]"]
  node_deployment["Deployment tools<br/>[deployment.ts]"]
  node_docker["Docker inspection<br/>[docker.ts]"]
end

subgraph group_ops["Operations tools"]
  node_buildrepo["Build and repo tools<br/>[build.ts]"]
  node_automation["Automation resources<br/>[procedure.ts]"]
  node_swarm["Swarm tools<br/>[swarm.ts]"]
  node_terminal["Terminal and logs<br/>[terminal.ts]"]
  node_otherops["Other tool categories"]
end

subgraph group_shared["Shared services"]
  node_config["Runtime configuration<br/>[index.ts]"]
  node_helpers["API and polling helpers<br/>[api-helpers.ts]"]
  node_rendering["Response rendering<br/>[markdown.ts]"]
  node_errors["Error handling<br/>[index.ts]"]
end

node_assistant(("MCP client"))
node_core["Komodo Core"]

node_assistant -->|"sends requests"| node_server
node_server -->|"loads tools"| node_registration
node_server -->|"resolves settings"| node_config
node_server -->|"sets identity"| node_auth
node_server -.->|"renders login"| node_loginpage
node_auth -->|"builds context"| node_client
node_client -->|"connects"| node_core
node_servers -->|"uses API"| node_client
node_containers -->|"uses API"| node_client
node_stacks -->|"uses API"| node_client
node_deployment -->|"uses API"| node_client
node_docker -->|"uses API"| node_client
node_buildrepo -->|"uses API"| node_client
node_automation -->|"uses API"| node_client
node_swarm -->|"uses API"| node_client
node_terminal -->|"uses API"| node_client
node_otherops -->|"uses API"| node_client
node_servers -->|"calls helpers"| node_helpers
node_servers -->|"renders results"| node_rendering
node_servers -->|"uses errors"| node_errors
node_servers -->|"returns results"| node_assistant

click node_server "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/index.ts"
click node_registration "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/index.ts"
click node_auth "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/auth/komodo-identity.ts"
click node_loginpage "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/auth/login.ts"
click node_client "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/client.ts"
click node_servers "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/server.ts"
click node_containers "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/container.ts"
click node_stacks "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/stack.ts"
click node_deployment "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/deployment.ts"
click node_docker "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/docker.ts"
click node_buildrepo "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/build.ts"
click node_automation "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/procedure.ts"
click node_swarm "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/swarm.ts"
click node_terminal "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/terminal.ts"
click node_otherops "https://github.com/mp-tool/komodo-mcp-server/tree/main/src/tools"
click node_config "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/config/index.ts"
click node_helpers "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/utils/api-helpers.ts"
click node_rendering "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/utils/markdown.ts"
click node_errors "https://github.com/mp-tool/komodo-mcp-server/blob/main/src/errors/index.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_registration,node_assistant toneBlue
class node_auth,node_loginpage,node_client toneAmber
class node_servers,node_containers,node_stacks,node_deployment,node_docker toneMint
class node_buildrepo,node_automation,node_swarm,node_terminal,node_otherops toneRose
class node_config,node_helpers,node_rendering,node_errors,node_core toneIndigo
```

## Components

### MCP runtime

- [MCP server](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/index.ts): `src/index.ts`
- [Tool registration](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/index.ts): `src/tools/index.ts`

### Identity and connection

- [Login and identity](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/auth/komodo-identity.ts): `src/auth/komodo-identity.ts`
- [Login page](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/auth/login.ts): `src/auth/login.ts`
- [Komodo client](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/client.ts): `src/client.ts`

### Infrastructure tools

- [Server tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/server.ts): `src/tools/server.ts`
- [Container tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/container.ts): `src/tools/container.ts`
- [Stack and deployment tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/stack.ts): `src/tools/stack.ts`
- [Deployment tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/deployment.ts): `src/tools/deployment.ts`
- [Docker inspection](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/docker.ts): `src/tools/docker.ts`

### Operations tools

- [Build and repo tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/build.ts): `src/tools/build.ts`
- [Automation resources](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/procedure.ts): `src/tools/procedure.ts`
- [Swarm tools](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/swarm.ts): `src/tools/swarm.ts`
- [Terminal and logs](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/tools/terminal.ts): `src/tools/terminal.ts`
- [Other tool categories](https://github.com/mp-tool/komodo-mcp-server/tree/main/src/tools): `src/tools`

### Shared services

- [Runtime configuration](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/config/index.ts): `src/config/index.ts`
- [API and polling helpers](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/utils/api-helpers.ts): `src/utils/api-helpers.ts`
- [Response rendering](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/utils/markdown.ts): `src/utils/markdown.ts`
- [Error handling](https://github.com/mp-tool/komodo-mcp-server/blob/main/src/errors/index.ts): `src/errors/index.ts`

### Other components

- **MCP client**
- **Komodo Core**

## Connections

- MCP client → MCP server: sends requests
- MCP server → Tool registration: loads tools
- MCP server → Runtime configuration: resolves settings
- MCP server → Login and identity: sets identity
- MCP server → Login page: renders login
- Login and identity → Komodo client: builds context
- Komodo client → Komodo Core: connects
- Server tools → Komodo client: uses API
- Container tools → Komodo client: uses API
- Stack and deployment tools → Komodo client: uses API
- Deployment tools → Komodo client: uses API
- Docker inspection → Komodo client: uses API
- Build and repo tools → Komodo client: uses API
- Automation resources → Komodo client: uses API
- Swarm tools → Komodo client: uses API
- Terminal and logs → Komodo client: uses API
- Other tool categories → Komodo client: uses API
- Server tools → API and polling helpers: calls helpers
- Server tools → Response rendering: renders results
- Server tools → Error handling: uses errors
- Server tools → MCP client: returns results
