Skip to main content

bitrix24-mcp

CI License: MIT Python 3.10+ MCP SDK 2

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 git+https://github.com/Rip-07/bitrix24-mcp bitrix24-mcp

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

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

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.


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 git+https://github.com/Rip-07/bitrix24-mcp 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

Metadata

Release files for bitrix24-mcp-server 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitrix24-mcp-server 0.1.0
File Size Uploaded Provenance Actions
bitrix24_mcp_server-0.1.0.tar.gz 20.1 kB With provenance Details for bitrix24_mcp_server-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bitrix24-mcp-server 0.1.0
File Interpreter ABI Platform Actions
bitrix24_mcp_server-0.1.0-py3-none-any.whl Python 3 none any Details for bitrix24_mcp_server-0.1.0-py3-none-any.whl

Total release size: 34.9 kB

Release files / bitrix24_mcp_server-0.1.0.tar.gz

Download URL bitrix24_mcp_server-0.1.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6b9b9c07701ca9c42a2970ce25348bf936109af6aa0d96d51c5024243b06b49b
BLAKE2b-256 checksum
How to use checksums
677fefccee3f081c45c20762bc38ba4b24ec0a3ee31a5a5579b5bfe5f894307c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / bitrix24_mcp_server-0.1.0-py3-none-any.whl

Download URL bitrix24_mcp_server-0.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dba37dcf0f2545bb80026d0b7a163624f1fb6f4d1dec842211795bf425f5d61a
BLAKE2b-256 checksum
How to use checksums
c94b84d4d6877d7b39912a6e7c1472f5b1577514bc893430a030201c05570414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for bitrix24-mcp-server 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bitrix24_mcp_server-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page