update_proxy_host
Modify an existing Nginx proxy host configuration by updating domain names, forwarding settings, SSL certificates, or security options.
Instructions
Update an existing proxy host
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host_id | Yes | The ID of the proxy host to update | |
| domain_names | No | ||
| forward_scheme | No | ||
| forward_host | No | ||
| forward_port | No | ||
| certificate_id | No | ||
| ssl_forced | No | ||
| block_exploits | No | ||
| advanced_config | No |
Implementation Reference
- src/npm_mcp/client.py:151-158 (handler)The implementation of update_proxy_host in NPMClient handles the API request to update a proxy host.
async def update_proxy_host(self, host_id: int, host: ProxyHost) -> ProxyHost: host_id = _validate_int_id(host_id, "host_id") response = await self._request( "PUT", f"/api/nginx/proxy-hosts/{host_id}", json=host.model_dump(exclude_none=True, exclude={"id", "created_on", "modified_on", "owner_user_id"}), ) return ProxyHost(**response.json()) - src/npm_mcp/server.py:57-74 (registration)The registration of the update_proxy_host tool in the MCP server.
name="update_proxy_host", description="Update an existing proxy host", inputSchema={ "type": "object", "properties": { "host_id": {"type": "integer", "description": "The ID of the proxy host to update"}, "domain_names": {"type": "array", "items": {"type": "string"}}, "forward_scheme": {"type": "string", "enum": ["http", "https"]}, "forward_host": {"type": "string"}, "forward_port": {"type": "integer"}, "certificate_id": {"type": "integer"}, "ssl_forced": {"type": "boolean"}, "block_exploits": {"type": "boolean"}, "advanced_config": {"type": "string"}, }, "required": ["host_id"], }, ), - src/npm_mcp/server.py:368-374 (handler)The call_tool handler logic for update_proxy_host in the MCP server, which fetches the current host, updates it with the provided arguments, and then sends the update request.
elif name == "update_proxy_host": args = dict(arguments) host_id = args.pop("host_id") current = await npm_client.get_proxy_host(host_id) updated_data = current.model_dump() updated_data.update(args) return _model_response(await npm_client.update_proxy_host(host_id, ProxyHost(**updated_data)))