# santosadvo/kommo-mcp-publico architecture

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

- Interactive diagram: https://gitdiagram.com/santosadvo/kommo-mcp-publico
- Repository: https://github.com/santosadvo/kommo-mcp-publico

## Overview

This repository provides a local MCP server that lets Claude Code read and write Kommo CRM data. The principal workflow is Claude tool dispatch through domain-specific tools, the shared authenticated HTTP client, and Kommo’s API; results return through the tool call. Separate setup paths support long-lived tokens and OAuth. The README documents broad CRM capabilities, while the excerpts show their implementation as endpoint calls in server.py. The graph groups those tools by domain rather than implying a sequence between them.

Main entry points: [`server.py`](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py) (MCP server), [`kommo_client.py`](https://github.com/santosadvo/kommo-mcp-publico/blob/main/kommo_client.py) (HTTP client), [`token_longo.py`](https://github.com/santosadvo/kommo-mcp-publico/blob/main/token_longo.py) (Long-token setup), [`auth.py`](https://github.com/santosadvo/kommo-mcp-publico/blob/main/auth.py) (OAuth setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["MCP access"]
  node_mcp_runtime["MCP server<br/>[server.py]"]
  node_http_client["HTTP client<br/>[kommo_client.py]"]
end

subgraph group_crm["CRM tools"]
  node_account_tools["Account metadata<br/>[server.py]"]
  node_lead_tools["Lead tools<br/>[server.py]"]
  node_contact_tools["Contact tools<br/>[server.py]"]
  node_company_tools["Company tools<br/>[server.py]"]
  node_task_tools["Task tools<br/>[server.py]"]
  node_note_tools["Note tools<br/>[server.py]"]
  node_generic_tool["Generic API tool<br/>[server.py]"]
end

subgraph group_credentials["Credentials"]
  node_long_token_setup["Long-token setup<br/>[token_longo.py]"]
  node_oauth_setup["OAuth setup<br/>[auth.py]"]
end

node_claude(("Claude Code"))
node_kommo_api["Kommo API v4"]

node_claude -->|"uses locally"| node_mcp_runtime
node_mcp_runtime -->|"dispatches tools"| node_account_tools
node_mcp_runtime -->|"dispatches tools"| node_lead_tools
node_mcp_runtime -->|"dispatches tools"| node_contact_tools
node_mcp_runtime -->|"dispatches tools"| node_company_tools
node_mcp_runtime -->|"dispatches tools"| node_task_tools
node_mcp_runtime -->|"dispatches tools"| node_note_tools
node_mcp_runtime -->|"dispatches tools"| node_generic_tool
node_account_tools -->|"requests data"| node_http_client
node_lead_tools -->|"requests data"| node_http_client
node_contact_tools -->|"requests data"| node_http_client
node_company_tools -->|"requests data"| node_http_client
node_task_tools -->|"requests data"| node_http_client
node_note_tools -->|"requests data"| node_http_client
node_generic_tool -->|"sends request"| node_http_client
node_http_client -->|"calls API"| node_kommo_api
node_long_token_setup -->|"tests connection"| node_http_client
node_oauth_setup -->|"exchanges code"| node_kommo_api

click node_mcp_runtime "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_account_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_lead_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_contact_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_company_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_task_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_note_tools "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_generic_tool "https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py"
click node_http_client "https://github.com/santosadvo/kommo-mcp-publico/blob/main/kommo_client.py"
click node_long_token_setup "https://github.com/santosadvo/kommo-mcp-publico/blob/main/token_longo.py"
click node_oauth_setup "https://github.com/santosadvo/kommo-mcp-publico/blob/main/auth.py"

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_mcp_runtime,node_http_client toneBlue
class node_account_tools,node_lead_tools,node_contact_tools,node_company_tools,node_task_tools,node_note_tools,node_generic_tool toneAmber
class node_long_token_setup,node_oauth_setup,node_kommo_api toneMint
class node_claude toneIndigo
```

## Components

### MCP access

- [MCP server](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [HTTP client](https://github.com/santosadvo/kommo-mcp-publico/blob/main/kommo_client.py): `kommo_client.py`

### CRM tools

- [Account metadata](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Lead tools](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Contact tools](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Company tools](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Task tools](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Note tools](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`
- [Generic API tool](https://github.com/santosadvo/kommo-mcp-publico/blob/main/server.py): `server.py`

### Credentials

- [Long-token setup](https://github.com/santosadvo/kommo-mcp-publico/blob/main/token_longo.py): `token_longo.py`
- [OAuth setup](https://github.com/santosadvo/kommo-mcp-publico/blob/main/auth.py): `auth.py`

### Other components

- **Claude Code**
- **Kommo API v4**

## Connections

- Claude Code → MCP server: uses locally (evidence: `README.md`)
- MCP server → Account metadata: dispatches tools (evidence: `server.py`)
- MCP server → Lead tools: dispatches tools (evidence: `server.py`)
- MCP server → Contact tools: dispatches tools (evidence: `server.py`)
- MCP server → Company tools: dispatches tools (evidence: `server.py`)
- MCP server → Task tools: dispatches tools (evidence: `server.py`)
- MCP server → Note tools: dispatches tools (evidence: `server.py`)
- MCP server → Generic API tool: dispatches tools (evidence: `server.py`)
- Account metadata → HTTP client: requests data (evidence: `server.py`)
- Lead tools → HTTP client: requests data (evidence: `server.py`)
- Contact tools → HTTP client: requests data (evidence: `server.py`)
- Company tools → HTTP client: requests data (evidence: `server.py`)
- Task tools → HTTP client: requests data (evidence: `server.py`)
- Note tools → HTTP client: requests data (evidence: `server.py`)
- Generic API tool → HTTP client: sends request (evidence: `server.py`)
- HTTP client → Kommo API v4: calls API (evidence: `kommo_client.py`)
- Long-token setup → HTTP client: tests connection (evidence: `token_longo.py`)
- OAuth setup → Kommo API v4: exchanges code (evidence: `auth.py`)
