npm package: @mcp-forge/lodgify-mcp
Description: Commercial MCP server for Lodgify with multi-tenant SaaS architecture, AI integration, and comprehensive admin dashboard
Author: XencoLabs
Latest version: 4.1.1

# Lodgify MCP Server v4.0 - Commercial SaaS Edition

Production-grade Model Context Protocol (MCP) server for Lodgify vacation rental management with **multi-tenant SaaS architecture, AI integration, and comprehensive admin dashboard**.

## 🎯 Why This Server?

- ✅ **CORRECT API ENDPOINTS** - Uses v2 API correctly (others use wrong paths)
- ✅ **PROVEN WITH REAL DATA** - Tested with 21+ bookings and real availability
- ✅ **AI POWERED** - OpenAI & Anthropic integration for content and analysis
- ✅ **PRODUCTION READY** - Used in live vacation rental websites
- ✅ **COMMERCIAL SaaS** - Multi-tenant architecture with billing system
- ✅ **55 MCP TOOLS** - Comprehensive toolset for all operations

## 🚀 Features

### Phase 1: Core Foundation ✅
- **Full Property Management**: List and manage all properties
- **Complete Booking Access**: Real bookings with filtering
- **Real Availability Data**: Live calendar with actual bookings
- **Dynamic Pricing**: Quote generation with room types
- **Health Monitoring**: Docker health checks at port 8094
- **TypeScript**: Full type safety with modern tooling

### Phase 2: AI Integration ✅
**Content Generation (OpenAI)**
- SEO-optimized property descriptions
- Personalized guest messages (pre-arrival, check-in, during-stay, post-checkout)
- Social media posts for Facebook, Instagram, Twitter
- Complete content suites for properties

**Intelligent Analysis (Anthropic)**
- Booking pattern analysis with insights
- Dynamic pricing strategy recommendations
- Guest review sentiment analysis
- Property listing optimization
- Market intelligence and competitive analysis

### Phase 3: Advanced Features ✅
- **Cache Management**: In-memory caching with TTL and pattern invalidation
- **Webhook System**: Event notifications with retry logic and HMAC signatures
- **Batch Operations**: Concurrent processing for bulk updates
- **Analytics Engine**: Business intelligence and revenue tracking

### Phase 4: Commercial Package ✅
- **Multi-Tenant Architecture**: 4 subscription tiers (Trial, Basic, Professional, Enterprise)
- **Billing System**: Usage metering, invoicing, payment processing
- **Admin Dashboard**: System monitoring, tenant management, alerts
- **Audit Logging**: Complete activity tracking and compliance

## 💰 Subscription Plans

| Plan | Price | Properties | API Calls | AI Requests |
|------|-------|------------|-----------|-------------|
| **Trial** | Free | 2 | 1,000/mo | 50/mo |
| **Basic** | $10/mo | 5 | 10,000/mo | 500/mo |
| **Professional** | $50/mo | 20 | 100,000/mo | 5,000/mo |
| **Enterprise** | $200/mo | Unlimited | Unlimited | Unlimited |

## 🚀 Quick Start

### Prerequisites

- Node.js 18+ and npm
- Lodgify API key (get from your Lodgify account)
- (Optional) OpenAI API key for content generation
- (Optional) Anthropic API key for analysis features

### Installation

1. **Clone and install:**
   ```bash
   git clone https://github.com/xenflashbox/lodgify-mcp.git
   cd lodgify-mcp
   npm install
   ```

2. **Configure environment:**
   ```bash
   cp .env.example .env
   # Edit .env and add your API keys:
   # LODGIFY_API_KEY=your_key_here
   # OPENAI_API_KEY=your_key_here (optional)
   # ANTHROPIC_API_KEY=your_key_here (optional)
   ```

3. **Build and start:**
   ```bash
   npm run build
   npm start
   ```

### Claude Code Integration

Add to your Claude Code MCP settings:

```json
{
  "mcpServers": {
    "lodgify": {
      "command": "node",
      "args": ["/path/to/lodgify-mcp/dist/index.js"],
      "env": {
        "LODGIFY_API_KEY": "your_key",
        "OPENAI_API_KEY": "your_key",
        "ANTHROPIC_API_KEY": "your_key"
      }
    }
  }
}
```

## 🛠️ Available Tools

