MoEngage Documentation MCP Server
A Model Context Protocol (MCP) server that provides access to comprehensive MoEngage documentation from multiple sources with automatic updates.
📚 Documentation Sources
This server indexes documentation from three primary MoEngage sources:
- developers.moengage.com - SDK documentation, API references, integration guides
- help.moengage.com - User guides, tutorials, troubleshooting, FAQs
- partners.moengage.com - Partner integrations, marketplace documentation
🚀 Quick Deploy to Replit
For easy deployment on Replit, see REPLIT_DEPLOYMENT.md.
Features
- Multi-Source Documentation: Indexes from developers.moengage.com, help.moengage.com, and partners.moengage.com
- Comprehensive Search: Full-text search across all MoEngage documentation sources
- Automatic Updates: Weekly scheduled updates from multiple sitemap XMLs
- Intelligent Processing: Converts HTML documentation to structured markdown
- Source-Aware Filtering: Filter by documentation source, platform, category, and type
- Platform-Specific Search: Filter by Android, iOS, Web, React Native, Flutter, APIs, etc.
- Category Organization: Browse documentation by source and SDK categories
- Recent Updates Tracking: See what documentation has been recently added or modified
- Manual Update Triggers: Force immediate updates when needed
- Robust Error Handling: Comprehensive logging and error recovery
- Rate Limiting: Respectful crawling with configurable rate limits
- SQLite Storage: Fast local storage with full-text search capabilities
- Replit Ready: Pre-configured for easy Replit deployment
Installation
- Clone the repository:
- Install dependencies:
- Configure environment:
- Build the project:
Configuration
All configuration is done through environment variables. Copy .env.example
to .env
and modify as needed:
Key Configuration Options
- UPDATE_SCHEDULE: Cron expression for automatic updates (default:
0 0 2 * * 0
- every Sunday at 2 AM) - DATABASE_PATH: SQLite database file location
- SITEMAP_URLS: Comma-separated list of sitemap URLs (includes developers, help, and partners)
- RATE_LIMIT_REQUESTS: Maximum requests per window (default: 10)
- MAX_CONCURRENT_UPDATES: Concurrent document processing (default: 5)
- FORCE_UPDATE_ON_START: Perform full update on server start (default: false)
Usage
Starting the Server
For development:
For production:
MCP Tools
The server provides several tools for accessing MoEngage documentation:
1. search_documentation
Search across all documentation with optional filters.
Parameters:
query
(string): Search querycategory
(optional): Filter by category (e.g., "Developers - Android SDK", "Help - Getting Started")platform
(optional): Filter by platform (android, ios, web, etc.)source
(optional): Filter by source (developers, help, partners)limit
(optional): Maximum results (default: 10)
Example:
2. get_document
Retrieve a specific document by ID with full content.
Parameters:
id
(string): Document ID
3. list_categories
List all documentation categories with document counts.
Parameters:
platform
(optional): Filter categories by platform
4. get_recent_updates
Get recently updated or added documentation.
Parameters:
since
(optional): ISO date string to get updates sincelimit
(optional): Maximum results (default: 20)
5. get_update_status
Get the status of the last documentation update.
6. trigger_update
Manually trigger a documentation update.
Parameters:
force
(optional): Force update even if documents haven't changed
Architecture
Components
- MCP Server (
src/index.ts
): Main MCP server implementation - Database (
src/database.ts
): SQLite database with full-text search - Document Processor (
src/document-processor.ts
): HTML to Markdown conversion - Sitemap Updater (
src/sitemap-updater.ts
): Processes sitemap and updates documents - Scheduler (
src/scheduler.ts
): Handles automatic updates - Configuration (
src/config.ts
): Environment-based configuration - Logging (
src/logger.ts
): Structured logging with Winston
Database Schema
The server uses SQLite with the following main tables:
- documents: Stores processed documentation with metadata
- documents_fts: Full-text search virtual table
- update_status: Tracks update history and statistics
Document Processing Pipeline
- Sitemap Parsing: Fetch and parse the XML sitemap
- URL Filtering: Filter to documentation pages only
- Content Extraction: Extract title, content, and metadata from HTML
- Markdown Conversion: Convert HTML to clean Markdown
- Categorization: Automatically categorize by platform and type
- Storage: Store in SQLite with full-text indexing
- Cleanup: Remove documents no longer in sitemap
Automatic Updates
The server automatically updates documentation based on:
- Scheduled Updates: Configurable cron schedule (default: weekly)
- Incremental Updates: Only processes changed documents
- Sitemap Comparison: Tracks document modification dates
- Content Checksums: Detects actual content changes
- Error Recovery: Handles failures gracefully with retry logic
Update Process
- Fetch current sitemap XML
- Compare with last update timestamp
- Process only new/modified documents
- Update database atomically
- Clean up deleted documents
- Log statistics and errors
Monitoring and Logging
Log Levels
- error: Critical errors and failures
- warn: Warnings and recoverable issues
- info: General information and status
- debug: Detailed debugging information
Log Files
mcp-server.log
: Combined log filemcp-server-error.log
: Error-only log file
Metrics Tracked
- Total documents processed
- New/updated/deleted document counts
- Processing duration and performance
- Error rates and types
- Search query patterns
Development
Scripts
npm run dev
: Start development server with auto-reloadnpm run build
: Build TypeScript to JavaScriptnpm run test
: Run test suitenpm run lint
: Run ESLintnpm run format
: Format code with Prettier
Testing
Adding New Features
- Update TypeScript types in
src/types.ts
- Add new MCP tools in
src/index.ts
- Extend database schema if needed in
src/database.ts
- Update documentation and tests
Production Deployment
System Requirements
- Node.js 18+
- 2GB+ RAM (for large documentation sets)
- 1GB+ disk space (for database and logs)
- Stable internet connection
Deployment Steps
- Server Setup:
- Application Deployment:
- Service Setup (using systemd):
- Start Service:
Monitoring in Production
- Logs:
journalctl -u moengage-mcp -f
- Status:
systemctl status moengage-mcp
- Database Size: Monitor
data/
directory - Update Performance: Check update_status table
Backup and Recovery
Database Backup:
Full System Backup:
Troubleshooting
Common Issues
1. Update Failures
- Check internet connectivity to
developers.moengage.com
- Verify sitemap URL is accessible
- Review rate limiting configuration
- Check disk space for database
2. Search Not Working
- Verify database initialization
- Rebuild FTS index:
DELETE FROM documents_fts; INSERT INTO documents_fts(documents_fts) VALUES('rebuild');
- Check for database corruption
3. Memory Issues
- Reduce
MAX_CONCURRENT_UPDATES
- Increase system swap space
- Monitor with
htop
during updates
4. Permission Errors
- Check file permissions on database directory
- Verify log directory is writable
- Ensure user has required permissions
Debug Mode
Enable debug logging:
Health Check
Test server health:
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Code Style
- Use TypeScript with strict typing
- Follow ESLint configuration
- Format with Prettier
- Write comprehensive tests
- Document new features
License
MIT License - see LICENSE file for details.
Support
- Documentation: This README and inline code comments
- Issues: GitHub Issues for bug reports and feature requests
- Logs: Check application logs for detailed error information
- Database: SQLite browser tools for direct database inspection
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Provides comprehensive access to MoEngage documentation from developers, help, and partners portals with full-text search, automatic updates, and intelligent filtering by platform, category, and source.
Related MCP Servers
- -securityAlicense-qualityProvides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.Last updated -13TypeScriptMIT License
- -securityFlicense-qualityA simple Model Context Protocol server that enables searching and retrieving relevant documentation snippets from Langchain, Llama Index, and OpenAI official documentation.Last updated -Python
- -securityFlicense-qualityEnables AI assistants to search documentation of packages and services to find implementation details, examples, and specifications.Last updated -Python
- -securityFlicense-qualityEnables AI assistants to search for documentation of packages and services, providing implementation details, examples, and specifications through a specialized API.Last updated -11JavaScript