Home

Monitoring MCP Servers

This guide explains how to monitor the performance and health of your MCP servers using MCP-Cloud's monitoring features.

Overview

MCP-Cloud provides comprehensive monitoring capabilities for your MCP servers, including:

Metrics Dashboard

The metrics dashboard provides a real-time overview of your server's performance.

Metrics Dashboard

Key Metrics

Metric Description Typical Values Alert Threshold
CPU Usage Percentage of CPU resources used 10-60% >80%
Memory Usage Memory consumption in MB Varies by model >90% of allocated
Request Rate Requests per minute Varies by usage N/A
Response Time Average response time in ms 200-2000ms >5000ms
Error Rate Percentage of failed requests <1% >5%
Token Throughput Tokens processed per second Varies by model N/A

Real-time Logs

MCP-Cloud provides real-time log streaming via Server-Sent Events (SSE), allowing you to monitor your server's operations as they happen.

Accessing Logs

  1. Navigate to your server's dashboard
  2. Select the "Logs" tab
  3. View real-time logs or search historical logs

Log Levels

Logs are categorized by severity:

Log Filtering

You can filter logs by:

SSE Metrics Stream

For programmatic monitoring, MCP-Cloud provides a metrics stream via SSE:

const eventSource = new EventSource(
  'https://api.mcp-cloud.ai/api/servers/123/metrics/stream',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN'
    }
  }
);

eventSource.addEventListener('metrics', (event) => {
  const metrics = JSON.parse(event.data);
  console.log('Current CPU usage:', metrics.cpu, '%');
  console.log('Current memory usage:', metrics.memory, 'MB');
  console.log('Requests in last minute:', metrics.requestRate);
});

Setting Up Alerts

MCP-Cloud allows you to configure alerts based on metrics thresholds:

  1. Navigate to your server's dashboard
  2. Select the "Alerts" tab
  3. Click "Create Alert"
  4. Configure alert conditions:
    • Metric: Select the metric to monitor
    • Threshold: Set the trigger threshold
    • Duration: How long the condition must persist
    • Channel: Email, SMS, or webhook notification

Alert Channels

MCP-Cloud supports multiple notification channels:

Historical Analytics

MCP-Cloud retains performance data for historical analysis:

Access historical data through:

  1. The web dashboard
  2. CSV export
  3. API access

Resource Optimization

Based on monitoring data, MCP-Cloud can recommend resource optimizations:

Integration with External Monitoring

MCP-Cloud can integrate with external monitoring systems:

Example Prometheus configuration:

scrape_configs:
  - job_name: 'mcp-server'
    scrape_interval: 15s
    metrics_path: '/metrics'
    scheme: https
    basic_auth:
      username: 'prometheus'
      password: 'YOUR_API_TOKEN'
    static_configs:
      - targets: ['your-server-id.metrics.mcp-cloud.ai']

Best Practices

  1. Set up alerts for critical metrics: CPU, memory, error rate
  2. Monitor response times: Identify performance degradation early
  3. Review logs regularly: Look for warning patterns before they become errors
  4. Track usage patterns: Understand peak usage times
  5. Correlate metrics with business events: Identify impact of marketing campaigns, etc.
  6. Test alert configurations: Ensure notifications work as expected

Troubleshooting

If monitoring data appears incorrect:

  1. Check the server status to ensure it's running
  2. Verify that any proxy or firewall isn't blocking metrics
  3. Ensure your API token has the necessary permissions
  4. Try accessing raw metrics via the API to bypass dashboard issues
  5. Contact support if issues persist