nginx-proxy-manager-mcp
v1.1.3
Published
MCP server for Nginx Proxy Manager API
Maintainers
Readme
Nginx Proxy Manager MCP Server
An MCP (Model Context Protocol) server that provides tools for interacting with the Nginx Proxy Manager API.
Features
- Full API coverage for Nginx Proxy Manager v2.12.3
- Proxy host management (create, update, delete, enable/disable)
- SSL certificate management (Let's Encrypt and custom certificates)
- Access list management
- User management
- Stream management
- Settings and reports
Installation
npm install nginx-proxy-manager-mcpConfiguration
Set the following environment variables:
NPM_BASE_URL: The base URL of your Nginx Proxy Manager API (default:http://localhost:81/api)
Usage with Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"nginx-proxy-manager": {
"command": "npx",
"args": ["nginx-proxy-manager-mcp"],
"env": {
"NPM_BASE_URL": "http://192.168.2.4:81/api"
}
}
}
}Quick Start
Authenticate with NPM:
Use npm_authenticate with your NPM credentials: - identity: [email protected] - secret: your-passwordList existing proxy hosts:
Use npm_list_proxy_hosts to see all configured hostsCreate a test proxy:
Use npm_create_proxy_host with: - domain_names: ["test.example.com"] - forward_scheme: "http" - forward_host: "127.0.0.1" - forward_port: 80 - block_exploits: true
Testing the MCP Server
To test the nginx-proxy-manager-mcp server:
- Enable stdout logging (already configured in the latest version)
- Authenticate: The server will log the authentication token and status
- Create a test proxy: Use a test domain pointing to localhost
- Verify: Check the proxy responds with curl or browser
Example test command:
curl -I http://test.example.comAvailable Tools
Authentication
npm_authenticate- Authenticate with NPM using username/email and password
Proxy Hosts
npm_list_proxy_hosts- List all proxy hostsnpm_get_proxy_host- Get a specific proxy hostnpm_create_proxy_host- Create a new proxy hostnpm_update_proxy_host- Update an existing proxy hostnpm_delete_proxy_host- Delete a proxy hostnpm_enable_proxy_host- Enable a proxy hostnpm_disable_proxy_host- Disable a proxy host
Certificates
npm_list_certificates- List all certificatesnpm_create_certificate- Create a new certificate (Let's Encrypt or custom)npm_renew_certificate- Renew a Let's Encrypt certificatenpm_delete_certificate- Delete a certificate
Access Lists
npm_list_access_lists- List all access listsnpm_create_access_list- Create a new access listnpm_update_access_list- Update an access listnpm_delete_access_list- Delete an access list
Reports
npm_get_hosts_report- Get statistics on all host types
Redirection Hosts
npm_list_redirection_hosts- List all redirection hostsnpm_get_redirection_host- Get a specific redirection hostnpm_create_redirection_host- Create a new redirection hostnpm_update_redirection_host- Update an existing redirection hostnpm_delete_redirection_host- Delete a redirection hostnpm_enable_redirection_host- Enable a redirection hostnpm_disable_redirection_host- Disable a redirection host
404 Hosts
npm_list_dead_hosts- List all 404 hostsnpm_get_dead_host- Get a specific 404 hostnpm_create_dead_host- Create a new 404 hostnpm_update_dead_host- Update an existing 404 hostnpm_delete_dead_host- Delete a 404 hostnpm_enable_dead_host- Enable a 404 hostnpm_disable_dead_host- Disable a 404 host
Audit Log
npm_get_audit_log- Get the audit log
Example Usage
Create a Proxy Host
// Tool: npm_create_proxy_host
{
"domain_names": ["app.example.com"],
"forward_scheme": "http",
"forward_host": "192.168.1.100",
"forward_port": 8080,
"ssl_forced": true,
"certificate_id": "new",
"http2_support": true,
"block_exploits": true
}Create a Let's Encrypt Certificate
// Tool: npm_create_certificate
{
"provider": "letsencrypt",
"domain_names": ["app.example.com"],
"meta": {
"letsencrypt_email": "[email protected]",
"letsencrypt_agree": true
}
}Create an Access List
// Tool: npm_create_access_list
{
"name": "Admin Access",
"satisfy_any": false,
"pass_auth": true,
"items": [
{
"username": "admin",
"password": "securepassword"
}
],
"clients": [
{
"address": "192.168.1.0/24",
"directive": "allow"
}
]
}Create a Redirection Host
// Tool: npm_create_redirection_host
{
"domain_names": ["old.example.com"],
"forward_http_code": 301,
"forward_scheme": "https",
"forward_domain_name": "new.example.com",
"preserve_path": true,
"ssl_forced": true,
"block_exploits": true
}Create a 404 Host
// Tool: npm_create_dead_host
{
"domain_names": ["*.example.com"],
"ssl_forced": false,
"certificate_id": 0
}Development
# Clone the repository
git clone <repository-url>
cd nginx-proxy-manager-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
# Run tests
npm test
# Run integration tests with Docker
npm run test:integrationDebugging
The server includes stdout logging that shows:
- Initialization with base URL
- Authentication attempts and tokens
- Tool calls and API requests
- Response counts and status
This helps debug connection issues and verify the MCP server is working correctly.
API Coverage
This MCP server covers the following Nginx Proxy Manager API endpoints:
- ✅ Proxy Hosts - Full CRUD operations plus enable/disable
- ✅ SSL Certificates - Create, renew, and delete (Let's Encrypt and custom)
- ✅ Access Lists - Full CRUD operations
- ✅ Redirection Hosts - Full CRUD operations plus enable/disable
- ✅ 404 Hosts - Full CRUD operations plus enable/disable
- ✅ Audit Log - Read audit log entries
- ✅ Reports - Host statistics
- ✅ Users (partial - main operations)
- ✅ Streams (partial - main operations)
Security Notes
- Always use HTTPS for your NPM API endpoint in production
- Store credentials securely
- The MCP server requires authentication before performing any operations
- API tokens expire and need to be refreshed
License
MIT
