mcpField
πŸš€
πŸš€ MCP Server with Docker, Redis, and TimescaleDB

πŸš€ MCP Server with Docker, Redis, and TimescaleDB

Local
github.com/chuckwilliams37Cloud & Infra5Updated 84w ago

About πŸš€ MCP Server with Docker, Redis, and TimescaleDB

This repository packages an MCP server with Docker Compose, Redis, and TimescaleDB, using FastAPI. It is intended for deploying and maintaining an MCP service with setup scripts and optional systemd restart configuration.

Key features

  1. 01FastAPI web framework
  2. 02Redis caching
  3. 03TimescaleDB integration
  4. 04Docker Compose orchestration
  5. 05Environment-based configuration
  6. 06Systemd auto-start setup

Use cases

  1. 01Deploy the service on a fresh Ubuntu VM
  2. 02Run the server and databases with Docker Compose
  3. 03Configure containers through a `.env` file
  4. 04Restart containers automatically after reboot

MCP support

The project sets up an MCP server; the README does not specify the tools or resources it exposes.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json Β· Universal config
{
"mcpServers": {
"docker-chuckwilliams37": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"compose"
]
}
}
}
Run commanddocker run -i --rm compose

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocicompose

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

πŸš€ MCP Server with Docker, Redis, and TimescaleDB

This repository sets up a Model Context Protocol (MCP) Server using Docker, integrating Redis and TimescaleDB for efficient data management.

πŸ› οΈ Features

  • FastAPI: Serves as the web framework for the MCP server.
  • Redis: Provides caching mechanisms.
  • TimescaleDB: A time-series database built on PostgreSQL.
  • Docker Compose: Orchestrates multi-container Docker applications.
  • Environment Variables: Configurable via .env file.
  • Systemd Service: Ensures the server auto-starts on reboot.

πŸ“‹ Prerequisites

  • Docker and Docker Compose installed on your system.
  • Git for version control.
  • Zsh with Oh-My-Zsh (optional, for enhanced shell experience).

πŸ“‚ Repository Structure

mcp-server-docker/
β”œβ”€β”€ app/
β”‚   └── app.py
β”œβ”€β”€ .env.example
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ bootstrap-mcp.sh
β”‚   β”œβ”€β”€ full-bootstrap-mcp.sh
β”‚   β”œβ”€β”€ init-repo.sh
β”‚   β”œβ”€β”€ push-repo.sh
β”‚   └── setup-mcpserver.sh
└── README.md

πŸš€ Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/chuckwilliams37/mcp-server-docker.git
    cd mcp-server-docker
    
  2. Configure Environment Variables:

    cp .env.example .env
    

    Modify .env as needed.

  3. Build and Start the Containers:

    docker compose build
    docker compose up -d
    
  4. Access the MCP Server:

    http://localhost:8080
    

πŸ”„ Auto-Restart on Reboot

Create a systemd service to keep your app alive:

sudo nano /etc/systemd/system/mcp-docker.service

Paste:

[Unit]
Description=MCP Docker Compose App
Requires=docker.service
After=docker.service

[Service]
WorkingDirectory=/home/youruser/mcp-server-docker
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
Restart=always
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

Enable it:

sudo systemctl daemon-reload
sudo systemctl enable mcp-docker
sudo systemctl start mcp-docker

πŸ§ͺ Scripts

The scripts/ directory contains utility scripts to automate infrastructure tasks.


πŸ› οΈ scripts/full-bootstrap-mcp.sh

πŸ’‘ Use this on a fresh Ubuntu VM to fully prepare it for MCP deployment. It:

  • Installs system dependencies (Docker, Git, Zsh, UFW, Fail2Ban, etc.)
  • Sets up oh-my-zsh with the jonathan theme
  • Configures Remote Desktop with XFCE + XRDP
  • Clones the MCP repo
  • Builds and launches the app with docker compose
  • Adds a systemd service to relaunch containers on reboot
chmod +x scripts/full-bootstrap-mcp.sh
./scripts/full-bootstrap-mcp.sh

πŸ“œ scripts/init-repo.sh

Initializes a new local Git repository and commits the current directory:

chmod +x scripts/init-repo.sh
./scripts/init-repo.sh

πŸ“€ scripts/push-repo.sh

Pushes your local repo to a remote (update URL first):

chmod +x scripts/push-repo.sh
./scripts/push-repo.sh

🧠 scripts/setup-mcpserver.sh

Configures your local SSH environment to access a remote MCP server:

  • Pushes your public key
  • Adds an SSH alias
  • Prints a sample A-record
chmod +x scripts/setup-mcpserver.sh
./scripts/setup-mcpserver.sh

⚠️ Edit placeholder values (e.g., IPs, usernames, repo URLs) before executing.


🀝 Contributions

Feel free to fork this repository, submit issues, or create pull requests.

πŸ“„ License

This project is licensed under the MIT License.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.