Skip to main content
Glama
bitrix24-mcp

bitrix24-mcp

by Rip-07

bitrix24-mcp

CI License: MIT Python 3.10+ PyPI

English · Русский

MCP server that lets AI agents (Claude, ChatGPT, Cursor, your own agents) work with a Bitrix24 portal: CRM deals, contacts, leads and tasks.

Unofficial project, not affiliated with 1C-Bitrix.


Русский

Что умеет

Инструмент

Что делает

Режим

whoami

от имени какого пользователя работает вебхук

чтение

list_deal_stages

стадии воронки (для фильтров и смены стадии)

чтение

list_deals

сделки с фильтрами по стадии, воронке, ответственному, названию

чтение

get_deal

все поля сделки

чтение

search_contacts

поиск контактов по телефону, email или имени

чтение

get_contact

карточка контакта

чтение

list_leads

лиды, в том числе по статусу

чтение

list_tasks

задачи по ответственному и статусу

чтение

create_lead

создать лид

запись

create_deal

создать сделку (по умолчанию в KZT)

запись

move_deal_stage

перевести сделку на другую стадию

запись

add_deal_comment

комментарий в таймлайн сделки

запись

create_task

создать задачу

запись

По умолчанию сервер только читает. Инструменты записи появляются при BITRIX24_READ_ONLY=false.

Быстрый старт

1. Создайте входящий вебхук в Bitrix24. Разработчикам → Другое → Входящий вебхук. Дайте только нужные права (crm, task, user). Скопируйте URL вида https://ваш-портал.bitrix24.kz/rest/1/xxxxxxxx/. Это секрет: с ним можно действовать в CRM от имени пользователя вебхука.

2. Подключите к Claude Code:

claude mcp add bitrix24 \
  -e BITRIX24_WEBHOOK_URL="https://ваш-портал.bitrix24.kz/rest/1/xxxxxxxx/" \
  -- uvx --from bitrix24-mcp-server bitrix24-mcp

Или к Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "bitrix24": {
      "command": "uvx",
      "args": ["--from", "bitrix24-mcp-server", "bitrix24-mcp"],
      "env": { "BITRIX24_WEBHOOK_URL": "https://ваш-портал.bitrix24.kz/rest/1/xxxxxxxx/" }
    }
  }
}

Без uv: pip install bitrix24-mcp-server, затем команда bitrix24-mcp.

3. Спросите агента: «покажи сделки на стадии "Переговоры"» или «найди контакт по номеру +7 701 123 45 67».

Docker (HTTP-режим для удалённых агентов)

cp .env.example .env   # заполните BITRIX24_WEBHOOK_URL и MCP_AUTH_TOKEN
docker compose up -d --build
curl http://127.0.0.1:8000/health

MCP-эндпоинт: http://127.0.0.1:8000/mcp. Клиент должен передавать заголовок Authorization: Bearer <MCP_AUTH_TOKEN>. Без токена HTTP-режим не запустится. Наружу публикуйте только через обратный прокси с TLS.

Настройки

Переменная

По умолчанию

Описание

BITRIX24_WEBHOOK_URL

—

URL входящего вебхука (обязательно)

BITRIX24_READ_ONLY

true

false включает инструменты записи

BITRIX24_ALLOW_RAW_CALLS

false

инструмент call_method для любого метода REST API

MCP_TRANSPORT

stdio

stdio или http

MCP_HOST / MCP_PORT

127.0.0.1 / 8000

адрес HTTP-сервера

MCP_AUTH_TOKEN

—

Bearer-токен, обязателен для http

MCP_ALLOW_NO_AUTH

false

true разрешает http без токена (только доверенная сеть)

MCP_ALLOWED_HOSTS

—

разрешённые заголовки Host (защита от DNS rebinding)

LOG_LEVEL

INFO

уровень логов (пишутся в stderr)

Безопасность

  • Режим только чтения по умолчанию, запись включается явно.

  • Токен вебхука маскируется в логах и сообщениях об ошибках.

  • Имена методов проверяются, произвольные пути к API не принимаются.

  • HTTP-режим требует Bearer-токен. Docker-образ работает от непривилегированного пользователя.

  • Повторные запросы при лимите Bitrix24 (QUERY_LIMIT_EXCEEDED).

Частые проблемы

  • CERTIFICATE_VERIFY_FAILED на macOS с Python из python.org: выполните /Applications/Python 3.x/Install Certificates.command или задайте SSL_CERT_FILE=/etc/ssl/cert.pem.

