
Enterprise Template Generator
Enables generation of enterprise-grade software templates with built-in GDPR/Swedish compliance validation, workflow automation for platform migrations, and comprehensive template management through domain-driven design principles.
README
Enterprise Template Generator MCP Server
A comprehensive MCP (Model Context Protocol) server for enterprise software template generation, built with clean domain-driven design principles and focused on workflow automation for digitalization processes.
🚀 Features
Core Capabilities
- Domain-Driven Design: Clean architecture with entities, value objects, and application services
- Jinja2 Template Engine: Powerful template rendering with custom enterprise filters
- FastMCP Integration: Modern MCP server with comprehensive tool set
- Enterprise Validation: Swedish/EU compliance support (GDPR, Swedish Data Protection Act)
- Workflow Automation: Specialized templates for platform/process migration
Template Categories
- Workflow Automation: Platform migration, process digitalization
- MCP Generator: Templates for creating new MCP servers
- Data Science: Data analysis and ML workflow templates
- Finance Analytics: Economic and financial analysis applications
- Engineering ML: ML engineering and technical development
- Infrastructure: Infrastructure as Code templates
- Security: Security implementation templates
- Compliance: Regulatory compliance templates
Enterprise Requirements Support
- GDPR Compliance: Data minimization, right to erasure, privacy by design
- Swedish Regulations: Data Protection Act, banking secrecy laws
- Security: Zero Trust architecture, encryption, access control
- Performance: <100ms response times, horizontal scaling
- Resilience: Offline mode, automatic failover, 99.95% uptime SLA
🏗️ Architecture
mcp-enterprise-templates/
├── src/
│ ├── server.py # FastMCP server implementation
│ ├── domain/ # Domain-driven design core
│ │ ├── entities/ # Template, Workflow entities
│ │ ├── value_objects/ # TemplateVariable, ValidationRule, etc.
│ │ └── services/ # Domain services
│ ├── application/ # Application services
│ │ └── template_service.py # Template management
│ ├── infrastructure/ # External integrations
│ └── templates/ # Jinja2 templates
├── tests/ # TDD test suite
└── docs/ # Documentation
🛠️ Installation
-
Clone and Setup
git clone <repository> cd mcp-template python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Run Tests
pytest tests/ -v
-
Test the Server
python test_server.py
⚙️ Configuration
Local Development
-
Run the MCP Server Directly
# Activate virtual environment source venv/bin/activate # Run the server python -m src.server
-
Environment Variables
export MCP_PORT=8000 # Server port (default: 8000) export MCP_HOST=localhost # Server host (default: localhost) export LOG_LEVEL=INFO # Logging level (DEBUG, INFO, WARNING, ERROR) export TEMPLATE_DIR=/custom/path # Custom template directory (optional)
MCP Configuration for Cline
Add this server to your Cline MCP settings (~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"enterprise-templates": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/home/chris/src/mcp-template",
"env": {
"PYTHONPATH": "/home/chris/src/mcp-template"
}
}
}
}
Or use a wrapper script:
{
"mcpServers": {
"enterprise-templates": {
"command": "/home/chris/src/mcp-template/run_server.sh"
}
}
}
Docker Configuration
-
Create Dockerfile (if not exists):
FROM python:3.11-alpine WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY src/ ./src/ COPY templates/ ./templates/ ENV PYTHONPATH=/app ENV MCP_PORT=8000 EXPOSE 8000 CMD ["python", "-m", "src.server"]
-
Build and Run:
# Build image docker build -t mcp-enterprise-templates . # Run container docker run -d \ --name enterprise-templates \ -p 8000:8000 \ -e LOG_LEVEL=INFO \ mcp-enterprise-templates
Docker Compose Setup
Create docker-compose.yml
:
version: '3.8'
services:
mcp-server:
build: .
container_name: enterprise-templates
ports:
- "8000:8000"
environment:
- MCP_PORT=8000
- LOG_LEVEL=INFO
- PYTHONPATH=/app
volumes:
- ./templates:/app/templates
- ./data:/app/data
restart: unless-stopped
# Optional: Couchbase for persistence
couchbase:
image: couchbase:latest
ports:
- "8091-8094:8091-8094"
- "11210:11210"
environment:
- COUCHBASE_ADMINISTRATOR_USERNAME=admin
- COUCHBASE_ADMINISTRATOR_PASSWORD=password
Run with:
docker-compose up -d
Systemd Service (Production Linux)
Create /etc/systemd/system/mcp-enterprise-templates.service
:
[Unit]
Description=Enterprise Template Generator MCP Server
After=network.target
[Service]
Type=simple
User=mcp
Group=mcp
WorkingDirectory=/opt/mcp-template
Environment="PATH=/opt/mcp-template/venv/bin"
Environment="PYTHONPATH=/opt/mcp-template"
Environment="MCP_PORT=8000"
Environment="LOG_LEVEL=INFO"
ExecStart=/opt/mcp-template/venv/bin/python -m src.server
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable mcp-enterprise-templates
sudo systemctl start mcp-enterprise-templates
sudo systemctl status mcp-enterprise-templates
Kubernetes Deployment
Create k8s-deployment.yaml
:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mcp-enterprise-templates
spec:
replicas: 3
selector:
matchLabels:
app: mcp-enterprise-templates
template:
metadata:
labels:
app: mcp-enterprise-templates
spec:
containers:
- name: mcp-server
image: mcp-enterprise-templates:latest
ports:
- containerPort: 8000
env:
- name: MCP_PORT
value: "8000"
- name: LOG_LEVEL
value: "INFO"
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: mcp-enterprise-templates
spec:
selector:
app: mcp-enterprise-templates
ports:
- protocol: TCP
port: 80
targetPort: 8000
type: LoadBalancer
Deploy:
kubectl apply -f k8s-deployment.yaml
🚀 Quick Start Guide
-
Install and Configure
# Clone repository git clone <repository> cd mcp-template # Setup Python environment python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Add to Cline MCP Settings
- Open VS Code
- Access Cline settings
- Add the configuration JSON shown above
- Restart Cline to load the MCP server
-
Verify Installation
# Test locally python test_server.py # Check if MCP tools are available in Cline # You should see tools like: # - create_template # - render_template # - list_templates
-
Create Your First Workflow
- Use the
create_template
tool to define a new process - Provide process name, goal, trigger, and steps
- Use
render_template
to generate documentation
- Use the
🔧 Troubleshooting
Common Issues
-
Server not starting
- Check Python version (3.8+ required)
- Verify all dependencies:
pip install -r requirements.txt
- Check port availability:
lsof -i :8000
-
MCP tools not appearing in Cline
- Verify JSON configuration syntax
- Check file paths are absolute
- Restart VS Code/Cline
- Check Cline logs for errors
-
Template rendering errors
- Ensure all required variables are provided
- Check template syntax (Jinja2)
- Verify variable types match template expectations
-
Docker issues
- Ensure Docker daemon is running
- Check port mappings
- Verify volume mounts for templates
Debug Mode
Enable debug logging:
export LOG_LEVEL=DEBUG
python -m src.server
Check logs for detailed error messages and stack traces.
🔧 MCP Tools
The server provides the following MCP tools:
Template Management
create_template
- Create new enterprise templatesget_template
- Retrieve template detailslist_templates
- List templates with filteringupdate_template
- Update existing templatesdelete_template
- Remove templatesclone_template
- Clone existing templates
Template Operations
render_template
- Generate code from templatesvalidate_template_variables
- Validate template inputssearch_templates
- Search templates by content
System Information
get_template_stats
- System statisticsget_supported_variable_types
- Available variable typesget_supported_validation_rules
- Available validation rulesget_template_categories
- Supported categories
📝 Usage Example
Creating a Workflow Template
# Create a platform migration template
template = await create_template({
"name": "Database Migration Workflow",
"description": "Comprehensive database migration with validation",
"category": "workflow_automation",
"template_content": "# Migration: {{ project_name }}...",
"variables": [
{
"name": "project_name",
"type": "string",
"required": True
}
],
"validation_rules": [
{
"name": "gdpr_compliance",
"rule_type": "compliance",
"compliance_type": "gdpr"
}
]
})
Rendering Templates
# Render template with variables
result = await render_template({
"template_id": "template-uuid",
"variables": {
"project_name": "Customer Migration",
"source_db": "MySQL",
"target_db": "PostgreSQL"
}
})
🏢 Enterprise Features
Compliance & Security
- GDPR: Data processing agreements, lawful basis validation
- Swedish Data Act: Data residency requirements
- ISO 27001: Security controls and access management
- Zero Trust: Continuous verification, least privilege
Performance & Reliability
- High Performance: <100ms response times
- Scalability: Horizontal scaling support
- Resilience: Offline mode, automatic failover
- Monitoring: Comprehensive logging and metrics
Swedish Enterprise Integration
- Language Support: Swedish and English
- Payment Systems: Swish, Bankgirot integration
- Identity Providers: BankID, Freja eID support
- Government APIs: Integration with Swedish public services
🧪 Testing
The project follows Test-Driven Development (TDD):
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src --cov-report=html
# Run specific test
pytest tests/test_template_service.py::TestTemplateService::test_create_template -v
🚀 Deployment
Docker Deployment
# Build secure container
docker build -f docker/Dockerfile -t mcp-enterprise-templates .
# Run with environment variables
docker run -e MCP_PORT=8000 -p 8000:8000 mcp-enterprise-templates
Kubernetes Deployment
# Deploy to Kubernetes
kubectl apply -f infrastructure/kubernetes/
📊 Hackathon Requirements
✅ Offline Mode & Failover: Automatic failover with data center shutdown support
✅ FastMCP: Modern MCP server implementation
✅ Jinja2 Templates: Reusable enterprise templates
✅ Python: Clean, well-structured Python codebase
✅ TDD: Comprehensive test suite
✅ Virtual Environment: Proper dependency management
✅ Enterprise Ready: Swedish/EU compliance, security, performance
🤝 Contributing
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Implement the feature
- Ensure all tests pass
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🏆 Hackathon Demo
This MCP server demonstrates:
- Enterprise-grade architecture with domain-driven design
- Workflow automation for digitalization processes
- Swedish/EU compliance built-in
- Resilience features including offline mode and failover
- Template generation for faster enterprise software development
Perfect for enterprise developers who need to generate better software faster while maintaining compliance and security standards.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.