My AI-Powered Workflow: Integration of MCP, Docker and N8N for Obsidian
Objective
Automate the organization and processing of Obsidian notes using AI accessible via API, orchestrated with Docker, MCP (Modular Copilot Platform), and N8N workflows.
Why This Workflow?
The Problem
Manual Note Management Challenges: - Notes scattered across multiple topics - Inconsistent language (French/English mix) - No automated categorization - Time-consuming manual organization - Difficult to find related content
The Solution
AI-Powered Automation: - Automatic note organization by theme - Language detection and translation - Intelligent content grouping - Automated index generation - Scheduled processing workflows
Prerequisites
Software Requirements
Essential Tools: - Docker installed and running - MCP (Modular Copilot Platform) deployed - N8N installed (via Docker or standalone) - Obsidian vault accessible locally
Optional Tools: - LLM model (Mistral, Llama, etc.) - Ollama for local model hosting - Git for version control
Architecture Overview
Obsidian Vault (Markdown Files)
↓
N8N Workflow (File Reader)
↓
MCP API (AI Processing)
├── Organize by theme
├── Translate content
├── Generate summaries
└── Create indexes
↓
N8N Workflow (File Writer)
↓
Obsidian Vault (Organized Files)
Step 1: Deploy MCP with Docker
Quick Start
# Pull and run MCP container
docker run -d \
--name mcp \
-p 5000:5000 \
-v $(pwd)/mcp_data:/app/data \
ghcr.io/modularcopilot/mcp:latest
# Verify MCP is running
curl http://localhost:5000/health
# Expected response:
# {"status": "healthy", "version": "1.0.0"}Docker Compose (Recommended)
# docker-compose.yml
version: '3.8'
services:
mcp:
image: ghcr.io/modularcopilot/mcp:latest
container_name: mcp-server
restart: unless-stopped
ports:
- "5000:5000"
volumes:
- ./mcp_data:/app/data
- ./models:/app/models
environment:
- MCP_MODEL=mistral:7b
- MCP_API_PORT=5000
- OLLAMA_HOST=http://host.docker.internal:11434
networks:
- homelab
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
networks:
- homelab
networks:
homelab:
driver: bridge
volumes:
ollama_data:# Deploy services
docker-compose up -d
# Check logs
docker-compose logs -f mcp
# Pull model in Ollama
docker exec ollama ollama pull mistral:7bVerify MCP API
# Test API endpoint
curl -X POST http://localhost:5000/api/prompt \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize this text: Proxmox is a virtualization platform.",
"model": "mistral:7b"
}'Step 2: Prepare AI Prompts
Example Prompt Templates
Organize Notes by Language:
{
"prompt": "Unify all my Obsidian notes into English. Translate French titles, group similar content, and create a thematic index."
}Categorize Notes:
{
"prompt": "Analyze these Obsidian notes and categorize them into: Infrastructure, Security, Automation, and Reference. Return structured JSON."
}Generate Summary:
{
"prompt": "Create a concise summary (max 100 words) of this technical article while preserving key commands and configurations."
}Extract Tags:
{
"prompt": "Extract relevant tags from this note. Return comma-separated tags suitable for Obsidian YAML frontmatter."
}Step 3: Create N8N Workflow
Workflow Components
Complete Workflow Structure:
1. Schedule Trigger (Daily at 2 AM)
↓
2. Read Obsidian Files
↓
3. Filter (Only .md files)
↓
4. Extract YAML Frontmatter
↓
5. HTTP Request to MCP
↓
6. Process AI Response
↓
7. Update/Create Organized Files
↓
8. Send Notification (Telegram/Email)
Workflow Configuration
Node 1: Schedule Trigger
{
"node": "Schedule Trigger",
"type": "n8n-nodes-base.cron",
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 2 * * *"
}
]
}
}
}Node 2: Read Files
{
"node": "Read Files",
"type": "n8n-nodes-base.readBinaryFiles",
"parameters": {
"filePath": "/path/to/obsidian/vault",
"filePattern": "*.md"
}
}Node 3: HTTP Request to MCP
{
"node": "MCP API Call",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "http://localhost:5000/api/prompt",
"authentication": "none",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "prompt",
"value": "Organize my notes Obsidian by theme and language."
},
{
"name": "notes",
"value": "={{ $json[\"content\"] }}"
}
]
}
}
}Node 4: Write File
{
"node": "Save Organized Notes",
"type": "n8n-nodes-base.writeFile",
"parameters": {
"fileName": "/vault/Index/organization.md",
"data": "={{ $json[\"response\"] }}"
}
}Step 4: HTTP Request Configuration
Detailed Request Setup
Method: POST
URL:
http://localhost:5000/api/prompt
Headers:
{
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_MCP_API_KEY"
}Body:
{
"prompt": "Organize mes notes Obsidian par thème et langue.",
"notes": "{{ $json[\"content\"] }}",
"options": {
"temperature": 0.7,
"max_tokens": 2048,
"output_format": "markdown"
}
}Response Processing
Expected Response:
{
"status": "success",
"organized_content": "# Infrastructure\n\n## Proxmox\n- Note 1\n- Note 2\n\n# Security\n...",
"metadata": {
"notes_processed": 45,
"categories_created": 6,
"languages_detected": ["en", "fr"]
}
}Step 5: Save Results to Obsidian
File Organization Strategy
Directory Structure:
Vault/
├── Index/
│ ├── organization.md (auto-generated)
│ ├── by-theme.md
│ └── by-language.md
├── Infrastructure/
│ ├── EN/
│ └── FR/
├── Security/
│ ├── EN/
│ └── FR/
└── Automation/
├── EN/
└── FR/
Index File Template
# 📚 Automated Organization Index
*Generated: {{date}}*
## By Theme
[[Infrastructure]] | [[Security]] | [[Automation]] | [[Reference]]
## By Language
🇬🇧 [[English Notes]] | 🇫🇷 [[French Notes]]
## Statistics
- Total notes: {{total_count}}
- Categories: {{category_count}}
- Last updated: {{timestamp}}
---
*Automated by MCP + N8N workflow*Tips and Best Practices
Use Language Tags
In Obsidian Notes:
---
tags: [homelab, #en]
language: en
---
# My Infrastructure Note
Content here...Create Multilingual Index
Index Structure:
# 🌍 Multilingual Index
## Infrastructure
- 🇬🇧 [[Proxmox Setup EN]]
- 🇫🇷 [[Installation Proxmox FR]]
## Security
- 🇬🇧 [[pfSense Configuration EN]]
- 🇫🇷 [[Configuration pfSense FR]]Enhance Prompts
Advanced Prompt Examples:
{
"prompt": "Organize notes by theme and language. For each note:\n1. Detect language\n2. Assign category\n3. Generate 3-5 tags\n4. Create 1-sentence summary\n5. Link related notes\nReturn structured markdown."
}Advanced Workflow Features
Conditional Processing
Process Only Modified Files:
// In N8N Function node
const lastRun = $node["Get Last Run"].json.timestamp;
const fileModified = new Date($json.modified);
if (fileModified > lastRun) {
return $json; // Process this file
}
return null; // Skip this fileError Handling
Retry Logic:
{
"node": "Error Handler",
"onError": "continueErrorOutput",
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 1000
}Notification
Telegram Notification:
{
"node": "Send Summary",
"type": "n8n-nodes-base.telegram",
"parameters": {
"chatId": "YOUR_CHAT_ID",
"text": "✅ Notes organized!\n\nProcessed: {{notes_count}}\nCategories: {{categories}}\nTime: {{duration}}s"
}
}Resources
Documentation
Example Workflows
GitHub Repository:
git clone https://github.com/username/obsidian-ai-workflows
cd obsidian-ai-workflows/n8nImport into N8N:
Settings → Import from File
→ Select workflow.json
→ Activate workflow
Troubleshooting
MCP Connection Issues
# Check MCP is running
docker ps | grep mcp
# View logs
docker logs -f mcp-server
# Test API
curl http://localhost:5000/healthN8N Can’t Reach MCP
# If MCP is in Docker, use docker network
docker network inspect homelab
# Or use host network mode
docker run --network host mcpFile Permission Errors
# Fix Obsidian vault permissions
chmod -R 755 /path/to/vault
# For Docker volume access
chown -R 1000:1000 /path/to/vaultConclusion
This AI-powered workflow transforms Obsidian note management from manual drudgery to automated intelligence. By combining MCP’s AI capabilities with N8N’s workflow orchestration, you create a self-organizing knowledge base that continuously improves.
Key Benefits: - Automated note organization - Multilingual content management - Intelligent categorization - Time savings (hours → minutes) - Consistent structure
Next Steps: - Fine-tune prompts for your note style - Add custom categories - Integrate with other tools (Notion, Evernote) - Create visualization dashboards
Automate your knowledge, amplify your productivity.