API Gateway

Secure, monitored access to your deployed applications

Overview

The MCPHub API Gateway provides secure, authenticated access to your deployed applications. Instead of exposing your deployments directly to the internet, all requests flow through our gateway which adds authentication, rate limiting, monitoring, and security features.

Gateway URL Format

https://www.mcphub.com/api/gateway/{user_id}/{deployment_id}/{path}

All requests to your deployment should use this format for maximum security and features.

Features

🔒 Authentication

Only authenticated users can access deployments. User sessions are verified on every request.

🛡️ Authorization

Users can only access their own deployments. Deployment ownership is verified automatically.

⚡ Rate Limiting

Prevents abuse with configurable rate limits per user and deployment.

📊 Monitoring

All requests are logged with metrics for performance monitoring and analytics.

🔄 Circuit Breaker

Automatically handles failing deployments to prevent cascading failures.

🌐 CORS Handling

Properly configured CORS headers for web applications and API access.

How It Works

1

Request Authentication

The gateway verifies your user session and ensures you're logged in.

2

Deployment Verification

Checks that the deployment exists, is running, and belongs to your account.

3

Rate Limiting

Applies rate limits to prevent abuse and ensure fair usage across all users.

4

Request Proxying

Forwards your request to the internal deployment with additional security headers.

5

Response Processing

Processes the response, adds security headers, and logs the request for monitoring.

Usage Examples

Web Application Access

https://www.mcphub.com/api/gateway/user-123/openwebui-abc123/

Access the main page of your deployed web application

API Endpoint Access

https://www.mcphub.com/api/gateway/user-123/my-api-def456/api/v1/users

Access API endpoints within your deployed application

Static Assets

https://www.mcphub.com/api/gateway/user-123/webapp-789/static/css/main.css

Static files like CSS, JavaScript, and images are served through the gateway

Monitoring & Analytics

The gateway automatically tracks usage metrics for your deployments:

  • Request count and frequency
  • Response times and performance metrics
  • Error rates and status codes
  • User access patterns and geographic data
  • Resource usage and bandwidth consumption

Coming Soon

We're working on a dedicated analytics dashboard where you'll be able to view detailed metrics, set up alerts, and analyze your deployment usage patterns.

Best Practices

Always use gateway URLs

Use the gateway URL for all public links to ensure security and monitoring.

Handle authentication gracefully

Your application should handle cases where users might not be authenticated.

Monitor your usage

Keep an eye on request patterns to optimize performance and costs.

⚠️

Avoid direct URLs in production

Direct deployment URLs bypass security and monitoring features.