MCP Automation Hub
Overview
This Skill provides CLI and automation tools for managing your MCP (Model Context Protocol) server, n8n workflow integration, and service monitoring.
Quick Start
Health Check
Verify all MCP services are running:
curl http://localhost:3000/health
Expected response: {"status": "healthy"} with 200 status code.
Deploy to n8n
Sync local custom nodes to your n8n instance:
cd ~/mcp-automation-hub && pnpm deploy:n8n
View Logs
Check recent MCP server activity:
tail -n 50 /tmp/mcp-automation.out.log
For error logs:
tail -n 50 /tmp/mcp-automation.err.log
Service Management
Start MCP Server
launchctl load ~/Library/LaunchAgents/com.mcp.automation.plist
Stop MCP Server
launchctl unload ~/Library/LaunchAgents/com.mcp.automation.plist
Restart MCP Server
launchctl unload ~/Library/LaunchAgents/com.mcp.automation.plist launchctl load ~/Library/LaunchAgents/com.mcp.automation.plist
Check Service Status
launchctl list | grep com.mcp.automation
Configuration
Environment Setup
Configuration file: .env.example
Copy and customize:
cp .env.example .env
Key variables:
- •
MCP_PORT: Server port (default: 3000) - •
N8N_API_URL: n8n instance URL - •
N8N_API_KEY: n8n API authentication key
macOS Shortcuts Integration
For details on Apple Shortcuts automation, see Shortcuts.md.
Key shortcuts:
- •MCP Health Check - Quick service verification
- •Deploy to n8n - One-click deployment
- •MCP Logs - Instant log viewing
Scripts
Utility scripts are in the scripts/ directory:
- •
scripts/setup-mac.sh- Initial Mac environment setup - •Additional automation scripts as needed
Troubleshooting
Service Won't Start
- •
Check if port 3000 is available:
bashlsof -i :3000
- •
Verify plist file exists:
bashls -la ~/Library/LaunchAgents/com.mcp.automation.plist
- •
Check error logs:
bashcat /tmp/mcp-automation.err.log
n8n Deployment Fails
- •Verify n8n is running and accessible
- •Check N8N_API_KEY in
.env - •Ensure dependencies are installed:
bash
pnpm install
Health Check Returns Error
- •
Confirm server is running:
bashlaunchctl list | grep com.mcp.automation
- •
Test with verbose output:
bashcurl -v http://localhost:3000/health
- •
If server is down, restart it using the commands in Service Management section
Common Workflows
Deploy Changes to n8n
Copy this workflow and check off steps as you complete them:
Deployment Progress: - [ ] Step 1: Make changes to n8n nodes - [ ] Step 2: Test locally if possible - [ ] Step 3: Run deployment command - [ ] Step 4: Verify deployment in n8n UI - [ ] Step 5: Test workflows using deployed nodes
Step 1: Edit custom node files in your project
Step 2: If you have a local n8n instance, test there first
Step 3: Deploy using:
cd ~/mcp-automation-hub && pnpm deploy:n8n
Step 4: Open n8n and confirm nodes appear in the node palette
Step 5: Create or run a workflow that uses your custom nodes
Monitor Service Health
- •
Run health check:
bashcurl http://localhost:3000/health
- •
If status is not 200:
- •Check logs for errors
- •Restart service
- •Verify configuration
- •
Set up periodic monitoring (optional):
bash# Add to crontab for hourly checks 0 * * * * curl -s http://localhost:3000/health || osascript -e 'display notification "MCP Server is down!" with title "MCP Alert"'
Project Structure
mcp-automation-hub/ ├── SKILL.md # This file ├── Shortcuts.md # Apple Shortcuts guide ├── SETUP.md # Mac environment setup ├── README.md # Project overview ├── scripts/ # Utility scripts ├── mcp-config.json # MCP server config ├── package.json # Dependencies and scripts └── .env.example # Configuration template
Dependencies
Required packages (auto-installed via pnpm install):
- •Node.js (v18+)
- •pnpm (package manager)
- •n8n (workflow automation)
Optional:
- •curl (for API testing)
- •jq (for JSON parsing)
Best Practices
- •
Always check health before deployments
bashcurl http://localhost:3000/health && pnpm deploy:n8n
- •
Keep logs clean - Rotate logs periodically:
bash> /tmp/mcp-automation.out.log > /tmp/mcp-automation.err.log
- •
Use environment variables - Never hardcode credentials
- •
Test locally first - Verify changes before deploying to production n8n
- •
Monitor regularly - Set up automated health checks or use the Shortcuts
Additional Resources
For advanced MCP configuration, see the official MCP documentation.
For n8n custom node development, refer to n8n's developer documentation.