alangould92/fareway-database-mcp
If you are the rightful owner of fareway-database-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 dayong@mcphub.com.
Fareway Database MCP Server is a production-grade Model Context Protocol server designed to provide AI agents with secure and efficient access to Fareway's golf tour database.
Fareway Database MCP Server 🎯
Production-grade Model Context Protocol (MCP) server providing AI agents with secure, performant access to Fareway's golf tour database.
🌟 Features
Enterprise-Grade Architecture
- Type-Safe: Full TypeScript with strict mode
- Performant: Connection pooling, caching, and optimized queries
- Secure: API key auth, rate limiting, RLS enforcement
- Observable: Structured logging, health checks, metrics
- Scalable: Horizontal scaling ready, Redis support
MCP Tools Exposed
Course Tools
search_courses- Search courses by region, type, price rangeget_course_details- Get comprehensive course informationget_recommended_courses- AI-optimized course recommendationsfind_course_by_name- Fuzzy search by course name
Accommodation Tools
search_accommodations- Find hotels near courses/regionsget_accommodation_details- Detailed hotel informationget_golf_resorts- Find stay-and-play properties
Pricing & Rates Tools
get_supplier_rates- Get operator's negotiated rateshas_negotiated_rate- Quick check for special pricingget_operator_suppliers- List operator's supplier relationships
🚀 Quick Start
Development
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Configure your .env file with Supabase credentials
# Run in development mode
npm run dev
Production
# Build
npm run build
# Start
npm start
Docker
# Build image
docker build -t fareway-database-mcp .
# Run
docker run -p 8081:8081 --env-file .env fareway-database-mcp
📡 API Endpoints
Health & Status
GET /health- Health checkGET /metrics- Prometheus metrics (if enabled)
MCP Protocol
GET /sse- Server-Sent Events for MCP communicationPOST /api/tools/{tool_name}- Direct REST API access (for testing)
🔒 Security
Authentication
All requests require API key authentication:
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:8081/api/tools/search_courses
Rate Limiting
- Default: 100 requests per minute per API key
- Configurable via environment variables
Row-Level Security
All database queries respect Supabase RLS policies.
🎯 Tool Usage Examples
Search Courses
{
"name": "search_courses",
"arguments": {
"region": "Southwest Ireland",
"course_type": "links",
"max_price_cents": 50000,
"limit": 10
}
}
Get Supplier Rates
{
"name": "get_supplier_rates",
"arguments": {
"operator_id": "uuid-here",
"supplier_type": "golf_course"
}
}
📊 Monitoring
Structured Logging
All logs are JSON-formatted for easy parsing:
{
"timestamp": "2024-11-25T20:00:00.000Z",
"level": "info",
"tool": "search_courses",
"duration_ms": 145,
"success": true,
"results_count": 8
}
Health Checks
curl http://localhost:8081/health
Response:
{
"status": "healthy",
"version": "1.0.0",
"uptime_seconds": 3600,
"database": "connected",
"cache": "connected"
}
🏗️ Architecture
┌─────────────────────────────────────────┐
│ HTTP/SSE Server (Express) │
│ - Authentication middleware │
│ - Rate limiting │
│ - Request validation │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ MCP Server Core │
│ - Tool registry │
│ - Request routing │
│ - Response formatting │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Tool Implementations │
│ - Course tools │
│ - Accommodation tools │
│ - Rate tools │
└──────────────┬──────────────────────────┘
│
┌────────┴────────┐
▼ ▼
┌──────────┐ ┌──────────┐
│ Supabase │ │ Redis │
│ (DB) │ │ (Cache) │
└──────────┘ └──────────┘
🧪 Testing
# Run tests
npm test
# Run with coverage
npm test:coverage
# Type check
npm run typecheck
📦 Deployment
Railway
- Push to GitHub
- Connect Railway to your repo
- Set root directory:
fareway-database-mcp - Configure environment variables
- Deploy!
Environment Variables (Production)
Required:
SUPABASE_URLSUPABASE_SERVICE_KEYMCP_API_KEY
Optional:
REDIS_URL(for caching)PORT(default: 8081)LOG_LEVEL(default: info)
🔧 Configuration
Cache Settings
ENABLE_CACHE=true
CACHE_TTL_SECONDS=300
Rate Limiting
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
📄 License
Proprietary - Fareway Technologies
🤝 Support
For issues or questions, contact the Fareway development team.
Built with ❤️ for the future of golf tour operations