Skip to main content
Glama

Nginx Proxy Manager — MCP Server

MIT License TypeScript Node.js MCP SDK Tools

Manage your Nginx Proxy Manager fleet from any MCP-host AI chat. Create proxy hosts, rotate certificates, flip redirections — without ever opening the admin dashboard.


Architecture

┌──────────────────────┐         ┌─────────────────────────┐         ┌───────────────────┐
│   MCP Host (AI)      │         │   nginxpm-mcp server    │         │ Nginx Proxy Mgr   │
│                      │  stdio  │                         │  HTTP   │                   │
│  "Create a proxy     │◄───────►│  McpServer              │◄───────►│  /api/hosts       │
│   for api.example.com"│        │  ┌───────────────────┐  │        │  /api/certificates│
│                      │         │  │ list-proxy-hosts   │  │        │  /api/tokens      │
│  "Renew cert #3"     │         │  │ create-proxy-host  │  │        │                   │
│                      │         │  │ renew-certificate  │  │        └───────────────────┘
│                      │         │  │ … 19 tools total   │  │
│                      │         │  │     ↓             │  │
│                      │         │  │ [NpmClient×N]     │  │
│                      │         │  └───────────────────┘  │
└──────────────────────┘         └─────────────────────────┘

Each config entry spawns an isolated NpmClient with its own JWT token cache and retry logic.


Related MCP server: npm-mcp


Features

  • 19 tools covering full CRUD + enable/disable for proxy hosts, redirection hosts, and certificates

  • Multi-instance — manage several NPM deployments from one server instance

  • Auto-reauth on 401/403 — transparent re-login without dropping requests

  • Self-signed TLS — works with dev instances using self-signed certificates

  • Zero external deps beyond the MCP SDK, undici, and zod


Installation

# Clone & build
git clone https://github.com/coe-artificial/nginxpm-mcp.git
cd nginxpm-mcp
npm install
npm run build

# Install globally (optional)
npm install -g .

Configuration

Create npm-config.json with one or more NPM instances:

{
  "dgx": {
    "address": "http://10.0.0.10:81",
    "username": "admin@example.com",
    "password": "your-password"
  },
  "production": {
    "address": "https://npm.example.com",
    "username": "admin@example.com",
    "password": "your-password"
  }
}

Tip: This file is gitignored by default — never commit real credentials.

Run the server:

# Linux / macOS
NPMCP_CONFIG=./npm-config.json nginxpm-mcp

# Windows (PowerShell)
$env:NPMCP_CONFIG = (Resolve-Path .\npm-config.json).Path
nginxpm-mcp

# Windows (CMD)
set NPMCP_CONFIG=%cd%\npm-config.json
nginxpm-mcp

Usage with MCP Hosts

Claude Desktop integration

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "nginxpm": {
      "command": "nginxpm-mcp",
      "env": {
        "NPMCP_CONFIG": "C:\\Users\\you\\npm-config.json"
      }
    }
  }
}

Cursor / Windsurf integration

// .cursor/mcp.json
{
  "mcpServers": {
    "nginxpm": {
      "command": "npx",
      "args": ["nginxpm-mcp"],
      "env": {
        "NPMCP_CONFIG": "./npm-config.json"
      }
    }
  }
}

Usage Examples

Example 1 — List all proxy hosts and summarize

User: List all my proxy hosts and tell me which ones are disabled.

AI → calls list-proxy-hosts → gets JSON array
AI → parses response, reports:
  "You have 8 proxy hosts. 2 are disabled:
   - Host #3  (staging.example.com → 10.0.0.5:8080)
   - Host #7  (internal.example.com → 10.0.0.6:3000)"

Example 2 — Create a reverse proxy with Let's Encrypt

User: Set up a reverse proxy for api.internal.com pointing at 192.168.1.50:8443 with HTTPS.

AI → calls create-proxy-host with:
{
  "name": "api.internal.com",
  "domainNames": ["api.internal.com"],
  "forwardScheme": "https",
  "forwardHost": "192.168.1.50",
  "forwardPort": 8443,
  "certificate": null,
  "sslForce": true,
  "hstsEnabled": true
}

AI: "Proxy host created. Force HTTPS is enabled — all HTTP traffic will be redirected."

Example 3 — Bulk enable all disabled redirections

User: I'm decommissioning old services. Enable all disabled redirection hosts.

AI → calls list-redirection-hosts → finds disabled ones
AI → calls enable-redirection-host for each
AI: "Enabled 3 redirection hosts. All are now live."

Example 4 — Rotate a certificate

User: Certificate #5 is about to expire. Renew it.

AI → calls renew-certificate({ instance: "production", id: 5 })
AI: "Certificate renewed successfully. Expiry is now 2027-02-15."

Example 5 — Add a temporary redirect

User: Point blog.example.com to https://newsite.example.com for now.

AI → calls create-redirection-host with:
{
  "name": "blog-redirect",
  "domains": ["blog.example.com"],
  "forwardScheme": "https",
  "forwardDomainName": "newsite.example.com",
  "forwardPort": 443,
  "preserveHost": true,
  "redirectCode": 302
}

AI: "Temporary redirect created (302). Blog visitors will be forwarded to the new site."

Available Tools

Proxy Hosts (7 tools)

Tool

Description

list-proxy-hosts

List all proxy hosts

get-proxy-host

Get proxy host by ID

create-proxy-host

Create a new proxy host

update-proxy-host

Update a proxy host

delete-proxy-host

Delete a proxy host

enable-proxy-host

Enable a proxy host vhost

disable-proxy-host

Disable a proxy host vhost

Certificates (6 tools)

Tool

Description

list-certificates

List all certificates

get-certificate

Get certificate by ID

create-certificate

Create a Let's Encrypt or manual certificate