Разработка

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest -q && ruff check .

Планы

Компании, товары в сделках, звонки и чат-боты (imbot), события через исходящие вебхуки, OAuth-приложение для Маркетплейса Bitrix24. Предложения и PR приветствуются: см. CONTRIBUTING.md, задачи с меткой good first issue и Discussions.


Related MCP server: Bitrix24 MCP Server

English

MCP server for Bitrix24 CRM and tasks. Read-only by default; set BITRIX24_READ_ONLY=false to enable write tools (create leads, deals and tasks, move deal stages, add timeline comments).

Quick start (Claude Code):

claude mcp add bitrix24 \
  -e BITRIX24_WEBHOOK_URL="https://your-portal.bitrix24.com/rest/1/xxxxxxxx/" \
  -- uvx --from bitrix24-mcp-server bitrix24-mcp

Without uv: pip install bitrix24-mcp-server, then run bitrix24-mcp.

Create the webhook under Developer resources → Other → Inbound webhook with only the scopes you need (crm, task, user). The URL is a secret.

Docker / remote agents: docker compose up -d serves Streamable HTTP at /mcp and requires Authorization: Bearer <MCP_AUTH_TOKEN>. See the settings table above for all environment variables.

Safety: webhook tokens are masked in logs and errors, method names are validated, rate-limit errors are retried with backoff, the Docker image runs as a non-root user.

Troubleshooting

  • CERTIFICATE_VERIFY_FAILED on macOS with the python.org installer: run /Applications/Python 3.x/Install Certificates.command or set SSL_CERT_FILE=/etc/ssl/cert.pem.

Contributing: see CONTRIBUTING.md; questions and use cases go to Discussions.

License

MIT © Askhat Akhtanov

Available Tools

8 tools
get_contactB
Read-only

Get one contact; phones and emails are returned as plain lists.

Inputs: contact_id (required). Returns: object

get_dealC
Read-only

Get all fields of one deal.

Inputs: deal_id (required). Returns: object

list_dealsB
Read-only

List deals, newest first. Filters are optional and combined with AND.

Inputs: limit, stage_id, category_id, assigned_by_id, +1 more. Returns: result

list_deal_stagesB
Read-only

List deal stages of a pipeline (category 0 is the default pipeline).

Inputs: category_id. Returns: result

list_leadsA
Read-only

List leads, newest first, optionally by status (e.g. NEW, IN_PROCESS).

Inputs: limit, status_id. Returns: result

list_tasksB
Read-only

List tasks, newest first.

status: 2 pending, 3 in progress, 4 awaiting control, 5 completed, 6 deferred.

Inputs: limit, status, responsible_id. Returns: result

search_contactsA
Read-only

Find contacts by phone, email or name.

A query with '@' searches email, a query with 6+ digits searches phone, anything else searches first and last name.

Inputs: query (required), limit. Returns: result

whoamiA
Read-only

Return the Bitrix24 user the webhook acts as (ID, name, email).

Inputs: no named parameters. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool maps to a distinct resource/action: identity, deal stages, deals list/get, contact search/get, leads, and tasks. The only near-neighbor pair is list_deals/list_deal_stages, but their descriptions make the boundary clear.

    Naming Consistency4/5

    Seven of eight tools follow a predictable verb_noun snake_case pattern such as list_deals, get_deal, and search_contacts. whoami is an idiomatic exception, but otherwise singular/plural usage is consistent with the list-vs-get convention.

    Tool Count5/5

    Eight tools is well within the recommended 3-15 range and each covers a distinct operation. There are no redundant or filler tools for the apparent read-only Bitrix24 subset.

    Completeness2/5

    The surface is almost entirely read-only: there are no create, update, or delete operations for deals, contacts, leads, or tasks. It also lacks get_lead, get_task, and a general list_contacts, so agents cannot complete mutating CRM workflows or inspect individual leads/tasks.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to interact with Bitrix24 CRM through comprehensive tools for managing contacts, deals, leads, companies, tasks, and users, with advanced filtering, search capabilities, and sales team performance monitoring.
      50
      35
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables language models to interact with Bitrix24 CRM, providing tools to manage deals, leads, contacts, tasks, activities, users, files, chat messages, and live chat sessions.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to interact with Bitrix24 CRM through standardized MCP tools, including searching and managing contacts, deals, leads, tasks, and replying in chats.
      MIT