mcp-server-config

klogins-hash/mcp-server-config

3.1

If you are the rightful owner of mcp-server-config 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.

This document provides a comprehensive guide to setting up and managing a Model Context Protocol (MCP) server using metamcp with HTTPS support.

MCP Server Configuration

This repository contains the complete configuration for the MCP (Model Context Protocol) server running metamcp with HTTPS support.

🏗️ Architecture

  • Server: DigitalOcean Droplet (143.198.46.107)
  • Domain: mcp.hitsdifferent.ai
  • Application: metamcp (Docker container)
  • Web Server: Nginx (reverse proxy with SSL termination)
  • SSL: Let's Encrypt certificates
  • Database: PostgreSQL (Docker container)

📁 Repository Structure

├── nginx/                 # Nginx configuration files
│   ├── mcp-hitsdifferent.conf  # Site configuration
│   └── nginx.conf         # Main nginx configuration
├── docker/                # Docker application files
│   ├── docker-compose.yml # Docker compose configuration
│   ├── .env              # Environment variables
│   └── package.json      # Application package info
├── scripts/               # Deployment and management scripts
│   ├── deploy.sh         # Full deployment script
│   ├── backup.sh         # Backup script
│   └── update.sh         # Update script
├── ssh/                  # SSH configuration
│   └── ssh-config        # SSH client configuration
├── docs/                 # Documentation
└── ssl/                  # SSL certificate info (certificates not stored)

🚀 Quick Deployment

Prerequisites

  • Ubuntu 22.04 server
  • Root SSH access
  • Domain name pointing to server IP

Deploy to New Server

  1. Clone this repository:

    git clone <repository-url>
    cd mcp-server-config
    
  2. Run deployment script:

    ./scripts/deploy.sh <server-ip> <domain> <email>
    

    Example:

    ./scripts/deploy.sh 143.198.46.107 mcp.hitsdifferent.ai frank@hitsdifferent.ai
    

Manual Deployment

If you prefer manual deployment, follow these steps:

  1. Install dependencies:

    apt update && apt upgrade -y
    apt install -y nginx certbot python3-certbot-nginx docker.io docker-compose-plugin
    
  2. Deploy Nginx configuration:

    cp nginx/mcp-hitsdifferent.conf /etc/nginx/sites-available/mcp-server
    ln -s /etc/nginx/sites-available/mcp-server /etc/nginx/sites-enabled/
    nginx -t && systemctl reload nginx
    
  3. Deploy application:

    mkdir -p /opt/metamcp
    cp docker/* /opt/metamcp/
    cd /opt/metamcp && docker compose up -d
    
  4. Get SSL certificate:

    certbot --nginx -d your-domain.com --email your-email@domain.com --agree-tos --non-interactive
    

🔧 Management

Backup Server Configuration

./scripts/backup.sh <server-ip>

Update Application

./scripts/update.sh <server-ip>

Check Status

ssh root@<server-ip> "cd /opt/metamcp && docker compose ps"

View Logs

ssh root@<server-ip> "cd /opt/metamcp && docker compose logs -f"

🌐 Endpoints

🔒 Security

  • HTTPS: Enforced with automatic HTTP→HTTPS redirect
  • SSL Certificates: Let's Encrypt with automatic renewal
  • Firewall: UFW enabled (ports 22, 80, 443 open)
  • API Authentication: Bearer token required for MCP access

📊 Monitoring

Health Checks

# Application health
curl -f https://mcp.hitsdifferent.ai/

# MCP endpoint health
curl -s https://mcp.hitsdifferent.ai/metamcp/metamcp-mcp/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer sk_mt_M5jeTgriTMxyPUzdVORuwzJK2PBVFqmjB31DRm4L6c9a5L7jsAcxK17V01QxncGv" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}'

Resource Usage

ssh root@<server-ip> "
  echo '=== CPU & Memory ==='
  top -bn1 | head -5
  echo -e '\n=== Disk Usage ==='
  df -h
  echo -e '\n=== Docker Stats ==='
  docker stats --no-stream
"

🔄 SSL Certificate Renewal

SSL certificates are automatically renewed by certbot. To check renewal status:

ssh root@<server-ip> "certbot certificates"

To manually renew:

ssh root@<server-ip> "certbot renew --dry-run"

🛠️ Troubleshooting

Application Won't Start

ssh root@<server-ip> "
  cd /opt/metamcp
  docker compose logs
  docker compose down && docker compose up -d
"

SSL Issues

ssh root@<server-ip> "
  certbot certificates
  nginx -t
  systemctl status nginx
"

DNS Issues

dig mcp.hitsdifferent.ai +short
nslookup mcp.hitsdifferent.ai

📝 Configuration Details

Environment Variables

Ports

  • 80: HTTP (redirects to HTTPS)
  • 443: HTTPS (Nginx)
  • 12008: Application (internal)
  • 9433: PostgreSQL (internal)

Docker Services

  • metamcp: Main application container
  • metamcp-pg: PostgreSQL database container

🤝 Contributing

  1. Make changes to configuration files
  2. Test on a staging server first
  3. Update documentation if needed
  4. Commit and push changes

📞 Support

For issues or questions: