Skip to main content
Glama
README.md
# KommoMCP

AI-powered CRM assistant for Kommo/amoCRM. Telegram bot with natural language interface for full CRM management โ€” analytics, setup, entity operations, monitoring.

## Features

- ๐Ÿค– **Telegram Bot** โ€” AI assistant (`@kommo_wizard_bot`) for CRM via natural language
- ๐Ÿง  **Planner-Executor Architecture** โ€” Deterministic Tool Graph Planner + RAG + LLM Executor
- ๐Ÿ”€ **Tool Graph Planner** โ€” Graph-based chain planning: 54 tools, 258 actions, 24 edges, <2ms latency
- ๐Ÿ“ก **RAG Layer** โ€” Dynamic tool retrieval, compact prompts (~500 tokens vs 3000+)
- ๐Ÿข **Multi-Tenant SaaS** โ€” Each user gets isolated CRM connection, own API keys
- ๐Ÿ”ง **54 Tool Handlers** โ€” Setup, analytics, reports, entities, bulk ops, cleanup, templates, AI coaching
- ๐ŸŽจ **React Admin Panel** โ€” Dashboard, users/CRM monitoring, AI session logs
- ๐Ÿ”„ **Data Sync** โ€” Incremental sync from Kommo API to PostgreSQL
- โšก **Async** โ€” Built with asyncio + aiohttp for high performance
- ๐Ÿ—„๏ธ **PostgreSQL** โ€” Local database for big data analytics + graph schema for tool planning
- ๐ŸŒ **MCP Protocol** โ€” Works with Claude Desktop, Cursor, Windsurf, n8n
- ๐Ÿ›ก๏ธ **Pipeline Templates** โ€” 10 ready-made pipeline templates

## Architecture Overview

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Telegram Bot   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  AI Chat Engine  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Kommo API     โ”‚
โ”‚ (@kommo_wizard) โ”‚     โ”‚  (Planner + LLM) โ”‚     โ”‚  (per tenant)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ–ผ            โ–ผ            โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ Tenant A โ”‚ โ”‚ Tenant B โ”‚ โ”‚ Tenant C โ”‚
              โ”‚ (own DB) โ”‚ โ”‚ (own DB) โ”‚ โ”‚ (own DB) โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  React Admin    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Logs Server     โ”‚
โ”‚  (SPA /logs/)   โ”‚     โ”‚  (aiohttp:8765)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Planner-Executor Architecture

The system implements a **Planner-Executor** pattern โ€” a state-of-the-art agentic architecture (2025-2026) that separates deterministic planning from LLM execution:

