kontur-diadoc-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kontur-diadoc-mcp покажи входящие УПД за март"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-сервер для Контур.Диадок — электронный документооборот (ЭДО) через ИИ
Если вы искали, как подключить Диадок к нейросети, достать счета-фактуры и УПД из ЭДО не кликая по кабинету или подписать документ из чата — это оно. 12 инструментов: поиск контрагентов по ИНН, список и содержимое документов, отправка и подписание (счета-фактуры, акты, УПД, ТОРГ-12 и др.). Пишете «покажи входящие УПД за март» — получаете список, а не инструкцию, куда нажать.
MCP server for Kontur.Diadoc electronic document interchange (EDI). Search organizations and counterparties, list/fetch documents, send and sign them — straight from your AI assistant.
Инструменты / Tools
Tool | Назначение | Ключевые параметры |
| Проверить аутентификацию, вернуть превью токена | — |
| Поиск организаций по ИНН/КПП |
|
| Детали организации | один из: |
| Список документов в ящике с фильтрами и пагинацией |
|
| Конкретный документ |
|
| Отправить документ контрагенту |
|
| Подписать входящий документ |
|
| Список контрагентов |
|
Related MCP server: DottedSign MCP
Установка / Install
Claude Desktop / Cline / Cursor
{
"mcpServers": {
"kontur-diadoc": {
"command": "npx",
"args": ["-y", "@theyahia/kontur-diadoc-mcp"],
"env": {
"DIADOC_API_CLIENT_ID": "<YOUR_DEVELOPER_KEY>",
"DIADOC_LOGIN": "<YOUR_LOGIN>",
"DIADOC_PASSWORD": "<YOUR_PASSWORD>"
}
}
}
}Переменные окружения / Environment variables
Variable | Обяз. | Описание |
| да | Ключ разработчика ( |
| да | Логин учётной записи Diadoc |
| да | Пароль учётной записи Diadoc |
| нет | Альтернативный хост API (напр. песочница). По умолчанию |
⚠️ Изменение совместимости (v1.1.0): ключ разработчика теперь читается из
DIADOC_API_CLIENT_ID. Старое имяDIADOC_CLIENT_IDвсё ещё принимается как fallback. Прежняя переменнаяDIADOC_API_KEYбольше не требуется (раньше она читалась, но никуда не отправлялась).
Как получить доступ / Getting credentials
Зарегистрируйте приложение и получите ключ разработчика (
ddauth_api_client_id) на портале разработчика Контура.Используйте логин и пароль вашей учётной записи Diadoc.
Для экспериментов запросите доступ к тестовому контуру (песочнице) и укажите его хост в
DIADOC_BASE_URL.
Основные понятия / Key concepts
box_id — идентификатор «ящика» организации в Diadoc; адресат отправки и контекст большинства операций.
ИНН/КПП — проверяются на формат (ИНН 10 или 12 цифр, КПП 9 цифр) до обращения к API.
filter_category — обязательный фильтр в
list_documents, формат<DocumentType>.<DocumentClass><Status>, напр.Any.Inbound,Any.InboundNotFinished,XmlTorg12.OutboundWithRecipientSignature.Пагинация — курсорная: ответ содержит ключ, который передаётся в
after_index_keyследующего запроса (count0–100). Сдвиг поoffsetDiadoc не использует.Время —
timestamp_from/timestamp_toпринимаются как ISO-8601 и автоматически конвертируются в .NET-тики (timestampFromTicks/timestampToTicks), которых ждёт API.
Подписание документов / Signing — важно
Diadoc API не создаёт криптографическую подпись сам. Боевую подпись (КЭП, формат CAdES/PKCS#7) формирует клиент — например, через КриптоПро CSP — и передаёт её сюда в base64:
send_document— полеsignature_base64(можно опустить для неподписанных/неформализованных документов: тогда отправляется только содержимое).sign_document— полеsignature_base64; либоsign_with_test_signature: trueдля тестовой подписи в песочнице (в проде не работает).
Генерация самой подписи — вне зоны ответственности этого сервера. Он корректно формирует структуру запроса (
DocumentAttachments/SignedContentдля отправки,Signaturesдля подписания) и прокидывает вашу подпись в Diadoc.
Обработка ошибок / Error handling
Ошибки API (HTTP-статус и тело ответа Diadoc) возвращаются как результат инструмента с флагом
isError: true и понятным текстом, а не роняют сессию. Клиент сам делает:
повтор с экспоненциальной задержкой на 429/5xx, одну прозрачную ре-аутентификацию на 401,
таймаут 15 с на запрос.
Примеры запросов / Demo prompts
«Найди организацию по ИНН 7707083893 в Diadoc»
«Покажи входящие неподписанные документы за этот месяц»
«Открой документ по message_id … и entity_id …»
«Отправь неформализованный документ контрагенту box-456»
«Подпиши входящий акт тестовой подписью (песочница)»
«Список моих контрагентов со статусом IsMyCounteragent»
Разработка / Development
npm install
npm run dev # запуск из исходников (tsx)
npm run build # компиляция в dist/
npm test # vitest
npm run typecheck # tsc --noEmit
npm run lint # biome check .
npm run format # biome check --write . (автоформат + фиксы)Справочник API / API reference
Документация: developer.kontur.ru/doc/diadoc-api
Лицензия / License
MIT
Available Tools
8 toolsauthenticateB
Аутентификация в Kontur.Diadoc API (возвращает превью токена). / Authenticate with Diadoc.
Inputs: no named parameters.
get_documentC
Получить конкретный документ по box/message/entity ID. / Get a specific document.
Inputs: box_id (required), entity_id (required), message_id (required), inject_entity_content.
get_organizationC
Детали организации по orgId / boxId / ИНН. / Get organization details.
Inputs: inn, kpp, box_id, org_id.
list_counterpartiesC
Список контрагентов организации (myBoxId). / List counterparties for an organization.
Inputs: box_id (required), query, page_size, after_index_key, +1 more.
list_documentsC
Список документов в ящике с фильтрами и пагинацией. / List documents in a box.
Inputs: box_id (required), count, timestamp_to, sort_direction, +5 more.
list_organizationsC
Поиск организаций по ИНН/КПП в Diadoc. / Search organizations by INN/KPP.
Inputs: inn (required), kpp, include_relations.
send_documentB
Отправить документ контрагенту. Подпись (base64) формирует клиент; для песочницы шлите без подписи. / Send a document; the client supplies the signature.
Inputs: to_box_id (required), from_box_id (required), type_named_id (required), content_base64 (required), +3 more.
sign_documentB
Подписать входящий документ. Нужна готовая подпись (base64) или sign_with_test_signature в песочнице. / Sign a received document with a client-supplied signature.
Inputs: box_id (required), entity_id (required), message_id (required), signature_base64, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a fairly distinct resource+action (auth, org lookup, document listing/get, sign, send, counterparties). The main potential confusion is between list_organizations and list_counterparties, and between sign_document and send_document, but the descriptions clarify that counterparties are trading partners of a box and that signing is for received documents while send transmits to a counterparty.
The set follows a predictable snake_case verb_noun pattern: list_*, get_*, sign_document, send_document. The only deviation is the bare verb 'authenticate' with no noun, which is a minor inconsistency rather than a structural one.
Eight tools is a reasonable, well-scoped surface for a document-exchange API, and each tool maps to a real workflow step. It sits slightly on the thin side given the breadth of Diadoc (messages, events, document content retrieval are absent), but nothing is redundant.
Core flows (auth, org/counterparty lookup, list/get documents, sign, send) are covered, but notable operations are missing: retrieving a document's actual content/file (print/download), listing messages/events, and rejecting or deleting documents. These gaps will force agents to dead-end on common lifecycle tasks like inspecting document bodies or tracking new incoming documents.
Maintenance
Related MCP Connectors
Russian docs for AI agents: invoices/acts PDF, document parsing, INN checks, medical ad checks
Create documents and reusable templates, request signatures, and track approvals — for AI agents.
Send encrypted files and secrets, collect files and get documents signed, from your AI.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceConnects AI agents to ONLYOFFICE DocSpace, enabling them to manage rooms, collaborate on files, and handle permissions via natural language. It supports multiple transport protocols and authentication methods to facilitate document workflow automation.446 npm31MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage eSignature workflows, including creating signing tasks, tracking document status, and managing templates via natural language.142-

@docmake/mcpofficial
AlicenseAqualityDmaintenanceEnables AI assistants to generate DOCX and PDF documents from DocMake templates through natural language, including template listing, field inspection, document rendering, DOCX import, and usage tracking.646 npmMIT- AlicenseAqualityDmaintenanceEnables AI assistants to validate Russian business requisites (INN, OGRN, bank accounts) via checksums, extract them from text, and retrieve counterparty details by INN using DaData.5MIT