The mcp-server has been refactored to use HTTP requests instead of direct imports from Appimate-Business. This allows both services to be deployed separately.
-
Created HTTP Client (
src/lib/http-client.ts)- Handles all HTTP requests to Appimate-Business API endpoints
- Supports authentication via access tokens
- Provides methods for all entity queries
-
Refactored Query Executor (
src/lib/ai-assistant/query-executor.ts)- Removed all direct imports from Appimate-Business
- All queries now use HTTP client instead
- No more path alias resolution issues
Set the following environment variable:
APPIMATE_BUSINESS_URL=http://localhost:3000For production:
APPIMATE_BUSINESS_URL=https://your-appimate-business-domain.comThe mcp-server calls these Appimate-Business API endpoints:
/api/invoices?action=list- List invoices/api/quotes?action=list- List quotes/api/products?action=list- List products/api/financials?action=list- List financial statements/api/assets?action=list- List assets/api/payroll?action=list- List employees/api/organisations?action=list- List organisations
The HTTP client automatically includes the accessToken from the session context in:
- Authorization header:
Bearer {token} - Query parameter:
accessToken={token}(for compatibility)
✅ Separate Deployment: Services can be deployed independently
✅ No Path Alias Issues: No more @/ path resolution problems
✅ Scalability: Each service can scale independently
✅ Clear Separation: Clean API boundaries between services
- Set
APPIMATE_BUSINESS_URLenvironment variable - Ensure Appimate-Business is running and accessible
- Test queries through mcp-server - they should work via HTTP