bpmn-generator-mcp
This MCP server generates, validates, and reconstructs BPMN 2.0 diagrams from multiple sources, with a rich BPMN knowledge base, templates, OCR/vision capabilities, and file management tools.
Generate BPMN processes from simple linear flows, decisions, parallel branches, YAML/JSON specs, natural language text, and images via OCR.
Reconstruct BPMN from images using a Python vision pipeline (PaddleOCR, YOLO, OpenCV) and preview/validate the intermediate representation.
Access BPMN 2.0 knowledge: element lists, cheat sheets, activity/marker/attribute/flow/artifact/swimlane catalogs, best practices, validation rules, and Bizagi-specific details.
Use predefined templates to quickly create processes for common scenarios like approvals, orders, and onboarding.
Create advanced subprocess constructs: embedded subprocesses, call activities, boundary events, error handling, transactions, loops, and multi-instance activities.
Create event-driven processes with timer events, message/signal/error triggers, and event definitions.
Validate BPMN files or XML strings against BPMN 2.0 rules.
Manage generated files: get the output directory, list generated BPMN files, and read them with sandboxed path protection.
Check OCR availability and extract text from images as an OCR utility.
Get guided prompts for designing, reviewing, converting descriptions to BPMN, and applying best practices.
Generates BPMN 2.0 process files that can be imported directly into Camunda Modeler for process modeling and automation.
Click on "Install 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., "@bpmn-generator-mcpCreate a BPMN 2.0 model for a loan approval process"
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.
BPMN Generator MCP
MCP (Model Context Protocol) server que genera y reconstruye diagramas BPMN 2.0 desde múltiples fuentes: texto, templates, YAML/JSON, imágenes (OCR) y diagramas escaneados (visión por computadora). El output se importa directamente en Bizagi Modeler, Camunda Modeler, bpmn.io y cualquier herramienta compatible con el estándar OMG BPMN 2.0.
Stack dual: TypeScript (capa MCP) + Python (visión por computadora). Dockerizado en una sola imagen.
✨ Características
🎨 44 herramientas MCP registradas
6 de generación:
create_simple_linear_process,create_process_with_decision,create_process_with_parallel,create_from_yaml_spec,create_process_from_text_description,create_process_from_image(OCR)3 de visión (NUEVO):
reconstruct_bpmn_from_image(PaddleOCR + YOLO + OpenCV),preview_bpmn_ir,validate_bpmn_ir8 de conocimiento BPMN:
list_bpmn_elements,get_bpmn_cheatsheet,get_event_matrix,explain_bpmn_concept, etc.6 de plantillas: 9 plantillas predefinidas (aprobación, pedidos, onboarding, etc.)
6 de subprocesos avanzados: subproceso, call activity, boundary events, error handling, transactions, loops/multi-instance
2 de eventos: timer, message, signal, error, escalation, etc.
2 de validación:
validate_bpmn_file,validate_bpmn_xml2 de OCR:
is_ocr_available,extract_text_from_image3 de files:
get_output_directory,list_generated_files,read_bpmn_file2 de subprocess:
add_event_with_trigger,create_process_with_timer4 prompts predefinidos:
design_bpmn_process,review_bpmn_process,convert_description_to_bpmn,bpmn_best_practices
🧠 Knowledge Base BPMN 2.0 exhaustivo
41 tipos de eventos (start/intermediate/end/boundary × todos los triggers)
13 actividades (tasks + subprocesos: embedded, call, ad-hoc, event, transaction)
5 gateways (exclusive, parallel, inclusive, event-based, complex)
30+ atributos del estándar
5 marcadores (loops, multi-instance, compensation)
30+ reglas de validación
9 plantillas de procesos comunes
4 categorías de paleta Bizagi
Especificidades de Bizagi Modeler
🛡️ Seguridad Hardened
Path traversal sandbox (path.resolve + relative_to)
XXE prevention (
fast-xml-parserconprocessEntities: false)Resource limits anti-DoS (MAX_TASKS, MAX_XML_SIZE, MAX_IMAGE_SIZE_BYTES)
Unicode normalization NFC + filtrado zero-width/bidi
Exception sanitization (no exponer paths internos)
Race condition locks (Mutex en BPMNGenerator)
Non-root Docker user (uid 1001)
Pinned dependency versions (
package.jsoncon==exactos)
🏗️ Calidad de código
TypeScript strict mode +
noUncheckedIndexedAccessPython con type hints en todas las funciones
< 700 LOC por archivo (regla dura)
Tests reproducibles: 8/8 archivos BPMN válidos en suite completa
Pydantic + Zod schemas sincronizados (23 tipos BPMN) entre Python y TS
Related MCP server: MCP-BPMN Server
📦 Stack Técnico
Capa | Tecnología |
MCP Server | TypeScript + |
Validación |
|
XML BPMN |
|
Logging |
|
OCR TS |
|
OCR Py |
|
Detección símbolos |
|
Geometría |
|
Grafo |
|
Imagen Docker |
|
🏗️ Arquitectura
bpmn-generator-mcp/
├── src/ # TypeScript MCP server (4978 LOC, 47 archivos)
│ ├── server.ts # Entry point (stdio MCP)
│ ├── constants.ts # BPMN namespaces, security limits
│ ├── schemas/ # Zod schemas para MCP inputs
│ ├── utils/ # logger, errors, sandbox
│ ├── bpmn/ # Generador BPMN (core, builders, elements, DI)
│ ├── knowledge/ # Catálogo BPMN 2.0
│ ├── mcp-tools/ # 44 tools + 4 prompts
│ └── vision/ # Cliente HTTP al vision pipeline Python
├── vision-pipeline/ # Python vision (2245 LOC, 17 archivos)
│ ├── src/vision_pipeline/
│ │ ├── ocr/ # PaddleOCR wrapper
│ │ ├── detection/ # YOLO 17 clases BPMN
│ │ ├── geometry/ # OpenCV preprocessing + arrows
│ │ ├── graph/ # NetworkX + KDTree mapping
│ │ ├── ir/ # Pydantic BPMNIR (23 tipos)
│ │ └── bridge/ # CLI subprocess + FastAPI server
│ ├── tools/ # ⭐ scrape, generate, train
│ ├── requirements.txt # Deps pinned
│ ├── data/ # scraped + yolo_dataset (gitignored)
│ └── PLAN.md # Plan completo
├── migration/ # Trazabilidad Python→TS (47 microtareas)
├── .agents/ # ⭐ Reglas persistentes (claude.md, rules.md, agents.md)
├── tests/ # test-all.ts + test-final.ts
├── examples/ # ejemplo-basico.ts
├── Dockerfile # ⭐ UN SOLO multi-stage (Node + Python)
├── docker-compose.yml
├── package.json # ESM, deps pinned
├── tsconfig.json # strict + noUncheckedIndexedAccess
├── tsconfig.build.json # Solo src/ para producción
├── .dockerignore
└── .gitignore🚀 Instalación y Uso
Opción 1: Docker (Recomendado para producción)
# Build de la imagen unificada (~5 min, descarga PaddleOCR + YOLO)
docker build -t bpmn-generator-mcp:latest .
# Ejecutar el servidor MCP via stdio
docker run -i --rm \
-v "C:\Users\LENOVO\.agents\mcps\bpmn-generator-mcp\output:/app/output" \
-v "C:\Users\LENOVO\.Pictures:/mnt/pictures:ro" \
bpmn-generator-mcp:latest
# O usar docker-compose
docker compose up -dLa imagen Docker incluye:
✅ Node.js 22 + TypeScript compilado (4978 LOC)
✅ Python 3.11 + venv con PaddleOCR + YOLO + OpenCV
✅ Tesseract OCR (spa + eng)
✅ Usuario no-root
bpmn(uid 1001, SEC-011)✅ Comunicación Node ↔ Python vía subprocess CLI
Opción 2: Desarrollo TS local (sin Docker)
# Solo para editar/compilar el TypeScript MCP server
npm install
npm run build # tsc -> dist/
npm test # tsx tests/test-all.ts && tsx tests/test-final.ts
# Ejecutar el MCP server
npm start # node dist/server.jsOpción 3: Desarrollo Python del vision pipeline (en venv)
# ⚠️ NUNCA uses `pip install -e .` global
# Usa siempre un entorno virtual LOCAL
cd vision-pipeline
python -m venv .venv # Crea .venv/ (gitignored)
.venv\Scripts\activate.bat # Windows
# source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt🔧 Configuración MCP en opencode
El archivo ~/.config/opencode/opencode.jsonc debe apuntar al container Docker:
"bpmn-generator": {
"type": "local",
"enabled": true,
"timeout": 60000,
"command": [
"docker", "run", "-i", "--rm",
"-v", "C:\\Users\\LENOVO\\.agents\\mcps\\bpmn-generator-mcp\\output:/app/output",
"-v", "C:\\Users\\LENOVO\\Pictures:/mnt/pictures:ro",
"bpmn-generator-mcp:latest"
],
"environment": {
"BPMN_OUTPUT_DIR": "/app/output",
"LOG_LEVEL": "info"
}
}Hay una entrada legacy bpmn-generator-python (deshabilitada) por si se necesita rollback.
🤖 Entrenamiento del modelo YOLO (visión)
Pipeline completo (3 pasos)
cd vision-pipeline
.venv\Scripts\activate.bat
# Paso 1: Scraping de imágenes reales (Wikimedia + DuckDuckGo + GitHub)
python tools/scrape_bpmn_images.py \
--query "bpmn diagram example" \
--output data/scraped \
--max 200
# Paso 2: Generación de imágenes sintéticas (Graphviz + PIL fallback)
python tools/generate_synthetic_dataset.py \
--output data/yolo_dataset \
--num 1000
# Paso 3: Anotar las imágenes scrapeadas con LabelImg o Roboflow
# (manual, formato YOLO: class_id x_center y_center width height)
# Paso 4: Entrenar YOLO con transfer learning desde COCO
python tools/train_yolo.py \
--data data/yolo_dataset \
--model yolo11n.pt \
--epochs 100Salida del training: weights/bpmn_best.pt (modelo entrenado con tus datos).
17 Clases BPMN soportadas (sincronizadas entre Python y TS):
ID | Clase | Tipo |
0 | startEvent | Evento |
1 | endEvent | Evento |
2 | intermediateEvent | Evento |
3 | task | Tarea |
4 | userTask | Tarea |
5 | serviceTask | Tarea |
6 | manualTask | Tarea |
7 | scriptTask | Tarea |
8 | exclusiveGateway | Gateway |
9 | parallelGateway | Gateway |
10 | inclusiveGateway | Gateway |
11 | subProcess | Sub-proceso |
12 | callActivity | Sub-proceso |
13 | pool | Swimlane |
14 | lane | Swimlane |
15 | sequenceFlow | Conector |
16 | messageFlow | Conector |
Limitación: solo 13/17 clases son sintetizables con bbox rectangular. pool, lane, sequence_flow, message_flow requieren datos scrapeados anotados manualmente.
Tiempos estimados
CPU (i7-12700): 5-15 min/epoch × 100 = ~8-25 horas total
GPU (RTX 3060+): 1-2 min/epoch × 100 = ~2-4 horas total
🧪 Testing
# TypeScript build (producción)
npx tsc -p tsconfig.build.json --noEmit # exit 0
# Suite completa TS (8 tests, genera 8 archivos BPMN válidos)
npx tsx tests/test-all.ts
# Verificar tools MCP registradas
npx tsx tests/test-final.ts
# Python parse check (sin instalar deps)
python -c "import ast; ast.parse(open('vision-pipeline/tools/scrape_bpmn_images.py').read())"Resultados esperados:
tsc -p tsconfig.build.json: exit 0test-all.ts: 8 archivos.bpmngenerados, 8/8 válidostest-final.ts: 44 tools + 4 prompts listadas
🐛 Debug
Ver logs del MCP server
docker logs bpmn-generator-mcpLogs estructurados (niveles)
LOG_LEVEL=debug→ máxima verbosidadLOG_LEVEL=info(default)LOG_LEVEL=warn→ solo warnings
Vision pipeline debug
# Probar CLI directamente
echo '{"image_path": "test.jpg"}' | docker exec -i bpmn-generator-mcp \
python -m vision_pipeline.bridge.cli📜 Reglas de Contribución
Ver .agents/claude.md (reglas de memoria), .agents/rules.md (reglas duras) y .agents/agents.md (configuración de subagentes).
Reglas Hard (NO ROMPER)
NO archivos >700 LOC
NO commitear
node_modules/,dist/,*.traineddata,.venv/Trazabilidad en microtareas para features >500 LOC
Backup antes de cambios grandes →
~/.config/opencode/backups/TS strict mode obligatorio
NO
pip install -e .global — usar venv localTODOS los
add_*métodos del BPMNGenerator DEBEN registrar enelementsLayoutPost-processing en
toXmlString— fast-xml-parser bug con booleanDockerfile multi-stage con non-root
YOLO_CLASSES sincronizado Python ↔ TypeScript
Bugs Históricos (NO reintroducir)
createProcessretornaba→ usarundefinedthis._definitions['bpmn:definitions']['bpmn:process']XML<bpmn:process>duplicado→ no mirror top-levelCircular import rompía registro→ usarregister.tsseparadofast-xml-parser serializa'true'como self-closing→ post-processing regexisExecutableboolean inválido en BPMN 2.0 strict→ eliminado
📊 Estadísticas del Proyecto
Métrica | Valor |
Total LOC TS | 4,978 (47 archivos en |
Total LOC Python | 2,245 (17 archivos en |
MCP Tools | 44 |
MCP Prompts | 4 |
BPMN Templates | 9 |
Knowledge entries | 100+ |
Microtareas migración | 47 (completadas) |
Microtareas vision pipeline | 18/35 (Fases 1-7 completas) |
Tests | 8/8 BPMN válidos + 63/63 Python checks |
🤝 Licencia y Créditos
Proyecto educativo de TECSUP - Integración de Sistemas Empresariales (Week 2).
Tecnologías usadas:
@modelcontextprotocol/sdk (Apache 2.0)
PaddleOCR (Apache 2.0)
Ultralytics YOLO (AGPL-3.0)
OpenCV (Apache 2.0)
NetworkX (BSD-3-Clause)
fast-xml-parser (MIT)
🔗 Links
Repositorio: https://github.com/johnleyva28/bpmn-generator-mcp
Bizagi Modeler: https://www.bizagi.com/es/platform/modeler
BPMN 2.0 Spec: https://www.omg.org/spec/BPMN/2.0/
MCP Protocol: https://modelcontextprotocol.io/
🎯 Próximos Pasos
Entrenar YOLO cuando tengas GPU + dataset (100 scraped + 1000 sintético)
Anotar imágenes scrapeadas con LabelImg/Roboflow (manual, ~30-60 min para 100 imágenes)
Re-entrenar con dataset completo
Build & deploy:
docker build -t bpmn-generator-mcp:vision . docker push your-registry/bpmn-generator-mcp:visionMonitorear el uso de las tools MCP en producción
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to programmatically create, modify, and export BPMN 2.0 workflow diagrams. It supports managing various process elements and sequence flows while providing export capabilities to standard XML and SVG formats.711MIT
- FlicenseBqualityDmaintenanceEnables AI agents to create, manipulate, and manage BPMN 2.0 diagrams programmatically, with support for Mermaid conversion, auto-layout, and file persistence.249
- FlicenseNot gradedqualityFmaintenanceEnables AI-driven graphical diagram creation and manipulation using natural language, with support for BPMN workflows, analysis, and manual editing via the Model Context Protocol.1
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants to interact with Camunda Platform workflow engine. Provides 21 specialized tools for complete workflow automation and process management.215MIT
Related MCP Connectors
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Automate tasks, processes, and approvals with AI.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/johnleyva28/bpmn-generator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server