renew-certificate

Renew a certificate

delete-certificate

Delete a certificate

Redirection Hosts (6 tools)

Tool

Description

list-redirection-hosts

List all redirection hosts

get-redirection-host

Get redirection host by ID

create-redirection-host

Create a new redirection host

update-redirection-host

Update a redirection host

delete-redirection-host

Delete a redirection host

enable-redirection-host

Enable a redirection host vhost

disable-redirection-host

Disable a redirection host vhost


How It Works

  1. Auth — JWT Bearer tokens via POST /api/tokens, cached with proactive 60-second refresh

  2. Retry — 401/403 triggers re-auth + retry; 5xx adds 200ms delay + retry

  3. Self-signed TLS — undici agent with rejectUnauthorized: false for dev environments

  4. Multi-instance — each config entry creates a separate NpmClient with its own token cache


License

MIT © coe-artificial

Available Tools

19 tools
create-certificatecreate-certificateB

Create a new certificate. Let's Encrypt is supported for automatic provisioning. Manual provider requires two-step workflow not exposed here.

Inputs: niceName (required), provider (required), domainNames (required), instanceName (required), +5 more.

create-proxy-hostcreate-proxy-hostC

Create a new proxy host. Domain names, forward host/port, and scheme are required. SSL, HSTS, caching, and websocket options available.

Inputs: domainNames (required), forwardHost (required), forwardPort (required), instanceName (required), +14 more.

create-redirection-hostcreate-redirection-hostC

Create a new redirection host. Forwards matched domains to a target URL with configurable HTTP status code.

Inputs: domainNames (required), instanceName (required), forwardScheme (required), forwardHttpCode (required), +10 more.

delete-certificatedelete-certificateB

Delete a certificate by ID. Only certificates not referenced by proxy hosts can be deleted.

Inputs: id (required), instanceName (required).

delete-proxy-hostdelete-proxy-hostC

Delete a proxy host by ID. Removes the Nginx vhost configuration.

Inputs: id (required), instanceName (required).

delete-redirection-hostdelete-redirection-hostC

Delete a redirection host by ID.

Inputs: id (required), instanceName (required).

disable-proxy-hostdisable-proxy-hostB

Disable a proxy host vhost in Nginx (returns 502 for matched domains).

Inputs: id (required), instanceName (required).

disable-redirection-hostdisable-redirection-hostB

Disable a redirection host vhost in Nginx (returns 502 for matched domains).

Inputs: id (required), instanceName (required).

enable-proxy-hostenable-proxy-hostC

Enable a disabled proxy host vhost in Nginx.

Inputs: id (required), instanceName (required).

enable-redirection-hostenable-redirection-hostC

Enable a disabled redirection host vhost in Nginx.

Inputs: id (required), instanceName (required).

get-certificateget-certificateA

Get a single certificate by ID. Use list-certificates to find the ID.

Inputs: id (required), instanceName (required).

get-proxy-hostget-proxy-hostA

Get a single proxy host by ID. Use list-proxy-hosts to find the ID.

Inputs: id (required), instanceName (required).

get-redirection-hostget-redirection-hostB

Get a single redirection host by ID. Use list-redirection-hosts to find the ID.

Inputs: id (required), instanceName (required).

list-certificateslist-certificatesB

List all certificates on an NPM instance. Includes Let's Encrypt and manual certificates.

Inputs: instanceName (required).

list-proxy-hostslist-proxy-hostsB

List all proxy hosts on an NPM instance. Returns full host details including domains, forwarding config, SSL, and HSTS settings.

Inputs: instanceName (required).

list-redirection-hostslist-redirection-hostsC

List all redirection hosts on an NPM instance. Redirection hosts forward domains to another URL.

Inputs: instanceName (required).

renew-certificaterenew-certificateC

Renew a Let's Encrypt certificate. Returns the updated certificate details.

Inputs: id (required), instanceName (required).

update-proxy-hostupdate-proxy-hostC

Update an existing proxy host. Only provided fields are updated. Omit read-only fields (id, created_on, etc.).

Inputs: id (required), instanceName (required), enabled, locations, +15 more.

update-redirection-hostupdate-redirection-hostC

Update an existing redirection host. Only provided fields are updated.

Inputs: id (required), instanceName (required), enabled, sslForced, +11 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 19 tools

    Disambiguation4/5

    Each tool pairs a distinct verb with one of three clearly named resources (proxy-host, certificate, redirection-host), so selection is mostly unambiguous. The only soft overlap is enable/disable versus update, since an agent could plausibly toggle a host's state through update-proxy-host instead of the dedicated enable/disable tools.

    Naming Consistency5/5

    Every tool follows the same kebab-case verb_noun convention (list-proxy-hosts, get-certificate, create-redirection-host, disable-proxy-host). Resource names are used identically across all verbs, making the naming fully predictable.

    Tool Count4/5

    19 tools is on the heavier side, but the count is justified: roughly six to seven lifecycle operations each across three resource types (proxy hosts, certificates, redirection hosts). No tool appears redundant or filler.

    Completeness3/5

    Proxy hosts and redirection hosts have complete CRUD plus enable/disable, but certificates lack an update operation and the description explicitly notes the manual-provider two-step workflow is not exposed. Broader NPM features (stream/TCP hosts, access lists, dead/404 hosts) are absent, leaving notable gaps for a full Nginx Proxy Manager surface.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables management of Nginx Proxy Manager instances for configuring proxy hosts, requesting Let's Encrypt SSL certificates, and managing access lists. It allows users to control their web proxy infrastructure through natural language commands in MCP-compatible environments.
      50
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage Nginx Proxy Manager instances through natural language, covering 28 tools for proxy hosts, certificates, streams, and more.
      MIT