Skip to content

🤖 MCP Server 🖥

An MCP server that serves custom AGENTS.md files and bash scripts.

This is a Python project designed to serve as an MCP (Multi-Cloud Platform) server. It utilizes FastAPI for the web framework and Uvicorn as the ASGI server. The project also includes an agents-library for managing agent-related rules and prompts.

🛠 Installation

Default Port: 8080

homelab/docker/mcp-server

task up
docker compose up

âš™ Config

homelab/docker/mcp-server/.env

CONTAINER_NAME=mcp-server

# -- age backup --
# AGE_PUBLIC_KEYS=age123456
homelab/docker/mcp-server/compose.yaml
---
services:
  mcp-server:
    container_name: ${CONTAINER_NAME}
    image: ghcr.io/nicholaswilde/mcp-server:0.3.0
    env_file:
      - .env
    ports:
      - '8080:8080'
    volumes:
      - ./agents-library:/app/agents-library
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
    restart: always
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 5s

Traefik

homelab/pve/traefik/conf.d/mcp-server.yaml
---
http:
 #region routers 
  routers:
    mcp-server:
      entryPoints:
        - "websecure"
      rule: "Host(`mcp-server.l.nicholaswilde.io`)"
      middlewares:
        - default-headers@file
        - https-redirectscheme@file
      tls: {}
      service: mcp-server
#endregion
#region services
  services:
    mcp-server:
      loadBalancer:
        servers:
          - url: "http://192.168.2.177:8080"
        passHostHeader: true
#endregion
  middlewares:
    https-redirectscheme:
      redirectScheme:
        scheme: https
        permanent: true
    default-headers:
      headers:
        frameDeny: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

    default-whitelist:
      ipAllowList:
        sourceRange:
        - "10.0.0.0/8"
        - "192.168.0.0/16"
        - "172.16.0.0/12"

    secured:
      chain:
        middlewares:
        - default-whitelist
        - default-headers

Task List

task: Available tasks for this project:
* backup:        Backup the application's volume data.
* decrypt:       Decrypt sensitive configuration files using SOPS.
* default:       List all available tasks.
* encrypt:       Encrypt sensitive configuration files using SOPS.
* export:        Export the task list to `task-list.txt`.
* init:          Initialize the application's environment and configuration files.
* pull:          Pull Docker images for the application.
* restart:       Restart the application's Docker containers.
* status:        Check the status of the application's Docker containers.
* stop:          Stop the application's Docker containers.
* up:            Run Docker Compose in the foreground.
* up-d:          Run Docker Compose in the background.
* update:        Update the application or its running containers.
* upgrade:       Upgrade the application by pulling the latest changes and updating.
* watch:         Watch the application's Docker container logs.

🔗 References