Skip to main content
Glama
@theyahia/amocrm-mcp

@theyahia/amocrm-mcp

by theYahia

@theyahia/amocrm-mcp

面向 amoCRM API 的生产级 MCP 服务器。19 个工具涵盖线索、联系人、公司、管道、任务、备注、搜索、事件和未分类线索。支持 OAuth 2.0 自动刷新令牌。速率限制(7 请求/秒)。采用指数退避重试。

安装

npx -y @theyahia/amocrm-mcp

Related MCP server: KommoMCP

MCP 配置

添加到你的 Claude Desktop、Cursor 或任何 MCP 客户端配置中:

{
  "mcpServers": {
    "amocrm": {
      "command": "npx",
      "args": ["-y", "@theyahia/amocrm-mcp"],
      "env": {
        "AMOCRM_SUBDOMAIN": "mycompany",
        "AMOCRM_ACCESS_TOKEN": "your-access-token",
        "AMOCRM_REFRESH_TOKEN": "your-refresh-token",
        "AMOCRM_CLIENT_ID": "your-client-id",
        "AMOCRM_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

环境变量

变量

必填

描述

AMOCRM_SUBDOMAIN

是

你的 amoCRM 子域名(例如 mycompany.amocrm.ru 中的 mycompany)

AMOCRM_ACCESS_TOKEN

是

OAuth 访问令牌

AMOCRM_REFRESH_TOKEN

否

OAuth 刷新令牌(在 401 时启用自动刷新)

AMOCRM_CLIENT_ID

否

OAuth 客户端 ID(刷新令牌时必须填写)

AMOCRM_CLIENT_SECRET

否

OAuth 客户端密钥(刷新令牌时必须填写)

AMOCRM_DOMAIN 也可作为 AMOCRM_SUBDOMAIN 的别名(向后兼容)。

工具(19)

线索

工具

描述

list_leads

按筛选条件(管道、状态、查询)搜索并列出线索。嵌入联系人和失败原因。

get_lead

按 ID 获取单个线索,包含关联的联系人和目录元素。

create_lead

创建一个新线索,包含名称、金额、管道、状态和自定义字段。

update_lead

更新线索字段——在阶段之间移动、修改金额、重新分配。

联系人

工具

描述

list_contacts

按姓名、电话、电子邮件搜索联系人。

get_contact

获取单个联系人及其所有自定义字段。

create_contact

创建联系人,包含电话、电子邮件和自定义字段。

公司

工具

描述

list_companies

搜索公司。嵌入关联的线索和联系人。

create_company

创建公司,包含自定义字段。

管道

工具

描述

list_pipelines

列出所有销售管道及其状态(阶段)。

任务

工具

描述

list_tasks

按实体、完成状态、负责人筛选并列出任务。

create_task

创建与线索/联系人/公司关联的任务,并设置截止时间。

complete_task

将任务标记为已完成并添加结果文本。

未分类线索

工具

描述

list_unsorted

列出进入的未分类线索(表单、邮件解析)。

accept_unsorted

将未分类线索接收至管道。

备注

工具

描述

add_note

向任意实体添加备注(common、call_in、call_out、service_message)。

搜索

工具

描述

search

跨线索、联系人和公司的通用搜索。

事件

工具

描述

list_events

活动日志——状态变更、通话、备注、关联。

账户

工具

描述

get_account

账户信息、用户、任务类型、amojo 设置。

演示提示

销售概览:

“显示‘Sales’管道中当前处于‘Negotiation’阶段的所有线索。包含联系人信息。”

任务管理:

“为线索 #12345 创建跟进电话任务,截止时间为明天上午 10:00。然后列出我所有未完成的任务。”

新客户引导:

“创建联系人‘Ivan Petrov’,电话 +79001234567;然后创建公司‘Petrov Solutions’和线索‘Website Development’,金额为 150,000 RUB,放入主管道。”

OAuth 2.0 设置指南

  1. 转到你的 amoCRM 账户设置:https://YOUR_SUBDOMAIN.amocrm.ru/settings/widgets/

  2. 创建一个新的集成(外部集成)

  3. 将重定向 URI 设置为 https://YOUR_SUBDOMAIN.amocrm.ru

  4. 复制客户端 ID和客户端密钥

  5. 授权该集成以获取初始授权码

  6. 用该授权码换取令牌:

curl -X POST https://YOUR_SUBDOMAIN.amocrm.ru/oauth2/access_token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "grant_type": "authorization_code",
    "code": "YOUR_AUTH_CODE",
    "redirect_uri": "https://YOUR_SUBDOMAIN.amocrm.ru"
  }'
  1. 保存响应中的 access_token 和 refresh_token

  2. 如果设置了 AMOCRM_REFRESH_TOKEN、AMOCRM_CLIENT_ID 和 AMOCRM_CLIENT_SECRET,服务器将自动刷新过期的令牌。

错误处理

  • 401 未授权:如果配置了刷新凭据,则自动刷新令牌,然后重试。

  • 429 请求过多:遵循 Retry-After 响应头,等待并重试。

  • 5xx 服务器错误:指数退避重试(最多 3 次)。

  • 速率限制:内置 150ms 请求间隔(约 7 请求/秒),以保持在 amoCRM 限制范围内。

开发

git clone https://github.com/theYahia/amocrm-mcp.git
cd amocrm-mcp
npm install
npm run build
npm test

许可证

MIT

Available Tools

19 tools
accept_unsortedA

Accept an unsorted lead — moves it into a pipeline as a real lead. Optionally specify target pipeline, status, and responsible user.

Inputs: uid (required), user_id, status_id, pipeline_id.

add_noteA

Add a note to a lead, contact, or company. Supports common notes, incoming/outgoing call logs, and service messages.

Inputs: text (required), entity_id (required), entity_type (required), note_type.

complete_taskA

Mark a task as completed and add a result text. The result will appear in the entity's activity feed.

Inputs: task_id (required), result_text (required).

create_companyA

Create a new company in amoCRM. Use custom_fields_values for address, website, etc.

Inputs: name (required), responsible_user_id, custom_fields_values.

create_contactA

Create a new contact in amoCRM. Use custom_fields_values to set phone, email, and other fields.

Inputs: name, last_name, first_name, responsible_user_id, +1 more.

create_leadA

Create a new lead (deal) in amoCRM. Requires a name. Optionally set price, pipeline, status, responsible user, and custom fields.

Inputs: name (required), price, status_id, pipeline_id, +2 more.

create_taskA

Create a task linked to a lead, contact, or company. Set deadline (complete_till as Unix timestamp) and task type (1=Call, 2=Meeting, 3=Email).

Inputs: text (required), entity_id (required), entity_type (required), complete_till (required), +2 more.

get_accountA

Get current amoCRM account info — name, plan, users, task types, etc. Use 'with' to include users_groups, task_types, and amojo_id.

Inputs: with.

get_contactA

Get a single contact by ID with full details including custom fields (phone, email, etc.).

Inputs: contact_id (required), with.

get_leadA

Get a single lead by ID with full details. Use 'with' to include linked contacts and catalog elements.

Inputs: lead_id (required), with.

list_companiesA

Search and list companies in amoCRM. Use 'with' to embed linked leads and contacts.

Inputs: page, with, limit, query.

list_contactsB

Search and list contacts in amoCRM. Supports full-text search across name, phone, and email.

Inputs: page, with, limit, query.

list_eventsA

List events (activity log) in amoCRM. Filter by entity type, entity ID, or event type. Shows status changes, calls, notes, and other activities.

Inputs: page, type, limit, entity, +1 more.

list_leadsA

Search and list deals (leads) in amoCRM. Supports filtering by pipeline, statuses, and full-text search. Use 'with' to embed contacts or loss reasons.

Inputs: page, with, limit, query, +2 more.

list_pipelinesA

List all sales pipelines with their statuses (stages). Essential for understanding the sales funnel structure before creating or filtering leads.

Inputs: no named parameters.

list_tasksA

List tasks in amoCRM. Filter by entity (lead/contact/company), completion status, or responsible user.

Inputs: page, limit, entity_id, entity_type, +2 more.

list_unsortedA

List incoming unsorted leads (from forms, email parsing, etc.) that need to be accepted or declined.

Inputs: page, limit, pipeline_id.

update_leadA

Update an existing lead — change name, price, status, pipeline, responsible user, or custom fields. Useful for moving deals between stages.

Inputs: lead_id (required), name, price, status_id, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 19 tools

    Disambiguation5/5

    Each tool maps to a distinct resource and action, such as list_leads vs get_lead vs create_lead, and list_unsorted/accept_unsorted are clearly separate from regular lead tools. No two tools appear to do the same job.

    Naming Consistency5/5

    Tool names consistently use lowercase snake_case verb_noun patterns like list_leads, create_contact, complete_task, and accept_unsorted. The bare 'search' is a reasonable exception for a universal action and does not break the overall convention.

    Tool Count3/5

    At 19 tools, the set falls into the heavy 16-25 range and begins to feel borderline bloated, even though the CRM domain covers many entities. The organization by entity helps, but the count is above the ideal 3-15 sweet spot.

    Completeness3/5

    Core lead and task workflows are well covered, but contacts and companies lack update/delete operations, there is no get_company, and unsorted leads can only be accepted, not declined. These are notable lifecycle gaps that agents may need to work around.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables users to interact with AmoCRM via Claude Desktop using natural language, with 17 tools for accessing CRM entities like leads, contacts, and pipelines.
      18
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      AI-powered CRM assistant for Kommo/amoCRM that provides natural language management via Telegram bot and MCP protocol, enabling analytics, entity operations, and CRM setup.
      8
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to interact with amoCRM, providing access to deals, contacts, companies, notes, tasks, and custom fields via natural language.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Manage Kommo CRM leads, contacts, companies, pipelines, tasks, notes, tags and custom fields from natural language. Also packaged as a Kiro Power.
      30
      28 PyPI
      2
      MIT