npg-mcp
MCP server for NginxProxyGuard that manages proxy hosts, certificates, SSL, security rules, and nginx configuration through 108+ tools.
README
NPG MCP Server
MCP server for NginxProxyGuard (NPG) — manage proxy hosts, certificates, SSL, security rules, and nginx configuration through MCP tools.
Features
108+ MCP tools across all NPG API categories:
| Category | Tools |
|---|---|
| Auth | login, logout, me |
| Dashboard | overview, health, geoip stats |
| Proxy Hosts | list, get, create, update, delete, test, clone, sync, regenerate |
| Security (per-host) | rate limit, bot filter, security headers (+presets), upstream, URI block, fail2ban, challenge/CAPTCHA |
| Geo Restriction | get, create, update, delete (per-host) |
| Certificates | list, get, create, delete, renew |
| Redirect Hosts | list, get, create, update, delete |
| Access Lists | list, get, create, update, delete |
| DNS Providers | list, get, create, update, delete, test |
| Cloud Providers | list, get, create, update, delete |
| WAF | list rules, get hosts/config, disable rules |
| Exploit Rules | list, get, create, update, delete, toggle |
| Settings | global settings, system settings, nginx sync |
| Logs | access logs, audit logs, system logs, stats |
| Backups | list, get, create, delete, restore |
| API Tokens | list, get, create, update, revoke, delete |
Quick Start
Prerequisites
- A running NginxProxyGuard (NPG) instance with API access
- Docker and Docker Compose (for containerized deployment)
- Python 3.11+ (for local development)
Local Development
git clone https://github.com/four2mis/npg-mcp.git
cd npg-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Create a .env file (copy from .env.example):
cp .env.example .env
Run in stdio mode:
python3 -m npg_mcp.main
Docker Deployment (pre-built)
Pull the image from GitHub Container Registry:
docker pull ghcr.io/four2mis/npg-mcp:latest
Create a .env file from the template:
cp .env.example .env
# then edit .env with your NPG credentials
Or run with Docker Compose using the included docker-compose.yml:
# Pull & run (uses pre-built image)
docker compose up -d
# Or build from source
docker compose up -d --build
The included docker-compose.yml:
services:
npg-mcp:
image: ghcr.io/four2mis/npg-mcp:latest
# build: . # uncomment to build from source instead
container_name: npg-mcp
restart: unless-stopped
networks:
- npg-network
environment:
- NPG_BASE_URL=http://npg-api:8080
- NPG_USERNAME=${NPG_USERNAME}
- NPG_PASSWORD=${NPG_PASSWORD}
- MCP_PORT=8081
ports:
- "8081:8081"
networks:
npg-network:
external: true
Hermes MCP Config
mcp_servers:
npg-mcp:
url: http://<host>:8081/mcp
connect_timeout: 30
Authentication
The server auto-authenticates on first use using NPG_USERNAME and NPG_PASSWORD. No manual token management needed — every tool call automatically refreshes auth.
Alternatively, call npg_auth_login directly for explicit authentication.
Environment Variables
| Variable | Default | Description |
|---|---|---|
NPG_BASE_URL |
http://npg-api:8080 |
NPG API base URL |
NPG_USERNAME |
— | NPG login username (required) |
NPG_PASSWORD |
— | NPG login password (required) |
MCP_PORT |
8081 |
MCP server listening port |
Project Structure
npg_mcp/
main.py # All 108+ MCP tools
client.py # HTTP client wrapper with auto-auth
__init__.py
Dockerfile # Multi-stage Docker build
docker-compose.yml
pyproject.toml # Dependencies: mcp>=1.0, httpx>=0.27
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.