StackWiz MCP Server
Provides DNS record management (create, list, update, delete) with proxy control, automatic retry, and rate limit handling through Cloudflare's API.
Core infrastructure integration for creating, managing, and deploying Docker stacks with full lifecycle control (start, stop, restart, remove) and log access.
Enables setting up Ghost blogging platforms with custom domains, automatic SSL via Traefik, and Cloudflare DNS integration.
Allows deploying Grafana monitoring services as Docker stacks with automatic SSL/TLS and DNS setup.
Integration for automatic SSL/TLS certificate provisioning via Let's Encrypt through Traefik, ensuring secure HTTPS for deployed services.
Specialized support for deploying PocketBase backends as Docker stacks, including automatic configuration and Traefik integration.
Supports creating PostgreSQL databases with automatic backups and deployment as Docker stacks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@StackWiz MCP Server Deploy a Pocketbase backend for my todo app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
StackWiz MCP Server
Transform your Docker infrastructure management with an AI-powered Model Context Protocol (MCP) server. StackWiz MCP enables AI assistants like Claude to create, manage, and deploy containerized services in your infrastructure programmatically.
๐ Documentation
Document | Purpose |
Quick reference for Claude Code agents | |
Canonical documentation - complete tool reference | |
Deep technical architecture & LXC deployment guide | |
Installation guide for standalone deployment |
For AI Agents: Start with CLAUDE.md, refer to docs/AGENT_REFERENCE.md for detailed tool parameters.
For DevOps/Deployment: See docs/TECHNICAL_OVERVIEW.md for architecture details and environment configuration.
Related MCP server: Docker MCP Server
๐ Quick Start
Installation
# Install from Git (recommended)
pip install git+https://gitea.rbnk.uk/admin/stackwiz-mcp.git
# Or from GitHub:
pip install git+https://github.com/rickoslyder/stackwiz-mcp.git
# Or clone and install locally
git clone https://gitea.rbnk.uk/admin/stackwiz-mcp.git
cd stackwiz-mcp
pip install -e .Claude Desktop Integration
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"stackwiz": {
"command": "python",
"args": ["-m", "stackwiz_mcp"],
"env": {
"STACKWIZ_BASE_DIR": "/srv/dockerdata",
"STACKWIZ_LOG_LEVEL": "INFO"
}
}
}
}Basic Usage
Once configured, you can ask Claude to:
"Create a new Grafana monitoring service"
"Deploy a Pocketbase backend for my todo app"
"List all running Docker stacks"
"Create a PostgreSQL database with automatic backups"
"Set up a Ghost blog with custom domain"
๐ฏ Features
Stack Management
Create Stacks: Deploy any Docker container with automatic Traefik integration
Pocketbase Support: Specialized support for Pocketbase backends
List & Monitor: View all stacks with real-time status
Lifecycle Control: Start, stop, restart, and remove stacks
Log Access: Retrieve container logs for debugging
DNS Automation
Cloudflare Integration: Full DNS record management (create, list, update, delete)
Multiple Record Types: A, AAAA, CNAME, TXT, MX support
Smart Defaults: Auto-detect server IP for A records
Proxy Control: Toggle Cloudflare proxy (orange/gray cloud) per record
Rate Limit Handling: Automatic retry with exponential backoff
Zone ID Caching: Efficient API usage with 5-minute cache
Infrastructure Integration
Traefik Ready: Automatic SSL/TLS with Let's Encrypt
Network Management: Proper Docker network configuration
Permission Handling: Secure file permissions (750/640)
Template System: Consistent stack structure
๐ Available Tools
create_stack
Creates a new Docker service stack.
Parameters:
name(required): Stack identifier (lowercase, alphanumeric + hyphens)type: "generic" or "pocketbase"domain: Full domain for the serviceimage: Docker image (required for generic)port: Container port (required for generic)create_dns: Auto-create DNS recordauto_start: Start immediately after creationenvironment: Additional environment variables
list_stacks
Lists all Docker stacks in the infrastructure.
Parameters:
filter: Filter stacks by nameinclude_status: Include container statussort_by: Sort by name, created, or status
manage_stack
Performs operations on existing stacks.
Parameters:
stack_name(required): Target stackaction: start, stop, restart, remove, logsoptions: Additional options (follow_logs, tail_lines)
create_dns_record
Creates DNS records in Cloudflare with automatic retry and rate limit handling.
Parameters:
subdomain(required): Subdomain to createtype: Record type (A, CNAME, MX, TXT)value: Record value (AUTO for server IP)proxied: Enable Cloudflare proxy
list_dns_records
Lists DNS records from Cloudflare.
Parameters:
filter: Filter records by name (partial match)
update_dns_proxy
Toggles Cloudflare proxy for a DNS record.
Parameters:
subdomain(required): Target subdomainenable(required): true for proxied, false for DNS-only
delete_dns_record
Deletes DNS records from Cloudflare.
Parameters:
subdomain(required): Subdomain to delete
validate_stack_config
Validates configuration before creation.
Parameters:
config(required): Stack configuration objectcheck_conflicts: Check for port/domain conflicts
๐๏ธ Resources
The MCP server provides read access to:
Stack Configurations:
stack://list,stack://{name}/composeTemplates:
template://generic,template://pocketbaseInfrastructure Info:
infra://networks,infra://domains
๐ก Prompts
Interactive deployment guides:
deploy-web-app: Step-by-step web application deploymentsetup-database: Database deployment with best practicescreate-api-service: API service with monitoring
๐๏ธ Architecture
stackwiz-mcp/
โโโ stackwiz_mcp/ # Main package
โ โโโ server.py # FastMCP server (preferred)
โ โโโ mcp_server.py # Standard MCP implementation
โ โโโ config.py # Configuration management
โ โโโ tools/ # MCP tool implementations
โ โโโ resources/ # Resource providers
โ โโโ prompts/ # Interactive prompts
โ โโโ models/ # Pydantic models
โ โโโ utils/ # Utilities
โโโ tests/ # Test suite
โโโ docs/ # Documentation
โโโ examples/ # Usage examples๐งช Testing
# Run the test suite
./run_tests.sh
# Manual testing
python test_server.py
# Run specific tests
pytest tests/test_mcp_server.py -v๐ณ Docker Deployment
# Build and run with Docker
docker compose up -d
# View logs
docker compose logs -f
# Stop the server
docker compose downโ๏ธ Configuration
Environment Variables
STACKWIZ_BASE_DIR: Base directory for stacks (default:/srv/dockerdata)STACKWIZ_LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR)STACKWIZ_ENV: Environment (development, production)DOCKER_HOST: Docker daemon socketCF_API_EMAIL: Cloudflare emailCF_DNS_API_TOKEN: Cloudflare API tokenDEFAULT_USER: File owner (default: current user)DEFAULT_GROUP: File group (default: docker)
Configuration File
Create config.json for persistent settings:
{
"docker": {
"network": "traefik_proxy",
"compose_timeout": 30
},
"dns": {
"default_ttl": 300,
"proxied": true
},
"traefik": {
"entrypoint": "websecure",
"certresolver": "cf"
}
}๐ Security
Input Validation: All inputs validated with Pydantic
Command Injection Protection: Safe command execution
Path Traversal Prevention: Restricted to base directory
Secrets Management: Environment variables never logged
Permission Management: Proper Unix permissions
๐ค Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Run the test suite
Submit a pull request
๐ License
MIT License - See LICENSE file for details.
๐ Acknowledgments
Built on the Model Context Protocol specification
Uses FastMCP framework
Inspired by the original stackwiz shell script
๐ Troubleshooting
Server won't start
Check Python version (3.8+ required)
Verify dependencies:
pip install -r requirements.txtCheck permissions on base directory
Tools not working
Ensure Docker daemon is running
Verify user is in docker group
Check
DOCKER_HOSTenvironment variable
DNS creation fails
Verify Cloudflare API credentials (CF_API_TOKEN or CF_DNS_API_TOKEN)
Check domain is managed by Cloudflare
Ensure API token has DNS edit permissions
Rate limits are handled automatically with retries
See logs for detailed error messages
DNS proxy toggle fails
Only A, AAAA, and CNAME records can be proxied
MX and TXT records cannot be proxied (Cloudflare limitation)
Logs location
Server logs:
~/.cache/stackwiz-mcp/logs/Stack logs:
docker compose -f {stack}/docker-compose.yml logs
๐ Support
GitHub Issues: Report bugs and feature requests
Documentation: See
/docsdirectoryExamples: Check
/examplesfor usage patterns
Available Tools
10 toolscreate_dns_recordB
Create a DNS record
Inputs: subdomain (required), type, value, proxied, +1 more. Returns: object
create_stackB
Create a new Docker service stack
Inputs: name (required), port, type, image, +4 more. Returns: object
delete_dns_recordB
Delete a DNS record
Inputs: subdomain (required). Returns: object
health_checkA
Check server health and connectivity
Returns system health status including Docker, DNS, and filesystem checks.
Inputs: no named parameters. Returns: object
list_dns_recordsB
List DNS records
Inputs: filter. Returns: object
list_stacksA
List all existing Docker stacks
Inputs: filter, sort_by, include_status. Returns: object
manage_stackC
Perform operations on existing stacks
Inputs: action (required), stack_name (required), tail_lines, follow_logs. Returns: object
server_infoA
Get server information and capabilities
Returns server version, available tools, and configuration details.
Inputs: no named parameters. Returns: object
update_dns_proxyA
Enable or disable Cloudflare proxy for a DNS record
Inputs: enable (required), subdomain (required). Returns: object
validate_stack_configC
Validate a stack configuration
Inputs: config (required), check_conflicts. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 10 tools
Tools are largely distinct but manage_stack is a generic catch-all that could overlap with create_stack or validate_stack_config. DNS tools and stack tools are clearly separated, and utility tools are distinct.
Most tools follow verb_noun pattern (create_stack, list_dns_records), but health_check and server_info break the pattern by being noun-focused. Also pluralization is inconsistent (list_stacks vs list_dns_records).
10 tools is within the ideal 3-15 range. Each tool serves a clear function in stack management, DNS management, or server introspection, with no obvious bloat.
Stack lifecycle is covered (create, list, manage, validate), but there is no full DNS record update (only proxy toggle), and manage_stack is vague about specific operations like delete. Core workflows are covered but some edge operations are missing.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Hosting for AI agents: your AI client deploys Docker apps to live HTTPS URLs over MCP.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Devopness MCP server for DevOps happiness! Empower AI Agents to deploy apps and infra, to any cloud.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows managing Docker containers through natural language, enabling users to compose, introspect, and debug containers without running commands themselves.3,908 PyPI753GPL 3.0
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to manage Docker containers, images, networks, and volumes through a standardized interface. It supports comprehensive operations like container lifecycle management and image pulling while ensuring correct handling of command and environment variable arrays.1238 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to manage Dokploy infrastructure (Docker, projects, applications, databases, etc.) through natural language, acting as a universal translator between AI and cloud systems.31 npmMIT
- AlicenseBqualityDmaintenanceMCP server for managing Docker containers, images, and Compose services via natural language, with configurable tool permissions and safety annotations.16MIT