thefixer3x/onasis-gateway
If you are the rightful owner of onasis-gateway 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.
The Model Context Protocol (MCP) server is designed to facilitate seamless integration and management of multiple APIs, providing a structured approach to service activation and monitoring.
API Service Warehouse
A comprehensive baseline structure for integrating multiple APIs without costly omissions. This warehouse approach enables selective activation of services per app/product while maintaining complete coverage of all available APIs.
🎯 Problem Solved
Challenge: AI agents and developers frequently miss essential services during API integration, leading to expensive re-integration cycles and omissions that require going back for additional access/permissions.
Solution: Front-load all architectural decisions by creating a comprehensive API service warehouse that catalogs all services upfront, enabling selective activation without repetitive integration work.
🏗️ Architecture Overview
┌─────────────────────────────────────────────────────────────┐
│ API Service Warehouse │
├─────────────────────────────────────────────────────────────┤
│ MCP Server │ API Gateway │ Core Services │
│ - Service Discovery │ - REST Endpoints │ - Base Client │
│ - Recommendations │ - Proxy Requests │ - Auth Handler │
│ - Health Checks │ - Batch Operations │ - Rate Limiter │
│ - Integration Guide │ - Analytics │ - Circuit Breaker │
└─────────────────────────────────────────────────────────────┘
│
├── services/ # Extracted service configs
│ ├── stripe/ # Stripe API service
│ ├── bap-postman-collection/ # BAP Nigerian payments
│ ├── wise-multicurrency/ # Wise MCA platform
│ ├── hostinger-api/ # Infrastructure services
│ └── ... (18 total services)
│
├── scripts/ # Extraction & management tools
├── core/ # Universal client & utilities
├── mcp-server/ # MCP service for AI agents
├── api-gateway/ # REST API for applications
└── templates/ # Integration templates
📦 Included Services
Payment & Financial (7 services)
- Stripe API - Complete payment processing
- BAP (Biller Aggregation Portal) - Nigerian payment services with HMAC auth
- Wise Multicurrency Account - Multi-currency banking platform
- Xpress Wallet For Merchants - Merchant payment solutions
- Open Banking API - Banking data access
- Business API - Business financial services
- Merchant API - Additional merchant tools
Infrastructure & Hosting (4 services)
- Hostinger API - Web hosting management
- ngrok API - Tunnel and webhook services (3 collections)
Media & Content (1 service)
- Shutterstock API - Stock media and content
Analytics & Tracking (1 service)
- Google Analytics API V3 - Web analytics
Integration & Testing (5 services)
- SaySwitch API Integration - Payment switching
- EDoc External App Integration - Document processing
- API Testing Basics - Testing utilities
- Multi Currency Account - Additional currency services
- seftec-payment-collection - Payment collection services
🚀 Quick Start
1. Extract All Services
# Install dependencies
npm install
# Extract all 19 API collections into service configs
npm run extract
# Verify extraction
ls services/ # Should show 18 service directories
2. Start MCP Server (for AI Agents)
cd mcp-server
npm install
npm start
3. Start API Gateway (for Applications)
cd api-gateway
npm install
npm start
# Gateway runs on http://localhost:3000
🔧 Usage Examples
Service Discovery
# List all services
curl http://localhost:3000/api/services
# Find payment services
curl http://localhost:3000/api/services?capability=payment
# Search for specific service
curl http://localhost:3000/api/services?search=stripe
Service Activation
# Activate Stripe service
curl -X POST http://localhost:3000/api/services/stripe/activate \
-H "Content-Type: application/json" \
-d '{"config": {"token": "your-stripe-token"}}'
# Batch activate payment services
curl -X POST http://localhost:3000/api/batch/activate \
-H "Content-Type: application/json" \
-d '{
"services": ["stripe", "bap-postman-collection", "wise-multicurrency"],
"config": {"timeout": 30000}
}'
Proxy Requests
# Make request through activated service
curl http://localhost:3000/api/proxy/stripe/customers
# BAP payment request
curl -X POST http://localhost:3000/api/proxy/bap-postman-collection/payment \
-H "Content-Type: application/json" \
-d '{"amount": 1000, "currency": "NGN"}'
🛠️ Service Worker Instructions
Adding New Services
-
Extract Service Configuration
node scripts/extract-service.js path/to/new-collection.json services/ -
Verify Extraction
- Check
services/[service-name]/[service-name].jsonfor complete config - Ensure all endpoints, authentication, and capabilities are captured
- Validate generated client, webhooks, and test files
- Check
-
Update Catalog
npm run extract # Regenerates master catalog
Service Integration Checklist
- Authentication: All auth methods properly configured
- Endpoints: All API endpoints extracted with parameters
- Error Handling: Error codes and responses documented
- Rate Limits: Rate limiting information captured
- Webhooks: Webhook endpoints and handlers configured
- Testing: Integration tests generated
- Documentation: Service documentation complete
🔐 Authentication Support
The warehouse supports all major authentication methods:
- Bearer Token:
Authorization: Bearer <token> - API Key: Header or query parameter based
- Basic Auth: Username/password combinations
- HMAC: Complex signature-based auth (BAP, etc.)
- OAuth 2.0: Full OAuth flow support
📊 Monitoring & Analytics
Health Checks
# Check all services
curl http://localhost:3000/api/batch/status
# Check specific service
curl http://localhost:3000/api/services/stripe/status
Usage Analytics
# Get usage statistics
curl http://localhost:3000/api/analytics/usage
# Performance metrics
curl http://localhost:3000/api/analytics/performance
🔄 Integration Templates
Generate ready-to-use integration code:
# Generate Express.js template
curl -X POST http://localhost:3000/api/templates/generate \
-H "Content-Type: application/json" \
-d '{
"services": ["stripe", "bap-postman-collection"],
"projectType": "express"
}'
🎯 Success Metrics
- ✅ Zero Omissions: All 19 services catalogued and accessible
- ✅ Selective Activation: Enable only needed services per project
- ✅ Universal Authentication: All auth methods supported
- ✅ Comprehensive Monitoring: Health checks and analytics
- ✅ Error Resilience: Circuit breakers and retry logic
- ✅ Developer Experience: Clear docs and templates
📁 Directory Structure
api-integration-json-files/
├── services/ # Extracted service configurations
│ ├── catalog.json # Master service catalog
│ ├── stripe/ # Individual service directories
│ │ ├── stripe.json # Service configuration
│ │ ├── client.js # Generated client
│ │ ├── webhooks.js # Webhook handlers
│ │ └── test.js # Integration tests
│ └── ... (17 more services)
├── scripts/ # Extraction and management tools
│ ├── extract-service.js # Single service extractor
│ └── extract-all-services.sh # Batch extraction script
├── core/ # Universal components
│ └── base-client.js # Universal API client
├── mcp-server/ # MCP server for AI agents
│ ├── index.js # MCP server implementation
│ └── package.json # MCP dependencies
├── api-gateway/ # REST API gateway
│ ├── index.js # Gateway implementation
│ └── package.json # Gateway dependencies
├── logs/ # Extraction and operation logs
├── BASELINE_STRUCTURE.md # Comprehensive baseline guide
└── README.md # This file
🔧 Configuration
Environment Variables
# API Gateway
PORT=3000
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
# Service-specific tokens (add as needed)
STRIPE_TOKEN=sk_test_...
BAP_API_KEY=your_bap_key
BAP_SECRET=your_bap_secret
WISE_TOKEN=your_wise_token
HOSTINGER_API_KEY=your_hostinger_key
Service Configuration
Each service has a standardized configuration:
{
"name": "service-name",
"version": "1.0.0",
"baseUrl": "https://api.service.com",
"authentication": {
"type": "bearer|apikey|basic|hmac|oauth2",
"config": { /* auth-specific config */ }
},
"endpoints": [
{
"name": "endpoint-name",
"path": "/api/endpoint",
"method": "GET|POST|PUT|DELETE",
"parameters": { /* parameter definitions */ }
}
],
"capabilities": ["payment", "analytics", "media", "infrastructure"],
"dependencies": ["other-service-names"],
"metadata": { /* additional service info */ }
}
🚨 Critical Checkpoints
Before deploying any integration:
- Service Completeness: All 19 services extracted and configured
- Authentication Verification: All auth methods tested
- Endpoint Coverage: All API endpoints accessible
- Error Handling: Comprehensive error responses
- Rate Limiting: Proper rate limit handling
- Health Monitoring: All services health-checkable
- Documentation: Complete service documentation
📞 Support
For issues or questions:
- Check the extraction logs in
logs/ - Verify service configuration in
services/[service-name]/ - Test individual services using the API gateway
- Review the baseline structure in
BASELINE_STRUCTURE.md
🎉 Success!
You now have a comprehensive API service warehouse that:
- Prevents costly omissions through upfront cataloging
- Enables selective service activation per project
- Provides universal authentication and error handling
- Offers both MCP (AI agents) and REST (applications) interfaces
- Includes monitoring, analytics, and integration templates
No more repetitive integration cycles or missed essential services!