youngliving/yl-mcp
If you are the rightful owner of yl-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server providing AI-powered access to Young Living CDK documentation and resources.
MCP Server Template for Young Living
A production-ready template for building Model Context Protocol (MCP) servers at Young Living, featuring OAuth authentication, AWS deployment, and comprehensive monitoring.
What is this template?
This template provides everything you need to quickly build and deploy MCP servers that integrate with Young Living's infrastructure. It includes:
- Multiple transport protocols (stdio, HTTP-SSE, HTTP-Streamable)
- Young Living OAuth integration with secure session management
- AWS deployment infrastructure using ECS Fargate
- Comprehensive monitoring with CloudWatch and health checks
- Production-ready patterns following YL best practices
Quick Start
Prerequisites
- Node.js 18.0.0 or newer
- pnpm 9.x or newer
- AWS CLI configured with Young Living credentials
- Docker (optional, for local development)
1. Set up the template
This is a template repository with placeholder values that need to be replaced. You must run the template setup process first:
# Clone and install
git clone <your-repo-url>
cd your-project
pnpm install
# Follow the template setup instructions
# See TEMPLATE-SETUP.md for detailed instructions
2. Build and test
# Build the project
pnpm build
# Test the MCP server locally
pnpm start
# Run tests
pnpm test
3. Deploy to AWS
# Deploy to development environment
pnpm deploy:dev
What's included?
š§ Core Features
- MCP Protocol Implementation: Full support for Model Context Protocol with resources, tools, and prompts
- Multiple Transports: Choose between stdio, HTTP-SSE, or HTTP-Streamable based on your needs
- TypeScript: Full type safety with strict mode enabled
- Testing Framework: Vitest with comprehensive test coverage
š Security & Authentication
- YL OAuth Integration: Built-in OAuth2 flow with PKCE for web-based access
- Session Management: Secure DynamoDB-backed session storage
- IAM Roles: Least-privilege access patterns
- Parameter Store: Secure credential management
āļø AWS Infrastructure
- ECS Fargate: Containerized deployment with auto-scaling
- Application Load Balancer: Custom domain with TLS termination
- DynamoDB: Session storage and data persistence
- CloudWatch: Comprehensive logging and monitoring
- Route53: DNS management with custom domains
š ļø Developer Experience
- Hot Reload: Development server with automatic restarts
- Docker Support: Local development containers
- CDK Infrastructure: Infrastructure as code using Young Living's CDK patterns
- Health Checks: Built-in health endpoints for monitoring
Development Commands
Command | Description |
---|---|
pnpm build | Build TypeScript to dist/ |
pnpm start | Start with stdio transport (default) |
pnpm start:sse | Start with HTTP Server-Sent Events |
pnpm start:streamable | Start with HTTP Streamable transport |
pnpm start:http | Start with dual HTTP transport |
pnpm test | Run all tests |
pnpm test:watch | Run tests in watch mode |
Deployment Commands
Command | Description |
---|---|
pnpm synth | Synthesize CDK templates |
pnpm deploy:dev | Deploy to development environment |
pnpm deploy:local | Deploy to local AWS profile |
pnpm docker:up | Start with Docker Compose |
Project Structure
src/
āāā handlers/ # MCP request handlers
ā āāā prompts.ts # AI prompt generation
ā āāā resources.ts # Resource access (customize for your data)
ā āāā templates.ts # Project templates
ā āāā tools.ts # Utility tools
āāā transports/ # Transport protocol implementations
āāā utils/ # Configuration and utilities
āāā index.ts # Application entry point
āāā server.ts # Core MCP server implementation
stacks/ # AWS CDK infrastructure
āāā mcp-server-stack.ts # Main ECS deployment
āāā mcp-session-storage-stack.ts # DynamoDB session storage
config/ # OAuth and environment configuration
tests/ # Test files
Transport Protocols
stdio (Default)
Perfect for CLI tools and local development:
pnpm start
echo '{"jsonrpc": "2.0", "method": "initialize", "id": 1, "params": {...}}' | node dist/index.js
HTTP Server-Sent Events (SSE)
Great for real-time web applications:
pnpm start:sse
# Access at: http://localhost:3000/sse
HTTP Streamable
Ideal for streaming responses:
pnpm start:streamable
# Access at: http://localhost:3000/mcp
Dual HTTP
Supports both SSE and Streamable:
pnpm start:http
# SSE: http://localhost:3000/sse
# Streamable: http://localhost:3000/mcp
Customizing for Your Use Case
1. Update Resource Handlers
Edit src/handlers/resources.ts
to provide access to your data:
// Replace example resources with your own
const resources = [
{
uri: "myapp://documents/",
name: "Company Documents",
description: "Access to company documentation"
}
];
2. Add Custom Tools
Edit src/handlers/tools.ts
to add functionality:
// Add tools that your MCP server can perform
export const tools = [
{
name: "search_documents",
description: "Search through company documents",
inputSchema: { /* ... */ }
}
];
3. Configure Authentication
Update config/auth*.json
files with your OAuth client settings when ready to deploy.
Testing Your MCP Server
Using MCP Inspector
# Test stdio transport
npx @modelcontextprotocol/inspector --cli node dist/index.js
# Test HTTP transport
npx @modelcontextprotocol/inspector --cli http://localhost:3000
# List available prompts
npx @modelcontextprotocol/inspector --cli node dist/index.js --method prompts/list
Health Check
curl http://localhost:3000/health
# Returns: {"status": "healthy", "service": "your-service-name"}
Deployment
The template is designed for production deployment on AWS ECS Fargate. After template setup:
- Review OAuth Configuration: Update client IDs in
config/auth*.json
- Deploy to Development:
pnpm deploy:dev
- Test Remote Deployment:
pnpm test:remote:dev
- Deploy to Production:
pnpm deploy:prod
Environment Variables
Variable | Default | Description |
---|---|---|
MCP_TRANSPORT | stdio | Transport protocol |
MCP_PORT | 3000 | HTTP server port |
MCP_HOST | localhost | HTTP server host |
MCP_AUTH_ENABLED | false | Enable authentication |
NODE_ENV | development | Environment mode |
Support
For questions or issues:
- Check the for setup instructions
- Review the project documentation
- Contact the Platform Engineering team
- Create an issue with detailed reproduction steps
What's Next?
After setting up your MCP server:
- Customize the handlers in
src/handlers/
for your specific use case - Add your business logic and integrate with your data sources
- Configure OAuth settings when ready to deploy
- Set up monitoring and alerting for production use
- Deploy to development and test thoroughly before production
This template gets you from zero to production-ready MCP server in minutes, not days.