v8unpack-mcp
v8unpack-mcp
MCP-Server (stdio) für den vollständigen Arbeitszyklus mit 1C-Binärdateien
(.cf / .cfe / .epf / .erf) ohne Import in ein EDT-Projekt:
unpack → чтение/правка → repack → cleanupDer einzige Entpackungspunkt ist unpack. Alle anderen Werkzeuge akzeptieren
dir_path — ein Verzeichnis, das von unpack erstellt wurde, und führen keine implizite
Entpackung durch.
Funktionen
Werkzeug | Signatur | Was es tut |
|
| vollständige Entpackung in ein separates temporäres Verzeichnis (ohne Größenlimit), gibt den Pfad zurück |
|
| Liste der Objekte im Container |
|
| Metadaten: Typ, Zähler nach Typen, Objekt (uuid, Synonym, Formulare, Layouts, Module) |
|
| Quellcode des BSL-Moduls des Objekts (geschützt markiert als |
|
| Analyse des Byte-Codes eines geschlossenen Moduls (Methoden, Konstanten, Opcodes) |
|
| Suche nach Teilstring/Regex in Code, Formularen, Layouts (Ebenen |
|
| Hilfe des Objekts in die raw-Ebene schreiben (Zusammenbau macht |
|
| Vergleich zweier entpackter Verzeichnisse objektweise + Diff |
|
| Zusammenbau der Datei aus dem entpackten Verzeichnis |
|
| Verzeichnis von unpack löschen (oder alle nach Präfix) |
Suche nach Binärdateien .cf/.cfe/.epf/.erf auf der Festplatte — mit den Standard-Datei-
werkzeugen des Clients (glob/list).
Arbeitszyklus
unpack(file_path)→{status, dir, file, kind}. Das Verzeichnisdirenthält:organisierten Baum (
Typ/Name+.json/.obj.bsl/ Formulare / Layouts) — Lesen und Bearbeiten von Code, Formularen, Layouts, Attributen;raw-Ebene
.v8unpack_raw/(Brace-Dateien:text/image/help) — fürread_bytecode/set_help.
Lesen —
list_objects/get_metadata/read_module/read_bytecode/search_code; Bearbeiten — per Dateien indir(oderset_help).repack(dir_path, output_path)→{status, output, bytes}.cleanup(dir_path)(odercleanup(all=true)).
Fehler (keine Datei/kein Verzeichnis, falscher Typ) — als Ausnahmen. Das Verzeichnis wird
nach repack nicht automatisch gelöscht — es kann für mehrere Zusammenbauten wiederverwendet werden.
Schema von repack
repack baut über v8unpack.build(use_raw=True) zusammen:
organisierter Baum nicht bearbeitet → raw-Ebene wird byteweise wiederhergestellt (Hilfen, Byte-Code, verschlüsselte Module bleiben erhalten);
organisierter Baum bearbeitet → Neuzusammenbau aus dem organisierten Baum.
Einschränkung (Alles-oder-nichts): In einer Sitzung entweder Bearbeitungen der organisierten Ebene (Code/Formulare) oder der raw-Ebene (Hilfe/Byte-Code) — nicht beides gleichzeitig. Objektweise Zusammenführung — separate Aufgabe.
Was in search_code gesucht wird
.bsl— Quellcode der Module;.json— Objektköpfe, Attribute und Elementbaum der Formulare;.txt/.html— Text- und HTML-Layouts;.bin(SKD) — Datenkompositionsschema: binäres Präfix + XML mit Abfragetext.
Der Parameter layers begrenzt die Suchbereiche: modules (.bsl), forms (.json),
templates_text (.txt), templates_html (.html), dcc (.bin-SKD). Leer = alle.
Jede Übereinstimmung enthält ein Feld layer.
Nicht gesucht wird (binär): .mxl (Tabellendokument), Bilder, Rollen (.c1brace),
verschlüsselte Module. Der MXL-Parser — separate Research-Aufgabe (siehe .ai/).
Vergleich (diff)
diff(dir_a, dir_b, full=true) vergleicht zwei entpackte Verzeichnisse objektweise:
listet die Objektverzeichnisse auf (
Typ/Namefür cf/cfe, Wurzel für epf/erf);sammelt die Dateien jedes Objekts (ohne Dienstdatei
.id.json);Status:
changed/added/removed/unchanged;für geänderte wird ein
unified differstellt, begrenzt durch Limits (MAX_DIFF_LINES=400, MAX_DIFF_FILES=20);full=false— nur die Tatsache der Änderung, ohne Diff-Erstellung.
Related MCP server: 1C MCP Server
Architektur
Entpackungskern — saby v8unpack (Python, MIT). Vendored in
src/v8unpack/mit lokalen Patches (keep_raw/use_raw,detect_formatfür 8.3.24+, Toleranz gegenüber unbekannten Metadatengruppen).Eigener Wrapper —
src/v8unpack_mcp:core.py(Logik),textlayers.py(Extraktion von Textebenen),server.py(MCP-Server).Entpackung — in ein separates temporäres Verzeichnis
%TEMP%\v8unpack_unpack_*bei jedem Aufruf vonunpack; kein gemeinsamer Cache (der Agent verwaltet den Lebenszyklus selbst übercleanup).Für MCP deaktivieren wir Multiprocessing von v8unpack (serieller Pool) und unterdrücken stdout/stderr, um das stdio-Protokoll nicht zu stören;
OrganizerFile.pack/unpacküberspringen.v8unpack_raw.
v8unpack-mcp/
├── src/
│ ├── v8unpack/ # вендоренное ядро saby v8unpack (MIT) + патчи
│ └── v8unpack_mcp/
│ ├── __init__.py
│ ├── __main__.py # python -m v8unpack_mcp
│ ├── core.py # инструменты: unpack/чтение/правка/repack/cleanup
│ ├── textlayers.py # извлечение текстовых слоёв (поиск)
│ ├── bytecode.py # чтение байт-кода закрытых модулей (из raw-слоя)
│ ├── decompiler.py # декомпилятор байт-кода → BSL
│ ├── diffing.py # сравнение распакованных каталогов
│ └── server.py # MCP-сервер (stdio)
├── tests/
│ ├── test_core.py
│ └── test_server_e2e.py
└── pyproject.tomlInstallation und Start
# MCP-сервер (вендоренное ядро v8unpack входит в пакет)
pip install -e .
# запуск (stdio)
python -m v8unpack_mcp
# или консольная команда
v8unpack-mcpVerbindung zum Client (MCP)
Der Server arbeitet über stdio: Jeder Client startet ihn selbst als separaten Prozess
über einen einzigen Befehl. Alle Werkzeuge akzeptieren absolute Pfade zu Dateien, daher
ist das Arbeitsverzeichnis des Prozesses nicht wichtig. Temporäre Entpackungsverzeichnisse werden im
System-%TEMP% mit dem Präfix v8unpack_unpack_ erstellt.
Der empfohlene Startbefehl ist das Konsolenskript v8unpack-mcp (wird bei
pip install erstellt) oder python -m v8unpack_mcp. Für GUI-Clients, die Ihr
PATH nicht erben, ist es zuverlässiger, den absoluten Pfad zum Interpreter anzugeben.
Standardformat von MCP (command + args)
Claude Desktop, Claude Code, Cline, Continue, Roo, VS Code (.mcp.json) und andere
verwenden ein gemeinsames Format mit den Feldern command und args:
{
"mcpServers": {
"v8unpack": {
"command": "v8unpack-mcp",
"args": []
}
}
}Oder mit explizitem Interpreter:
{
"mcpServers": {
"v8unpack": {
"command": "~/путь/к/python.exe",
"args": ["-m", "v8unpack_mcp"]
}
}
}Wo platzieren:
Claude Desktop —
claude_desktop_config.json(Einstellungen → Entwickler → Edit Config);Claude Code —
~/.claude.jsonoder Projekt-.mcp.json;Cline / Continue / Roo — Projekt-
.mcp.json(wird zwischen Teilnehmern geteilt) oder Benutzereinstellungen;VS Code —
.vscode/mcp.json(für den Projekt-Server) oder Benutzereinstellungen.
Kilo Code / Kilo CLI (kilo.json, Befehl — Array)
Das Kilo-Format unterscheidet sich: Server werden in kilo.json unter dem Schlüssel "mcp" angegeben, und der Befehl
wird als ein einziges Array übergeben (ohne Trennung in command+args). Die Datei — Projekt-
./kilo.json / .kilo/kilo.json oder global ~/.config/kilo/kilo.json.
// kilo.json (проект)
{
"mcp": {
"v8unpack": {
"type": "local",
"command": ["v8unpack-mcp"],
"enabled": true,
"timeout": 15000
}
}
}Oder über python -m:
{
"mcp": {
"v8unpack": {
"type": "local",
"command": ["python", "-m", "v8unpack_mcp"],
"enabled": true
}
}
}Der Server wird in der TUI mit dem Befehl /mcps ein-/ausgeschaltet. Ein geerbter Server kann
deaktiviert werden: { "v8unpack": { "enabled": false } }.
Rechte auf die Server-Werkzeuge — über Schlüssel v8unpack_* (glob, die letzte Übereinstimmung
von oben nach unten gewinnt):
{
"permission": {
"v8unpack_*": "allow"
}
}Empfehlungen für mehrere Clients
Installation: einmal
pip install -e .(für Entwicklung) oderpip install dist/v8unpack_mcp-0.2.0-py3-none-any.whl(aus dem gebauten Wheel); die Abhängigkeitv8unpackwird automatisch auspyproject.tomlnachgezogen.Einheitlicher Interpreter: Verwenden Sie den Konsolenbefehl
v8unpack-mcp(gelangt in denPATHder Installation) oder denselben absoluten Pfad zupython.exein allen Konfigurationen — dann übernimmt jeder Client dieselbe Installation.Clients sind unabhängig: Jeder Client hält seinen eigenen stdio-Prozess; gemeinsamer Zustand — nur die temporären unpack-Verzeichnisse auf der Festplatte. Sie können denselben Server bedenkenlos gleichzeitig mit mehreren Clients verbinden.
Pfade mit Leerzeichen/Kyrillisch: In JSON-Konfigurationen Pfade in Anführungszeichen setzen; im Array
command(Kilo) werden Elemente automatisch maskiert.Stiller Start: Der Server unterdrückt den Entpackungsfortschritt und arbeitet nur über stdio — interaktive Ausgabe muss nicht zu den Konfigurationen hinzugefügt werden.
Zusammenbau
pip install build wheel # инструменты сборки
python -m build # создаст dist/v8unpack_mcp-<ver>-py3-none-any.whl и .tar.gz
pip install dist/v8unpack_mcp-0.2.0-py3-none-any.whl # установка из колесаTests
python tests/test_core.py # юнит-смоук ядра
python tests/test_server_e2e.py # end-to-end через stdioDie Tests verwenden Dateien aus ../testdata (persönliche Dateien, gehören nicht zu git — legen Sie Ihre eigenen hinein).
Einschränkungen
Große
.cf(Hunderte MB — GB):unpackmacht eine vollständige Extraktion in ein separates Verzeichnis. Objektweiser Index (Lesen eines Objekts ohne vollständige Extraktion) — nächster Schritt.Tabellenlayouts (
.mxl) werden vorerst nicht durchsucht — binäres Format, Parser in TODO.Geschützte (verschlüsselte) Module: Quellcode ohne Passwort nicht wiederherstellbar, aber
read_bytecodeanalysiert den kompilierten Byte-Code, unddecompiler.pykann ihn in BSL dekompilieren (Werkzeugdecompile— geplant).Bearbeitungen der organisierten Ebene und der raw-Ebene (Hilfe/Byte-Code) werden in einer Sitzung nicht zusammengeführt (Alles-oder-nichts
use_raw).
Übernommene Komponenten
Das Projekt verwendet offene Entwicklungen der Community wieder:
Komponente | Lizenz | Zweck | Link |
saby v8unpack | MIT (Copyright 2015 infactum) | Kern zum Entpacken/Zusammenbauen von 1C-Containern — vendored in | |
EvilBeaver/v8asm | MIT | Stack-Format und Opcode-Tabelle des 1C-Byte-Codes | |
1C-inversion | ohne explizite Lizenz (lehrreich, Fork von v8asm) | Algorithmus zur Dekompilierung von Byte-Code → BSL |
saby v8unpack ist als src/v8unpack/ im Paket enthalten (MIT-Lizenz in
src/v8unpack/LICENSE erhalten). decompiler.py — Port des 1C-inversion-Algorithmus; bytecode.py
verwendet das Format aus v8asm.
⚠️ Rechtlicher Hinweis. Siehe DISCLAIMER.md und LICENSE:
Das Projekt wird unter der MIT-Lizenz „wie besehen", ohne Garantien, verbreitet — Nutzung auf eigenes Risiko.
Die Lizenz von „1C:Enterprise 8" verbietet, Code/Daten des Produkts mit nicht standardmäßigen Mitteln zu ändern sowie den Softwareteil des Systems zu dekompilieren. Diese Einschränkung schützt die Plattform und die Standard-Konfigurationen von 1C; auf eigene Konfigurationen, Erweiterungen und externe Verarbeitungen/Berichte erstreckt sie sich nicht — arbeiten Sie nur mit Ihren eigenen Objekten.
Die Dekompilierung geschlossener (passwortgeschützter) Module ist zu Forschungszwecken implementiert und darf nicht zum Knacken oder Entfernen des Schutzes fremder Konfigurationen verwendet werden (Art. 146 StGB der RF). Verwenden Sie sie nur zur Wiederherstellung eigener Module.
Nützliche Links
saby v8unpack: https://github.com/saby-integration/v8unpack
EvilBeaver/v8asm: https://github.com/EvilBeaver/v8asm
1C-inversion: https://github.com/ProhorP/1C-inversion
MXL8-Format (Spezifikation): https://github.com/azubar/SpreadSheet/blob/main/docs/format-mxl.md
Available Tools
20 toolscleanupA
Удалить временный каталог unpack. dir_path — один каталог; all=true — удалить все каталоги unpack (по префиксу в temp)
Inputs: all, dir_path. Returns: result
diffA
Сравнить два распакованных каталога (результат unpack) пообъектно. По содержимому (построчный diff): .mxl (декодируется структурно), .json, .obj.bsl, XML форм. По байтам (только факт изменения, помечается binary=true): зашифрованные .obj.bin, СКД .bin, картинки. full=false — только факт изменения без диффа
Inputs: dir_a (required), dir_b (required), full. Returns: result
export_dcsA
Выгрузить СКД макета целиком в XML (штатный формат платформы: ). output_path — куда записать файл; не задан — XML возвращается в поле 'xml'. Только чтение
Inputs: dir_path (required), object_path, output_path, template_name. Returns: result
get_helpA
Прочитать справочную информацию (help) объекта из raw-слоя каталога unpack. object_path пуст для внешней обработки/отчёта, 'Тип/Имя' для конфигурации/расширения. mode='check' — только факт наличия справки; mode='get' — ещё и текст (HTML) + языки
Inputs: dir_path (required), mode, object_path. Returns: result
get_metadataA
Метаданные распакованного каталога. Без object_path — сводка (вид, счётчики по типам). С object_path='Тип/Имя' — метаданные объекта (имя, синоним, uuid, формы, макеты, модули). detail=true — полный список по типам
Inputs: dir_path (required), detail, object_path. Returns: result
get_module_structureB
Структура BSL-модуля: объявления переменных (Перем), процедуры и функции (имя, вид, Экспорт, директивы, докстринг, параметры, start/end строки) и секция основной программы (код после процедур). object_path — путь к объекту, module_name — подстрока имени файла модуля
Inputs: dir_path (required), module_name, object_path. Returns: result
import_dcsB
Загрузить СКД макета целиком из XML (штатный формат платформы). Источник: template_path (файл) или xml_text (строка). Пишет в raw-слой; сборку выполняет repack
Inputs: dir_path (required), xml_text, object_path, template_name, +1 more. Returns: result
import_templateA
Импортировать готовый .mxl (табличный документ) в макет объекта — замена содержимого существующего макета (template_name или единственный). Пишет в raw-слой; сборку делает repack
Inputs: dir_path (required), object_path, template_name, template_path. Returns: result
job_statusA
Статус фонового задания (unpack_async/repack_async): status=running|done|error, progress (число обработанных объектов), result (при status=done — как у unpack/repack), error (при status=error). Опрашивайте повторно, пока status!='done'
Inputs: job_id (required). Returns: result
list_objectsA
Список объектов внутри распакованного контейнера: {вид_объекта: [имена]} (только имена; полные метаданные — get_metadata)
Inputs: dir_path (required). Returns: result
read_bytecodeB
Разобрать байт-код закрытого модуля (методы, константы, поток опкодов) из raw-слоя каталога unpack
Inputs: dir_path (required), object_path. Returns: result
read_dcsA
Прочитать схему компоновки данных (СКД) макета. Уровень 1 (без data_set/variant) — обзор: data_sets (имя/тип), parameters, variants (имя/представление). data_set='Имя' — текст запроса и список полей набора. variant='Имя' — сырой XML настроек варианта (как хранится в .bin). Только чтение
Inputs: dir_path (required), variant, data_set, object_path, +1 more. Returns: result
read_moduleA
Прочитать BSL-модуль объекта из распакованного каталога. object_path — путь к объекту ('' для корня epf/erf, 'CommonModule/Имя' для cf/cfe); module_name — подстрока имени файла модуля (пусто = список модулей объекта); ranges — список диапазонов строк вида 'start-end' (или 'N'), 1-based, суммарно не более 400 строк на пакет (пусто = весь модуль)
Inputs: dir_path (required), ranges, module_name, object_path. Returns: result
read_templateA
Прочитать табличный документ (MXL) макета в структурированном виде. Декодирует MOXCEL в дерево: возвращает канонический текст structure и список текстовых значений strings. Только чтение
Inputs: dir_path (required), object_path, template_name. Returns: result
repackA
Собрать файл 1С из распакованного каталога (результат unpack) в целевой файл
Inputs: dir_path (required), output_path (required). Returns: result
repack_asyncA
АСИНХРОННАЯ сборка файла 1С из распакованного каталога. Запускает работу в фоновом задании и СРАЗУ возвращает {job_id, status:'running'}. Результат получите через job_status (status='done', поле result)
Inputs: dir_path (required), output_path (required). Returns: result
search_codeA
Поиск подстроки/regex по текстовым слоям распакованного каталога. layers: modules, forms, templates_text, templates_html, dcc (пусто = все). scope (для СКД, слой dcc): 'query' (по умолчанию, только тексты запросов) или 'all' (весь XML СКД). Каждое совпадение содержит поле layer
Inputs: pattern (required), dir_path (required), regex, scope, +3 more. Returns: result
set_helpA
Записать справочную информацию (help) объекта в raw-слой каталога unpack (сборку делает repack). object_path пуст для внешней обработки/отчёта, 'Тип/Имя' для конфигурации/расширения. overwrite=false — существующую справку не перезаписывать
Inputs: dir_path (required), help_html, overwrite, object_path. Returns: result
unpackA
Полная распаковка файла 1С (.cf/.cfe/.epf/.erf) в отдельный временный каталог (без лимита размера, любые объекты). Первый шаг любого цикла. Возвращает путь к каталогу (организованное дерево + raw-слой .v8unpack_raw)
Inputs: file_path (required). Returns: result
unpack_asyncA
АСИНХРОННАЯ распаковка крупного файла 1С. Запускает работу в фоновом задании и СРАЗУ возвращает {job_id, status:'running'} — не ждёт завершения, поэтому не срывается таймаутом клиента. Опрашивайте статус через job_status, пока status!='done'; в result будет тот же результат, что у unpack
Inputs: file_path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool targets a clearly distinct operation: unpack/repack lifecycle with async wrappers and job_status, object enumeration vs metadata, module source vs structure vs bytecode, help/template/DCS read/write variants, search, diff, and cleanup. Even read_dcs and export_dcs are differentiated by granularity (structured exploration vs full platform XML export). No two tools appear to perform the same job.
Most tools follow a verb_noun snake_case pattern (list_objects, get_metadata, read_module, import_template, export_dcs), and async variants consistently use the <verb>_async suffix. Minor deviations include bare verbs like unpack, repack, diff, cleanup, the noun-style job_status, and an arbitrary read/get split among extraction tools. Overall the naming is still predictable and readable.
At 20 tools, the server is on the upper boundary for tool count, but the 1C unpack/repack domain is complex enough to justify dedicated tools for async operations, module analysis, bytecode, help, templates, DCS, diff, and cleanup. A few closely related tools (read_dcs/export_dcs) could potentially be merged, but none feel like filler.
The toolset covers the full lifecycle: unpack (sync/async), inspection (list, metadata, modules, bytecode, search), modification (help, template, DCS imports into raw layer), repack (sync/async), diff, and cleanup. Minor gaps exist—no direct tool for writing arbitrary module code or forms—but editing the unpacked directory externally and repacking is a viable workaround.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Document conversion MCP server: PDF to Markdown, image OCR, spreadsheet parsing.
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.112AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceActs as a bridge between AI agents (Claude, Cursor) and 1C:Enterprise databases, enabling metadata retrieval, configuration analysis, and code generation through natural language using the MCP protocol.-
- FlicenseNot gradedqualityBmaintenanceMCP server for searching and analyzing 1C enterprise metadata and BSL code using a SQLite backend. Enables querying configuration structure, code routines, and performing compliance checks via natural language.-
- AlicenseBqualityCmaintenanceLightweight MCP server for 1C.ai integration, enabling queries, code analysis, and documentation search via natural language.82AGPL 3.0