1C AI MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
1C AI MCP - MCP-сервер для 1С:Напарник
MCP-сервер (Model Context Protocol) для интеграции IDE с API 1С:Напарник. Построен на FastMCP (Python), упакован в Docker. Работает с Cursor, Claude Code и любыми MCP-совместимыми клиентами.
12 инструментов: анализ кода (проверка, ревью, рефакторинг) и поиск в документации (ИТС, платформа, конфигурации).
Основан на идее comol/1c-code-checker с исправлениями API-формата (ошибки 422), заимствованными из SteelMorgan/spring-mcp-1c-copilot.
Предварительные требования
Docker (или Docker Desktop)
Токен 1С:Напарник - получить на code.1c.ai (требуется подписка ИТС)
Related MCP server: 1c-buddy-mcp
Быстрый старт
Вариант A: Готовый образ из Docker Hub (рекомендуется)
docker run -d --name 1c-ai-mcp -p 8007:8007 \
-e ONEC_AI_TOKEN="ваш-токен" \
desko77/1c-ai-mcp:latestИли через Docker Compose - создайте файл docker-compose.yml:
services:
1c-ai-mcp:
image: desko77/1c-ai-mcp:latest
container_name: 1c-ai-mcp
ports:
- "8007:8007"
environment:
ONEC_AI_TOKEN: "${ONEC_AI_TOKEN}"
restart: always# Создать .env с токеном (не попадает в git)
echo 'ONEC_AI_TOKEN=ваш-токен' > .env
# Запустить
docker compose up -dВариант B: Сборка из исходников
git clone https://github.com/Desko77/1c-ai-mcp.git
cd 1c-ai-mcp
# Создать .env с токеном
echo 'ONEC_AI_TOKEN=ваш-токен' > .env
# Собрать и запустить
docker compose up -d --buildПроверка работоспособности
# Должен вернуть HTTP 200
curl http://localhost:8007/mcpПодключение к IDE
Cursor
Добавьте в ~/.cursor/mcp.json:
{
"mcpServers": {
"1c-naparnik": {
"url": "http://localhost:8007/mcp"
}
}
}Claude Code
Добавьте в ~/.claude/settings.json:
{
"mcpServers": {
"1c-naparnik": {
"url": "http://localhost:8007/mcp"
}
}
}Другие MCP-клиенты
Endpoint: http://localhost:8007/mcp
Транспорт: Streamable HTTP (по умолчанию) или SSE (USESSE=true).
Инструменты
Анализ кода
check_1c_code
Проверка кода 1С: синтаксис, логика, производительность. В direct mode синтаксис проверяется через upstream syntax-checker.
Параметр | Тип | Описание |
| string | Код 1С для проверки |
| string |
|
ask_1c_ai
Произвольный вопрос к 1С:Напарник. Сохраняет контекст диалога между вызовами.
Параметр | Тип | Описание |
| string | Вопрос |
| bool | Новая сессия (по умолчанию |
review_1c_code
Code review: стиль, стандарты ИТС, именование, структура, читаемость. Не проверяет синтаксис.
Параметр | Тип | Описание |
| string | Код 1С для ревью |
rewrite_1c_code
ИИ предлагает свою улучшенную версию кода с объяснением изменений.
Параметр | Тип | Описание |
| string | Код 1С для переписывания |
| string | Направление: |
modify_1c_code
Модификация кода по явной инструкции. Если код не указан - генерирует новый.
Параметр | Тип | Описание |
| string | Описание требуемых изменений |
| string | Исходный код (опционально) |
explain_1c_syntax
Объяснение конкретного элемента синтаксиса 1С.
Параметр | Тип | Описание |
| string | Элемент синтаксиса |
| string | Контекст использования (опционально) |
Документация и справка
its_help
Поиск по базе знаний ИТС (стандарты, методики, статьи). Возвращает ID документов для fetch_its.
Параметр | Тип | Описание |
| string | Поисковый запрос |
fetch_its
Чтение документа ИТС по идентификатору. Используется после its_help.
Параметр | Тип | Описание |
| string | ID документа ( |
search_1c_documentation
Поиск в документации платформы 1С:Предприятие для конкретной версии.
Параметр | Тип | Описание |
| string | Поисковый запрос |
| string | Версия (по умолчанию |
onec_help
Поиск в документации платформы (последняя версия). Как search_1c_documentation, но без указания версии.
Параметр | Тип | Описание |
| string | Поисковый запрос |
diff_1c_documentation_versions
Сравнение документации платформы между двумя версиями.
Параметр | Тип | Описание |
| string | Более ранняя версия (например, |
| string | Более поздняя версия (например, |
| string | Предметная область (опционально) |
config_help
Поиск документации по прикладным конфигурациям (ERP, Бухгалтерия, ЗУП, УТ и др.).
Параметр | Тип | Описание |
| string | Поисковый запрос |
| string | Название конфигурации (опционально, берется из |
Конфигурация
Все параметры передаются через переменные окружения.
Переменная | Обязательна | По умолчанию | Описание |
| Да* | - | Токен API 1С:Напарник |
| Нет | - | Путь к файлу с токеном (Docker Secrets) |
| Нет |
| Базовый URL API |
| Нет |
| Skill для дискуссий ( |
| Нет |
| Формат Authorization: |
| Нет |
| Таймаут HTTP-запросов (сек) |
| Нет | - | Конфигурация для config_help (например, |
| Нет |
| Режим: |
| Нет |
| Макс. длина входных данных (символов) |
| Нет |
| Порт MCP-сервера |
| Нет |
| Транспорт: |
| Нет |
| Лимит одновременных сессий |
| Нет |
| TTL сессии (сек) |
| Нет |
| Уровень логирования ( |
| Нет |
| Проверка обновлений FastMCP на PyPI при старте: |
* Обязателен ONEC_AI_TOKEN или ONEC_AI_TOKEN_FILE.
Транспорт: streamable-http или SSE
По умолчанию сервер работает в транспорте streamable-http: MCP-клиенты общаются с ним POST-запросами на /mcp. GET на /mcp в этом режиме не используется - сервер отвечает на него JSON-пояснением, а повторяющиеся строки "GET /mcp" 405 в логах контейнера означают, что кто-то опрашивает endpoint как SSE (браузер, healthcheck или клиент, настроенный на SSE-транспорт). Это не ошибка сервера.
Если ваш MCP-клиент умеет только SSE - запустите контейнер с USESSE=true и укажите в клиенте тот же адрес http://localhost:8007/mcp (сервер сам выберет SSE-обработчик).
Docker Secrets
Для production-окружений токен можно передать через файл:
services:
1c-ai-mcp:
image: desko77/1c-ai-mcp:latest
environment:
ONEC_AI_TOKEN_FILE: /run/secrets/onec_token
secrets:
- onec_token
secrets:
onec_token:
file: ./onec_token.txtDirect Mode
При MCP_TOOL_CALL_MODE=direct документационные инструменты и check_1c_code (syntax) вызывают upstream-инструменты 1С:Напарник напрямую по имени, вместо текстовых промптов. Это дает более точные результаты.
Upstream-инструменты:
mcp__knowledge-hub__Search_ITS- дляits_helpmcp__knowledge-hub__Fetch_ITS- дляfetch_itsmcp__knowledge-hub__Search_Documentation- дляsearch_1c_documentation,onec_helpmcp__knowledge-hub__Diff_Documentation_Versions- дляdiff_1c_documentation_versionsmcp__syntax-checker__validate- дляcheck_1c_code(syntax)
При сбое direct-вызова автоматический fallback на промпт-режим. По умолчанию standard для обратной совместимости.
Архитектура
MCP-клиент (Cursor / Claude Code)
-> FastMCP HTTP endpoint (:8007/mcp)
-> mcp_server.py (обработчики инструментов)
-> OneCApiClient (HTTP-клиент)
-> code.1c.ai API (SSE-стриминг)
-> парсинг ответа -> возврат клиентуДва режима работы
Standard mode (по умолчанию): инструменты формируют текстовые промпты и отправляют в API. Документационные инструменты используют tool chain - модель сама решает какой серверный инструмент вызвать.
Direct mode (
MCP_TOOL_CALL_MODE=direct): инструменты явно запрашивают конкретный upstream-инструмент по имени, матчат ответ и подтверждают вызов. При сбое - автоматический fallback на standard mode.
SSE-парсер
Поддерживает три формата ответа API:
Формат | Структура | Тип |
Legacy |
| Инкрементальный |
OpenAI-like |
| Инкрементальный |
Completed |
| Финальный |
Дополнительно:
Автоматическое удаление
<thinking>/<think>блоков из ответовUnicode-нормализация и очистка управляющих символов
Fallback при получении
tool_calls- повтор запроса сskill_name="raw"Обрезка входных данных по
ONEC_AI_INPUT_MAX_LENGTH
Разработка
Локальный запуск без Docker
pip install -r requirements.txt
export ONEC_AI_TOKEN="ваш-токен"
python main.pyСтруктура проекта
main.py # Точка входа
src/
mcp_server.py # MCP-инструменты (@mcp.tool)
onec_api_client.py # HTTP-клиент к API 1С:Напарник
Dockerfile # Dockerfile
docker-compose.yml # Compose для сборки из исходников
tests/ # Тестовые скрипты
.github/workflows/
docker-publish.yml # CI: сборка и публикация в Docker HubБлагодарности
comol/1c-code-checker - оригинальная идея (репозиторий закрыт)
SteelMorgan/spring-mcp-1c-copilot - правильные алгоритмы API
FastMCP - фреймворк MCP-серверов
Лицензия
MIT - см. LICENSE
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Anaplan MCP server for ChatGPT, Claude and any AI agent: list models, list actions, upload import file, run import, run process, run export, get model history and add user in your own Anaplan account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Anaplan yourself; Cotlet does not store your password and you need no Anaplan API key. About the official Anaplan API: Yes. Anaplan has an official REST API, the Integration API v2.0, and an official MCP server, the Anaplan AI Gateway, but Anaplan's help says the AI Gateway gives external AI systems read-only access (checked 5 Nov 2026). Setup and FAQ: https://cotlet.dev/integrations/anaplan-api-mcp-server
Grammarly MCP server for ChatGPT, Claude and any AI agent: list documents, read suggestions, accept or dismiss suggestion, check AI text and plagiarism, get writing score, set document goals, add dictionary word and delete and restore document in your own Grammarly account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Grammarly yourself; Cotlet does not store your password and you need no Grammarly API key. About the official Grammarly API: Grammarly has an official API only for organizations (checked 5 Nov 2026): Writing Score, AI Detection and Plagiarism Detection, plus Analytics and License Management, reached through Contact Sales and OAuth 2.0 credentials. None of them reads or edits your own documents, suggestions, goals or dictionary, and Grammarly has no official MCP server. Setup and FAQ: https://cotlet.dev/integrations/grammarly-api-mcp-server
Nextcloud MCP server for ChatGPT, Claude and any AI agent: upload file, share file, create calendar event, add contact, create Deck card and search files in your own Nextcloud account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Nextcloud yourself; Cotlet does not store your password and you need no Nextcloud API key. About the official Nextcloud API: Yes. Every Nextcloud instance has WebDAV for files, CalDAV for calendars, CardDAV for contacts, an OCS Share API and a Deck API, and they accept an app password (checked 16 Oct 2026). Setup and FAQ: https://cotlet.dev/integrations/nextcloud-api-mcp-server
JobDiva MCP server for ChatGPT, Claude and any AI agent: search candidates, find candidate, search jobs, add candidate note, add candidates to hotlist, create submittal and create candidate in your own JobDiva account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to JobDiva yourself; Cotlet does not store your password and you need no JobDiva API key. About the official JobDiva API: JobDiva has a REST API with public Swagger docs, 759 paths across two versions, but it only works with a client ID that JobDiva provides, and JobDiva has no official MCP server (checked 23 Oct 2026). The API has no webhooks, so changes have to be polled, and updates and deletes are POST calls. Setup and FAQ: https://cotlet.dev/integrations/jobdiva-api-mcp-server
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server providing tools for interacting with 1С:Напарник AI, including asking questions, syntax explanation, code review, and documentation search. Also serves as a web chat interface and OpenAI-compatible API gateway.111AGPL 3.0
- AlicenseBqualityCmaintenanceLightweight MCP server for 1C.ai integration, enabling queries, code analysis, and documentation search via natural language.82AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to lint, search documentation, and perform metadata scaffolding for 1C:Element projects.5,798 PyPI3MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates IDEs with the 1C:Напарник API, providing code analysis tools and documentation search for 1C.MIT