### Core Tools (Phase 1)
| Tool | Description | Parameters |
|------|-------------|------------|
| `list_properties` | List all properties | `includeInactive` |
| `get_property` | Get property details | `propertyId` |
| `list_bookings` | List bookings | `propertyId`, `status`, `from`, `to` |
| `get_booking` | Get booking details | `bookingId` |
| `check_availability` | Check property availability | `propertyId`, `start`, `end` |
| `get_quote` | Get pricing quote | `propertyId`, `arrival`, `departure`, `adults`, `children` |

### AI Content Tools (Phase 2)
| Tool | Description | Parameters |
|------|-------------|------------|
| `generate_property_description` | Generate SEO-optimized description | `propertyId`, `style`, `length`, `tone`, `seoKeywords` |
| `generate_guest_message` | Create personalized guest messages | `bookingId`, `messageType`, `customInstructions` |
| `generate_social_post` | Create social media content | `propertyId`, `platform`, `includeAvailability`, `includePricing` |
| `generate_property_suite` | Generate complete content package | `propertyId`, `includeDescription`, `includeSocialPosts`, `includeGuestTemplates` |

### AI Analysis Tools (Phase 2)
| Tool | Description | Parameters |
|------|-------------|------------|
| `analyze_booking_patterns` | Analyze booking trends | `propertyId`, `depth`, `focus`, `dateRange` |
| `suggest_pricing_strategy` | Get pricing recommendations | `propertyId`, `targetOccupancy`, `competitorPrices` |
| `analyze_reviews` | Analyze guest feedback | `propertyId`, `reviews`, `generateResponses` |
| `optimize_listing` | Optimize property listing | `propertyId`, `competitors`, `targetMarket` |
| `get_market_intelligence` | Market analysis | `location`, `propertyType`, `priceRange` |

## 📊 Resources

| Resource | Description |
|----------|-------------|
| `lodgify://properties` | All properties data |
| `lodgify://bookings/upcoming` | Upcoming bookings |
| `lodgify://availability/summary` | Availability overview |

## 🌐 Health & Monitoring

```bash
# Health check
curl http://localhost:8094/health

# Detailed status
curl http://localhost:8094/status

# Service info
curl http://localhost:8094/info
```

## 🐳 Docker Deployment

```bash
# Build image
docker build -t lodgify-mcp:2.0.0 .

# Run with docker-compose
docker-compose up -d

# Or deploy to swarm
docker stack deploy -c docker-compose.yml lodgify-mcp
```

## 🧪 Development

```bash
# Development mode with hot reload
npm run dev

# Run tests
npm test

# Type checking
npm run typecheck

# Linting
npm run lint

# Build for production
npm run build
```

## 📦 NPM Package

```bash
# Install from npm (coming soon)
npm install @blogcraft/lodgify-mcp-server

# Or use with npx
npx @blogcraft/lodgify-mcp-server
```

## 🔧 Configuration

### Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `LODGIFY_API_KEY` | Lodgify API key | Yes |
| `OPENAI_API_KEY` | OpenAI API key | No (AI features fallback) |
| `ANTHROPIC_API_KEY` | Anthropic API key | No (AI features fallback) |
| `LOG_LEVEL` | Logging level (info/debug/error) | No |
| `NODE_ENV` | Environment (production/development) | No |

## 🔒 Security

- API keys never logged or exposed
- Input validation on all operations
- Secure HTTPS connections
- Non-root Docker execution
- Rate limiting ready (Phase 3)

## 📈 Performance

- TypeScript for optimal performance
- Efficient API batching
- Connection pooling
- Redis caching (Phase 3)
- Lazy loading of AI models

## 🎯 Use Cases

1. **Vacation Rental Websites**: Integrate with your site for real-time availability
2. **Property Management**: Automate guest communications and pricing
3. **Content Creation**: Generate property descriptions and social media posts
4. **Revenue Optimization**: AI-driven pricing strategies
5. **Market Analysis**: Competitive intelligence and trends

## 📄 License

MIT License - see [LICENSE](LICENSE) file

## 🤝 Contributing

Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md)

## 📞 Support

- GitHub Issues: [Create an issue](https://github.com/xenflashbox/lodgify-mcp/issues)
- Documentation: [Lodgify API Docs](https://docs.lodgify.com/)
- Email: support@xencolabs.com

## 🚀 Roadmap

- [x] Phase 1: Core Foundation
- [x] Phase 2: AI Integration
- [ ] Phase 3: Advanced Features (Q1 2025)
- [ ] Phase 4: Commercial Package (Q2 2025)
- [ ] Cloud hosting option
- [ ] Mobile app integration
- [ ] Multi-language support

---

**Built with ❤️ by XencoLabs** - Enterprise-grade MCP solutions for the AI era