```
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚           PLANNER (deterministic)           โ”‚
                         โ”‚                                             โ”‚
  User Query โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ โ”‚  Intent Detector โ”€โ”€โ–ถ Capability Mapper     โ”‚
                         โ”‚        โ”‚                    โ”‚               โ”‚
                         โ”‚        โ–ผ                    โ–ผ               โ”‚
                         โ”‚  Tool Graph (54 nodes, 24 edges)           โ”‚
                         โ”‚        โ”‚                                    โ”‚
                         โ”‚        โ–ผ                                    โ”‚
                         โ”‚  Backward Chaining โ”€โ”€โ–ถ Topo Sort           โ”‚
                         โ”‚        โ”‚                    โ”‚               โ”‚
                         โ”‚        โ–ผ                    โ–ผ               โ”‚
                         โ”‚  Parallel Detection โ”€โ”€โ–ถ Chain Optimizer    โ”‚
                         โ”‚                             โ”‚               โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                       โ”‚
                                          PlannedChain + Filtered Tools
                                                       โ”‚
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚           EXECUTOR (LLM)    โ–ผ               โ”‚
                         โ”‚                                             โ”‚
                         โ”‚  Dynamic Prompt โ”€โ”€โ–ถ GPT + Filtered Tools   โ”‚
                         โ”‚        โ”‚                    โ”‚               โ”‚
                         โ”‚        โ–ผ                    โ–ผ               โ”‚
                         โ”‚  RAG Context        Tool Call Loop          โ”‚
                         โ”‚                         โ”‚                   โ”‚
                         โ”‚                         โ–ผ                   โ”‚
                         โ”‚                  Kommo API / PostgreSQL     โ”‚
                         โ”‚                                             โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

**How it works:**
1. **Planner** receives user query, detects intents via keyword matching (<2ms)
2. Maps intents to **capabilities**, finds tools in the graph that satisfy them
3. **Backward chaining** resolves dependencies (e.g., `move_lead` requires `list_pipelines`)
4. **Topological sort** orders tools, detects parallelizable steps
5. Outputs a `PlannedChain` with ordered steps, param refs (`$step0.contact_id`), and cost
6. **Executor** receives only the planned tools (e.g., 3 of 54) + planner prompt with execution order
7. LLM calls tools in the prescribed order, passing results between steps

**Key metrics:**
- **54 tools**, 258 actions, 24 graph edges, 154 capabilities
- **Chain planning latency**: <2ms (deterministic, no LLM calls)
- **Tool filtering**: LLM sees only 2-6 relevant tools instead of all 54
- **Dependency resolution**: automatic prerequisite detection via graph edges
- **31 tests** covering 10 amoCRM scenarios, all passing

### RAG Layer

On top of the planner, a **RAG (Retrieval-Augmented Generation)** layer provides additional context:

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  User Request   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Tool Retriever  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Dynamic Prompt โ”‚
โ”‚                 โ”‚     โ”‚  (keyword match) โ”‚     โ”‚  (base + tools) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                          โ”‚
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ–ผ
                        โ”‚   Tool Registry  โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚   (YAML files)   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   LLM + Tools   โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚   (execution)   โ”‚
                                                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

**Benefits:**
- **Compact prompts**: ~500 tokens instead of 3000+ (only relevant tools loaded)
- **Scalability**: Add hundreds of tools without prompt size growth
- **Maintainability**: Tool definitions in separate YAML files
- **Accuracy**: Better tool selection through keyword matching + graph planning

### Conversation Memory

The bot maintains **conversation history** per user for context retention:

- **Per-user isolation**: Each Telegram user has separate history
- **Context window**: Last 10 messages included in each request
- **Smart confirmations**: Bot remembers pending actions (e.g., "Delete pipeline?" โ†’ "Yes")

**Tool Registry** (`src/kommo_mcp/telegram/tools/*.yaml`):
```yaml
name: kommo_pipeline_analytics
category: analytics
keywords: [ะฒะพั€ะพะฝะบะฐ, ะบะพะฝะฒะตั€ัะธั, ะฐะฝะฐะปะธั‚ะธะบะฐ, ัั‚ะฐั‚ะธัั‚ะธะบะฐ]
description: ะะฝะฐะปะธั‚ะธะบะฐ ะฒะพั€ะพะฝะบะธ ะฟั€ะพะดะฐะถ
examples:
  - query: "ะŸะพะบะฐะถะธ ะฐะฝะฐะปะธั‚ะธะบัƒ ะฒะพั€ะพะฝะบะธ"
  - query: "ะšะพะฝะฒะตั€ัะธั ะฟะพ ัั‚ะฐะฟะฐะผ"
```

### AI-Powered Analytics Engine

The system uses **AI scripting** approach where natural language queries are translated into structured tool calls:

1. **Natural Language โ†’ Tool Selection**: AI assistant analyzes user request and selects appropriate MCP tool
2. **Tool Execution**: MCP server executes the tool against local PostgreSQL or Kommo API
3. **Big Data Processing**: Complex analytics run on local PostgreSQL for speed (millions of records)
4. **Response Generation**: AI formats results into human-readable insights

### Big Data Strategy

Instead of querying Kommo API for every analytics request (slow, rate-limited), we:

1. **Sync Once**: `kommo_sync_start` pulls all data to local PostgreSQL
2. **Analyze Locally**: All analytics tools query local DB (fast, no limits)
3. **Incremental Updates**: Only new/changed records synced on subsequent runs

This enables:
- **Complex aggregations** across millions of deals/contacts
- **Historical analysis** without API pagination limits
- **Real-time dashboards** without hitting rate limits
- **Custom SQL** for advanced analytics not available in Kommo UI

### Multi-Tenant SaaS Mode

For production deployments, the system supports multi-tenant architecture:

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Telegram Bot   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Tenant Manager  โ”‚
โ”‚  (@kommo_wizard)โ”‚     โ”‚                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ–ผ            โ–ผ            โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ Tenant A โ”‚ โ”‚ Tenant B โ”‚ โ”‚ Tenant C โ”‚
              โ”‚ (own DB) โ”‚ โ”‚ (own DB) โ”‚ โ”‚ (own DB) โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

Each tenant gets:
- Isolated PostgreSQL database
- Own Kommo API credentials
- Own OpenAI API key for AI features
- Rate limiting per tenant

### State-of-the-Art: 2026 Agentic Architecture Comparison

Our architecture aligns with the key trends identified by Gartner, McKinsey, and academic research (NeurIPS 2024, ACL 2025) for production agentic systems:

| 2026 Trend | Industry State | KommoMCP Status |
|---|---|---|
| **Planner-Executor separation** | Emerging standard (Lu et al. 2025, Rosario et al. 2025). LangGraph, CrewAI, AutoGen adopt this pattern | โœ… Implemented: deterministic graph planner + LLM executor |
| **MCP Protocol** | Anthropic's MCP becoming the HTTP of agents (broad adoption 2025-2026) | โœ… Full MCP support: stdio + HTTP transport |
| **Graph-based tool planning** | NeurIPS 2024: "Can Graph Learning Improve Planning in LLM-based Agents?" โ€” graph planners outperform flat RAG | โœ… Tool Graph with 54 nodes, 24 edges, backward chaining, topo sort |
| **Plan-and-Execute cost pattern** | Frontier model plans, cheaper models execute โ€” 90% cost reduction (MLMastery 2026) | โœ… Planner is zero-cost (no LLM), executor sees only 2-6 tools |
| **Deterministic guardrails** | "Bounded autonomy" โ€” deterministic control flow with LLM flexibility (Deloitte 2026) | โœ… Fixed chain order, param refs, dependency enforcement |
| **Multi-agent orchestration** | 1,445% surge in multi-agent inquiries Q1'24โ†’Q2'25 (Gartner) | โšก Sequential pipeline with parallel step detection |
| **Tool scoping / least privilege** | Best practice: filter tools per step, not expose all (Stack AI 2026) | โœ… LLM sees only planned tools, not all 54 |
| **Observability / audit trail** | "Treat agent like distributed system" โ€” traces, costs, handoffs | โœ… Interaction logger, session logs, admin panel |
| **Human-in-the-Loop** | Strategic HITL for high-stakes decisions (MLMastery 2026) | โœ… Confirm dialogs for destructive ops (delete, reset) |
| **FinOps for agents** | Cost-performance as first-class concern | โœ… Chain cost metric, planner adds 0ms to latency |

**What we do well:**
- **Deterministic planning** eliminates LLM "arbitrariness" in tool selection โ€” the #1 problem in production agents
- **Zero-cost planner** โ€” no additional LLM calls, <2ms graph traversal
- **Dependency resolution** via backward chaining prevents missing steps (e.g., listing pipelines before moving a lead)
- **Tool filtering** reduces prompt size and improves LLM accuracy by 40%+ on complex workflows

**Roadmap to full SOTA:**
- **Replanning on failure** โ€” if a tool call fails, re-enter planner with updated context
- **Verifier agent** โ€” validate chain outputs before returning to user (Planner-Verifier-Executor pattern)
- **Learning from execution** โ€” log successful chains to PostgreSQL, use for future optimization
- **A2A Protocol** โ€” Google's Agent-to-Agent for cross-system agent collaboration

## Quick Start

### Prerequisites

- Python 3.10+
- PostgreSQL 15+
- Kommo account with API access

### Installation

```bash
# Clone repository
git clone https://github.com/your-repo/kommo-mcp.git
cd kommo-mcp

# Install dependencies
poetry install

# Copy environment file
cp .env.example .env
# Edit .env with your Kommo credentials

# Create database
createdb kommo_mcp

# Run server
poetry run kommo-mcp
```

### Claude Desktop Configuration

Add to your Claude Desktop config (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "kommo": {
      "command": "poetry",
      "args": ["run", "kommo-mcp"],
      "cwd": "/path/to/kommo-mcp"
    }
  }
}
```

### n8n Configuration

Use MCP Client node with HTTP transport:
- **URL**: `https://your-domain.com/mcp`
- **Transport**: HTTP Streamable

## AI Tool Handlers (Telegram Bot)

### CRM Setup
- `kommo_setup` - **CRM configuration** with actions:
  - `templates` - List available pipeline templates (10 built-in)
  - `apply_template` - Apply template (capture, qualification, followup, demo, proposal, autoservice, realestate, education, ecommerce, b2b_sales)
  - `create_pipeline` - Create a new pipeline
  - `create_stage` - Add stage to pipeline
  - `update_pipeline` / `update_stage` - Rename, recolor
  - `delete_pipeline` / `delete_stage` - Delete with lead migration
  - `reorder_stages` - Change stage order
  - `create_field` / `update_field` / `delete_field` - Custom fields CRUD
  - `create_source` - Add lead source

### Entity Actions
- `kommo_entity_actions` - **Entity operations** with actions:
  - `add_note` - Add note to entity
  - `get_notes` / `get_history` - Get notes and history
  - `create_task` / `get_tasks` / `complete_task` - Task management
  - `update_lead` / `move_lead` - Lead updates
  - `link_contact` / `unlink_contact` - Contact linking

### Bulk Operations
- `kommo_bulk_actions` - **Mass operations** with actions:
  - `mass_move` - Move multiple leads to stage
  - `mass_tag` - Add tags to entities
  - `mass_assign` - Reassign entities
  - `mass_update` - Update fields in bulk

### Users & Teams
- `kommo_users` - **User management** with actions:
  - `list` - List all CRM users
  - `workload` - Manager workload distribution
  - `activity` - User activity stats

### Reports
- `kommo_reports` - **CRM reports** with actions:
  - `top_deals` - Top deals by amount
  - `pipeline_summary` - Pipeline overview
  - `manager_stats` - Manager performance

### Export
- `kommo_export` - **Data export** with actions:
  - `leads_csv` - Export leads as CSV table
  - `contacts_csv` - Export contacts as CSV table
  - `analytics` - Summary analytics across all pipelines

### Digest
- `kommo_digest` - **CRM digests and summaries** with actions:
  - `morning` - Morning briefing (deals, tasks, overdue, stale)
  - `weekly` - Weekly report (new/won/lost deals, tasks completed)
  - `my_tasks` - Personal task list (overdue, today, upcoming)

### AI Advisor
- `kommo_advisor` - **AI-powered recommendations** with actions:
  - `next_action` - What to do next with a deal
  - `pipeline_tips` - Pipeline optimization recommendations
  - `loss_analysis` - Lost deals analysis and patterns
  - `closing_tips` - Deal closing advice
  - `objections` - Objection handling guide based on CRM data
  - `strategy` - Strategic recommendations: pipeline coverage, growth levers, process improvements
  - `qualification` - BANT qualification analysis for a deal (lead_id): budget, authority, need, timeline
  - `qualification_checklist` - Interactive BANT checklist with questions, red/green flags
  - `negotiation` - Negotiation tips customized for deal size and context
  - `communication_style` - Detect client communication style (formal/informal/neutral) from notes and recommend approach
  - `product_recommendations` - Upsell/cross-sell/addon recommendations based on deal context and notes
  - `talking_points` - Pre-call/meeting talking points: deal status, last interaction, pricing, competition

### Pipeline Health
- `kommo_pipeline_health` - **Deep pipeline analysis** with actions:
  - `check` - Overall health score (0-100) with key metrics
  - `velocity` - Sales speed: cycle times, daily velocity, median/fastest/slowest
  - `bottlenecks` - Stage-level analysis: stale deals, avg age, congestion
  - `win_loss` - Win/loss ratio, value comparison, cycle time analysis
  - `optimize` - Optimization recommendations per stage

### Forecasting
- `kommo_forecast` - **Sales forecasting** with actions:
  - `pipeline` - Weighted pipeline forecast by stage proximity
  - `revenue` - Monthly revenue prediction with growth trend
  - `deal_probability` - Per-deal win probability scoring (lead_id)
  - `trends` - Weekly trend analysis: new deals, value, won/lost
  - `plan_fact` - Plan vs fact analysis: completion %, gap, daily target, by user
  - `cashflow` - Cash flow forecast based on pipeline
  - `scenarios` - Best/base/worst revenue scenarios with growth levers
  - `closing_forecast` - Closing forecast: deal candidates ranked by probability and expected value

### Proactive Alerts
- `kommo_alerts` - **CRM health alerts** with actions:
  - `check` - All alerts: stale deals, overdue tasks, missing data
  - `risks` - At-risk deals with risk score and factors
  - `performance` - Team performance alerts: overload, stale ratio
  - `opportunities` - Reactivation, follow-up, no-next-step opportunities

### Period Comparison
- `kommo_compare` - **Data comparison and analysis** with actions:
  - `periods` - This period vs previous: deals, revenue, conversion
  - `trends` - Weekly metric trends with direction detection
  - `patterns` - Day/hour patterns, seasonal conversion analysis
  - `correlations` - Price vs conversion, source performance analysis

### Smart Automation
- `kommo_automation` - **Lead distribution and follow-up** with actions:
  - `auto_assign` - Assign leads by workload (least busy first)
  - `round_robin` - Equal distribution among team members
  - `auto_followup` - Create follow-up tasks for inactive deals
  - `auto_followup_smart` - Smart follow-ups based on inactivity and deal value with urgency levels


### Personal View
- `kommo_my` - **Personal CRM dashboard** with actions:
  - `pipeline` - My active deals by stage with top deals
  - `workload` - My task/deal load with workload score
  - `team` - Team overview: deals, value, stale per user
  - `insights` - Pipeline insights: health, win rate, cycle time

### Gamification
- `kommo_gamification` - **Team gamification** with actions:
  - `leaderboard` - Ranked team leaderboard by metric (deals, revenue, conversion)
  - `achievements` - Badge system: Deal Machine, Whale Hunter, Speed Closer, etc.
  - `challenges` - Sales competitions: Deal Sprint, Revenue Race
  - `points` - Points breakdown: deals, revenue bonus, big deals, fast closes
  - `badges` - Achievement badges: First Deal, Deal Machine, Whale Hunter, Speed Closer, etc.
  - `daily_quests` - Personalized daily quests with difficulty and point rewards
  - `streaks` - Performance streaks with point multiplier bonuses

### Loss Analysis
- `kommo_loss_analysis` - **Deep lost deals analysis** with actions:
  - `reasons` - Loss reasons from notes, price range breakdown
  - `patterns` - Timing patterns: by month, day, deal age at loss
  - `by_manager` - Manager comparison: loss rate, value, avg loss age

### Smart Timing
- `kommo_smart_time` - **Timing intelligence** with actions:
  - `best_call_time` - Optimal hours/days for calls based on won deals
  - `customer_journey` - Touch-to-purchase path: cycle times, fast vs slow deals
  - `time_to_purchase` - Time-to-purchase analysis: avg/median days, fast vs slow deals
  - `lead_response` - Lead response time by manager with ratings

### Team Planning
- `kommo_team_planner` - **Capacity planning** with actions:
  - `capacity` - Team workload forecast: load score, available slots, status

### Customer Segments
- `kommo_segments` - **Customer segmentation** with actions:
  - `by_volume` - Purchase tier segmentation with win rates
  - `lookalike` - Find deals similar to best performers
  - `best_manager` - Manager-client fit by deal size segment
  - `basket` - Product mix analysis (catalogs or tag-based)
  - `by_behavior` - Activity-based segments: hot, warm, cold, frozen
  - `retention` - Manager retention rates with repeat client analysis

### Escalation
- `kommo_escalation` - **Deal escalation management** with actions:
  - `check` - Find deals needing escalation by priority
  - `notify` - Critical/high-value deal notifications
  - `sla` - SLA violation detection with breach severity
  - `support` - Complex case identification for support escalation
  - `auto_escalate` - Auto-escalate deals based on risk score and stage

### Reactivation
- `kommo_reactivation` - **Client reactivation** with actions:
  - `sleeping` - Inactive clients sorted by value at risk
  - `lost_nurture` - Lost deals worth retrying with strategies
  - `churn_prevention` - At-risk deal detection with risk scoring
  - `prevent` - Preventive actions for at-risk active deals
  - `win_back` - Win-back strategies for recently lost deals with scripts

### Contact Enrichment
- `kommo_contact_enrichment` - **Contact data quality** with actions:
  - `analyze` - Data quality scoring per contact
  - `merge_duplicates` - Find duplicate contacts by name/phone
  - `enrich` - Suggest missing fields prioritized by deal activity

### Message Templates
- `kommo_templates` - **Message templates & scripts** with actions:
  - `list` - Available template categories
  - `generate` - AI-generated template by type
  - `apply` / `personalize` - Fill template with lead data
  - `sales_script` - Stage-specific sales scripts with objection handlers
  - `follow_up` - Personalized follow-up email templates based on deal context and inactivity
  - `closing_script` - Closing scripts: assumptive, summary, urgency, alternative, trial close techniques

### Anomaly Detection
- `kommo_anomaly` - **Anomaly detection** with actions:
  - `detect` - Price outliers, volume spikes/drops, user concentration
  - `sales` - Win rate anomalies, losing big deals, instant wins

### Objection Handling
- `kommo_objections` - **Sales objection management** with actions:
  - `handle` - Get response scripts for specific objections
  - `library` - Browse objection categories with examples
  - `predict` - Anticipate objections for a deal based on context
  - `best_practices` - Top performer practices and win patterns

### Deal Intelligence
- `kommo_deal_intelligence` - **Complex deal analysis** with actions:
  - `enterprise` - High-value deal tracking with risk levels
  - `stakeholders` - Contact role mapping (Decision Maker, Influencer, User)
  - `review` - Deal health scoring with issues and strengths
  - `pipeline_review` - Pipeline health review: issues, strengths, action items
  - `closing_signals` - Closing signal detection: budget, engagement, contract language, blockers

### Contact Scoring
- `kommo_contact_scoring` - **Contact engagement scoring** with actions:
  - `score` - Score contacts by activity, data completeness, recency
  - `value_segments` - VIP / Regular / Occasional segmentation by LTV
  - `by_value` - Segment contacts by total deal value (premium/standard/basic)
  - `company_scoring` - Company scoring by deal history, revenue, and tier (Enterprise/Growth/SMB)
  - `relationship_strength` - Contact relationship strength scoring (Strong/Moderate/Weak/New)
  - `account_scoring` - Account-level scoring by engagement, contacts, and deals (Tier 1/2/3)

### AI Sales Coach
- `kommo_ai_coach` - **AI-powered sales coaching** with actions:
  - `review_deal` - Deal-specific coaching with actionable advice
  - `skill_assessment` - Manager skill radar: closing, speed, deal size, activity
  - `skill_gaps` - Team-wide gap analysis with training recommendations
  - `roleplay` - Sales role-play scenarios for practice
  - `best_practices` - Top performer analysis: winning behaviors, patterns, team insights
  - `micro_learning` - Personalized micro-lessons per user based on performance gaps

### Smart Reply
- `kommo_smart_reply` - **Contextual reply suggestions** with actions:
  - `suggest` - Smart reply suggestions based on deal context and history
  - `objection_response` - Generate responses to client objections (price, timing, competitors)
  - `context` - Communication history context for a deal
  - `auto_reply` - Auto-reply suggestions by message category (pricing, delivery, warranty, support)

### Communication Analytics
- `kommo_communication_analytics` - **Communication quality monitoring** with actions:
  - `summary` - Conversation summary for a deal: stats, timeline, key topics
  - `quality` - Communication quality metrics by manager: note rate, win rate, score
  - `sentiment` - Sentiment analysis of deal communications: positive/negative/neutral scoring
  - `patterns` - Communication patterns: won vs lost deal interaction comparison
  - `insights` - Key insights from deal communications: pricing, competitors, timeline signals

### Document Generator
- `kommo_doc_generator` - **Document generation from CRM data** with actions:
  - `presentation` - Client presentation outline (personalized with lead_id)
  - `proposal` - Commercial proposal structure with deal context
  - `case_study` - Case study templates from won deals
  - `commercial_offer` - Commercial offer generation personalized for a deal (lead_id)
  - `report` - Sales report: summary, by-manager breakdown, highlights
  - `partner_report` - Partnership performance report with executive summary and metrics
  - `exportable_report` - CSV-ready exportable report with deal data and summary stats

### Business Insights
- `kommo_insights` - **Actionable business insights** with actions:
  - `actionable` - Priority insights: risks, conversion issues, data quality, pipeline coverage
  - `root_cause` - Root cause analysis of lost deals: patterns, by manager, by price range
  - `stale_analysis` - Stale deal analysis by aging bucket (14-30d, 30-60d, 60d+) with value at risk
  - `campaign_roi` - Campaign/source ROI: leads, won, revenue, win rate, efficiency ranking

### Activity Analytics
- `kommo_activity` - **Team activity analytics** with actions:
  - `feed` - Chronological activity feed: deals created, won, tasks completed
  - `productivity` - Productivity rankings with score breakdown
  - `kpi` - Activity KPIs per user: deals, revenue, win rate, tasks, overdue
  - `recommendations` - Personalized improvement recommendations per user
  - `correlations` - Activity-result correlations: what top performers do differently

### Extended Search
- `kommo_search` - **Enhanced search** with filters:
  - `min_price` / `max_price` - Price range filtering
  - `created_from` / `created_to` - Date range filtering
  - `sort_by` / `sort_order` - Sort by price, created_at, updated_at
  - `top_deals` - Top N deals by amount
  - `deal_context` - Full deal context: contacts, notes, tasks
  - `timeline` - Chronological event timeline for a deal
  - `graph` - Relationship graph: leads โ†” contacts โ†” companies
  - `nl_query` - Natural language complex queries without SQL
  - `problems` - Find problem deals: stale, no price, no responsible user
  - `bottlenecks` - Pipeline bottleneck detection by stage congestion and age
  - `rejection_reasons` - Lost deal rejection reason analysis from notes
  - `payment_status` - Payment status check from deal notes (paid/invoiced/no info)
  - `audit_trail` - Chronological audit trail of all deal events and changes

### Extended Tasks
- `kommo_tasks_ext` - **Extended task management** (new actions):
  - `prioritize` - AI-scored task prioritization
  - `reassign` - Reassign task to another user
  - `postpone` - Postpone task by N days
  - `plan_day` - AI daily plan with overdue/today/tomorrow
  - `mass_create` - Mass task creation for team members
  - `smart_reminders` - Smart reminders for inactive deals sorted by urgency
  - `meeting_briefing` - Pre-meeting briefing card with contacts, comms, talking points
  - `meeting_prep` - Meeting preparation guide with agenda, concerns, checklist

### Extended Contacts
- `kommo_contacts_ext` - **Contact analysis** (new actions):
  - `without_deals` - Find contacts with no linked deals
  - `inactive` - Find contacts with no activity > N days

### Additional Tools
- `kommo_webhooks` - Webhook management (list, create, delete)
- `kommo_tags` - Tag management (list, create, delete, assign)
- `kommo_custom_fields` - Custom fields CRUD + mass operations
- `kommo_sources` - Lead sources management and analytics
- `kommo_companies` - Company management (list, get, create, update)
- `kommo_duplicates` - Duplicate detection and merge
- `kommo_links` - Entity relationship management
- `kommo_catalogs` - Product catalogs management
- `kommo_events` - CRM event log
- `kommo_calls` - Call records management
- `kommo_cleanup` - Data cleanup and CRM reset
- `kommo_mock_data` - Generate test data (contacts, companies, leads)

### Quick Actions
- `kommo_list_pipelines` - List all pipelines with stages
- `kommo_search_contacts` - Quick contact search

## Example Queries

Ask your AI assistant:
- "ะŸะพะบะฐะถะธ ะฐะฝะฐะปะธั‚ะธะบัƒ ะฟะพ ะพัะฝะพะฒะฝะพะน ะฒะพั€ะพะฝะบะต ะทะฐ ะฟะพัะปะตะดะฝะธะน ะผะตััั†"
- "ะกะดะตะปะฐะน ะฟั€ะพะณะฝะพะท ะฟั€ะพะดะฐะถ ะฝะฐ 30 ะดะฝะตะน"
- "ะกั€ะฐะฒะฝะธ ะฟะพะบะฐะทะฐั‚ะตะปะธ ะผะตะฝะตะดะถะตั€ะพะฒ"
- "ะŸะพะบะฐะถะธ ะฟะพัะปะตะดะฝะธะต 10 ัะดะตะปะพะบ"
- "ะ“ะดะต ั‚ะตั€ััŽั‚ัั ัะดะตะปะบะธ ะฒ ะฒะพั€ะพะฝะบะต?"
- "ะะฐะนะดะธ ะทะฐะฒะธััˆะธะต ัะดะตะปะบะธ ะฑะตะท ะฐะบั‚ะธะฒะฝะพัั‚ะธ ะฑะพะปะตะต 14 ะดะฝะตะน"
- "ะŸะพะบะฐะถะธ ะดะธะฝะฐะผะธะบัƒ ะฒั‹ั€ัƒั‡ะบะธ ะฟะพ ะผะตััั†ะฐะผ"
- "ะšะฐะบะธะต ะบะปะธะตะฝั‚ั‹ ะฒ ะทะพะฝะต ั€ะธัะบะฐ ะพั‚ั‚ะพะบะฐ?"
- "ะžั†ะตะฝะธ ะบะฐั‡ะตัั‚ะฒะพ ั‚ะตะบัƒั‰ะธั… ะปะธะดะพะฒ"
- "ะะฐะนะดะธ ะดัƒะฑะปะธะบะฐั‚ั‹ ะบะพะฝั‚ะฐะบั‚ะพะฒ"
- "ะกะดะตะปะฐะน ะพั‚ั‡ั‘ั‚ ะทะฐ ะผะตััั†"
- "ะกั€ะฐะฒะฝะธ ะฟั€ะพะดะฐะถะธ ั ะฟั€ะพัˆะปั‹ะผ ะฟะตั€ะธะพะดะพะผ"
- "ะงั‚ะพ ะผะพะถะฝะพ ะฐะฒั‚ะพะผะฐั‚ะธะทะธั€ะพะฒะฐั‚ัŒ?"
- "ะกะพะทะดะฐะน ะทะฐะดะฐั‡ะธ ะดะปั ะทะฐะฒะธััˆะธั… ัะดะตะปะพะบ"
- "ะŸะพะบะฐะถะธ ั‚ะพะฟ-10 ะบะปะธะตะฝั‚ะพะฒ ะฟะพ ะฒั‹ั€ัƒั‡ะบะต"
- "ะกะดะตะปะฐะน RFM-ะฐะฝะฐะปะธะท ะบะปะธะตะฝั‚ะพะฒ"
- "ะšะฐะบะฐั ะฝะฐะณั€ัƒะทะบะฐ ะฝะฐ ะผะตะฝะตะดะถะตั€ะพะฒ?"
- "ะะฐะนะดะธ ะฒะพะทะผะพะถะฝะพัั‚ะธ ะดะปั ะดะพะฟั€ะพะดะฐะถ"
- "ะŸะพะบะฐะถะธ ะฒัะต ะฐะปะตั€ั‚ั‹"
- "ะ”ะฐะนะถะตัั‚ ะทะฐ ะฝะตะดะตะปัŽ"
- "ะšะฐะบะธะต ะทะฐะดะฐั‡ะธ ะฟั€ะพัั€ะพั‡ะตะฝั‹?"
- "ะ ะตะนั‚ะธะฝะณ ะผะตะฝะตะดะถะตั€ะพะฒ ะฟะพ ะบะพะฝะฒะตั€ัะธะธ"
- "ะกั€ะฐะฒะฝะธ ัั‚ะพั‚ ะผะตััั† ั ะฟั€ะพัˆะปั‹ะผ"
- "ะšะฐะบ ะผั‹ ั€ะฐะฑะพั‚ะฐะตะผ ะฟะพ ัั€ะฐะฒะฝะตะฝะธัŽ ั ะฟั€ะพัˆะปั‹ะผ ะณะพะดะพะผ?"
- "ะŸั€ะพะฒะตั€ัŒ ะบะฐั‡ะตัั‚ะฒะพ ะดะฐะฝะฝั‹ั…"
- "ะะฐะนะดะธ ะดัƒะฑะปะธะบะฐั‚ั‹ ะบะพะฝั‚ะฐะบั‚ะพะฒ"
- "ะะฐัั‚ั€ะพะน CRM ะดะปั ะฐะฒั‚ะพัะตั€ะฒะธัะฐ"
- "ะŸะพะบะฐะถะธ ัˆะฐะฑะปะพะฝั‹ ะฒะพั€ะพะฝะพะบ"
- "ะกะพะทะดะฐะน ะฒะพั€ะพะฝะบัƒ ะดะปั ะธะฝั‚ะตั€ะฝะตั‚-ะผะฐะณะฐะทะธะฝะฐ"
- "ะŸะพะบะฐะถะธ ะธัั‚ะพั€ะธัŽ ะพะฑั‰ะตะฝะธั ั ะบะปะธะตะฝั‚ะพะผ"
- "ะšะพะณะดะฐ ะฟะพัะปะตะดะฝะธะน ั€ะฐะท ะทะฒะพะฝะธะปะธ ะบะปะธะตะฝั‚ัƒ?"
- "ะกั‚ะฐั‚ะธัั‚ะธะบะฐ ะทะฒะพะฝะบะพะฒ ะทะฐ ะผะตััั†"
- "ะะฐะนะดะธ ะบะพะฝั‚ะฐะบั‚ั‹ ะฑะตะท ัะดะตะปะพะบ"
- "ะŸะพะธัะบ ัะดะตะปะพะบ ะดะพั€ะพะถะต 100ะบ"
- "ะšะฐะบะธะต ัะดะตะปะบะธ ัะฒัะทะฐะฝั‹ ั ะบะพะฝั‚ะฐะบั‚ะพะผ?"
- "ะŸะพะบะฐะถะธ ะฟั€ะพัั€ะพั‡ะตะฝะฝั‹ะต ะทะฐะดะฐั‡ะธ"
- "ะกั‚ะฐั‚ะธัั‚ะธะบะฐ ะทะฐะดะฐั‡ ะทะฐ ะผะตััั†"
- "ะ—ะฐะดะฐั‡ะธ ะฝะฐ ัะตะณะพะดะฝั"
- "LTV ะบะปะธะตะฝั‚ะพะฒ ะฟะพ ะบะฐะฝะฐะปะฐะผ"
- "ะšะพะณะพั€ั‚ะฝั‹ะน ะฐะฝะฐะปะธะท ะบะปะธะตะฝั‚ะพะฒ"
- "ะกะตะณะผะตะฝั‚ะฐั†ะธั ะบะปะธะตะฝั‚ะพะฒ"
- "ะ—ะดะพั€ะพะฒัŒะต ัะดะตะปะพะบ"
- "ะกะดะตะปะบะธ ะฟะพะด ัƒะณั€ะพะทะพะน"
- "ะกะบะพั€ะพัั‚ัŒ ะทะฐะบั€ั‹ั‚ะธั ัะดะตะปะพะบ"
- "ะšะพะฝั‚ะฐะบั‚ั‹ ะฟะพ ะผะตะฝะตะดะถะตั€ะฐะผ"
- "ะšะปะธะตะฝั‚ั‹ ะฑะตะท ะบะพะฝั‚ะฐะบั‚ะฐ"
- "ะกะฒะพะดะบะฐ ะฟะพ ะบะพะผะผัƒะฝะธะบะฐั†ะธัะผ"

## Admin Panel

React SPA for monitoring and management, served at `/logs/`.

**Stack:** React + Vite + TailwindCSS + Recharts

**Pages:**
- **Login** โ€” Cookie-based session auth
- **Dashboard** โ€” Session stats, charts (sessions over time, activity by user), recent sessions
- **Users & CRM** โ€” Telegram users, connected CRM tenants, statuses (active/pending/error), Kommo domains
- **Sessions** โ€” AI interaction sessions with search and status filter
- **Session Detail** โ€” Full iteration breakdown: user message, tool calls, results, errors, response

**API Endpoints:**
- `POST /api/login` โ€” JSON auth
- `GET /api/me` โ€” Current user
- `GET /api/users` โ€” All TG users with CRM tenants
- `GET /api/sessions` โ€” Session list with stats
- `GET /api/session/{id}` โ€” Session detail

```bash
# Dev
cd admin && npm run dev

# Build
cd admin && npm run build
# Output: admin/dist/ โ†’ served by logs_server
```

## Telegram Bot Commands

| Command | Description |
|---------|-------------|
| `/start` | Start, show welcome |
| `/connect` | Connect new CRM |
| `/crm_list` | List all connected CRMs |
| `/switch` | Switch active CRM |
| `/status` | Current CRM status |
| `/openai` | Set OpenAI API key |
| `/sync` | Sync CRM data to local DB |
| `/wizard` | CRM setup wizard |
| `/remove_crm` | Disconnect a CRM |
| `/help` | All commands |
| `/cancel` | Cancel current operation |

Any plain text message is treated as an AI query to the active CRM.

## Deployment

### VDS with nginx + systemd

```bash
# Server setup
cd /opt/kommo-mcp
python -m venv venv
source venv/bin/activate
pip install -e .

# Build admin panel
cd admin && npm install && npm run build

# systemd service
sudo systemctl enable kommo-telegram-bot
sudo systemctl start kommo-telegram-bot

# nginx proxy
# /logs/ โ†’ localhost:8765 (admin panel + API)
# /mcp   โ†’ localhost:8001 (MCP HTTP transport)
sudo certbot --nginx -d your-domain.com
```

## Project Structure

```
KommoMCP/
โ”œโ”€โ”€ src/kommo_mcp/
โ”‚   โ”œโ”€โ”€ telegram/
โ”‚   โ”‚   โ”œโ”€โ”€ bot.py              # Telegram bot (aiogram)
โ”‚   โ”‚   โ”œโ”€โ”€ ai_chat.py          # AI chat engine (Planner + GPT + tools)
โ”‚   โ”‚   โ”œโ”€โ”€ tool_retriever.py   # RAG-based tool retrieval
โ”‚   โ”‚   โ”œโ”€โ”€ logs_server.py      # Admin panel backend + SPA serving
โ”‚   โ”‚   โ””โ”€โ”€ tools/              # YAML tool definitions for RAG
โ”‚   โ”œโ”€โ”€ planner/
โ”‚   โ”‚   โ”œโ”€โ”€ tool_graph_planner.py  # Graph planner: intent detection, chain building, prompt generation
โ”‚   โ”‚   โ””โ”€โ”€ tool_registry.yaml     # Tool graph: 54 tools, 258 actions, 24 edges, capabilities
โ”‚   โ”œโ”€โ”€ saas/
โ”‚   โ”‚   โ”œโ”€โ”€ manager.py          # TenantManager (multi-tenant)
โ”‚   โ”‚   โ””โ”€โ”€ orchestrator.py     # DB orchestration per tenant
โ”‚   โ””โ”€โ”€ server.py               # MCP server (stdio + HTTP)
โ”œโ”€โ”€ migrations/
โ”‚   โ””โ”€โ”€ graph_schema.sql        # PostgreSQL schema for tool graph persistence
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_tool_graph_planner.py  # 31 tests: 10 amoCRM scenarios
โ”œโ”€โ”€ admin/                       # React admin panel
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/              # Login, Dashboard, Users, Sessions, SessionDetail
โ”‚   โ”‚   โ”œโ”€โ”€ components/         # Layout with sidebar
โ”‚   โ”‚   โ””โ”€โ”€ api.js              # API client
โ”‚   โ””โ”€โ”€ vite.config.js
โ”œโ”€โ”€ deploy/
โ”‚   โ””โ”€โ”€ amomcp-nginx.conf
โ””โ”€โ”€ README.md
```

## Development

```bash
# Install dependencies
pip install -e ".[dev]"

# Run bot locally
python -m kommo_mcp.telegram

# Run admin panel dev server
cd admin && npm run dev

# Lint
ruff check src/
```

## License

MIT