Ask Mugi: network flows and firewall rules
The firewall rules for Ask AI (Ask Mugi in the web UI) and for external agents using mugnsoft-mcp.
How to read the tables
- A rule is given in the direction in which the connection is opened: source to destination, outbound on the source, inbound on the destination. A stateful firewall lets the replies through.
- Ports are defaults or reference values. Use the ones in your configuration.
- Mandatory means the feature cannot work without it. Conditional means required only for the case described. Optional means only some questions need it.
- HTTPS between Mugnsoft hosts requires
"HTTPS": "true"inwebserver.json. Without it, these flows are plain HTTP.
Network map
Solid lines are needed for a typical Ask Mugi deployment with a cloud LLM. Dashed lines depend on your setup. In stdio mode, mugnsoft-mcp runs on the agent’s own workstation, so flow E1 starts there.
Users and webserver
| ID | Source | Destination | Protocol | Port | Requirement | Purpose |
|---|---|---|---|---|---|---|
| N1 | User browser | Webserver | TCP, HTTPS | PortWEB, 9090 |
Mandatory | Web UI, /ai/* routes, answer stream |
| N2 | Guest browser | Webserver | TCP, HTTPS | PortWEB, 9090 |
Conditional: guest chat | /chat and its assets |
No browser needs access to the LLM provider. Ask Mugi adds no use of the API port by browsers.
LLM provider
Choose one of the following scenarios, matching the provider set in the panel.
| ID | Source | Destination | Protocol | Port | Requirement |
|---|---|---|---|---|---|
| L1 | Webserver | api.anthropic.com |
TCP, HTTPS | 443 | Conditional: Anthropic, direct |
| L1 | Webserver | Host of your base URL, for example api.openai.com, generativelanguage.googleapis.com, api.mistral.ai |
TCP, HTTPS | 443 | Conditional: other cloud provider, direct |
| L2 | Webserver | Outbound proxy | TCP, HTTP CONNECT |
Proxy port | Conditional: through a proxy |
| L3 | Outbound proxy | Provider host | TCP, HTTPS | 443 | Conditional: through a proxy |
| L4 | Webserver | Local LLM server on another host (Ollama: 11434, vLLM: 8000 by default) | TCP, HTTP or HTTPS | Server port | Conditional: local LLM |
| L5 | Webserver | Local LLM on the same host (localhost) |
Loopback | Server port | No firewall rule, but AIInternalHosts is needed |
| D1 | Webserver (and proxy) | DNS server | UDP and TCP, DNS | 53 | Conditional: when a host name is used |
One LLM flow is mandatory: L1, L2 with L3, L4 or L5. Nothing has to be opened from the provider toward the webserver.
Proxy
Both providers use the proxy environment variables of the webserver service: HTTPS_PROXY, HTTP_PROXY and NO_PROXY. Restart the service after changing them. Connections to localhost never use the proxy. Calls from the webserver to probes and integrators ignore these variables.
HTTPS_PROXY=http://proxy.example.com:3128
NO_PROXY=llm.internal.example.com
With a proxy, the address rules of Local LLM are checked on what the webserver itself resolves for the provider’s host name.
If the proxy inspects TLS, add its certificate authority to the webserver host’s system trust store.
Local LLM
With a local LLM, no internet access is needed and the questions and monitoring data stay on your network.
- Allow the server’s address first. The webserver refuses loopback, private (RFC 1918,
fc00::/7) and shared (100.64.0.0/10) addresses unless the host in the base URL is listed inAIInternalHostsinwebserver.json. Listhostorhost:port, separated by commas, then restart the webserver. This applies to a LLM on the same host too.
{
"AIInternalHosts": "localhost:11434,llm.internal.example.com:11434"
}
- Link-local, cloud metadata, unspecified and multicast addresses are always refused. Redirects are refused: give the server’s final address.
- Enter the base URL in the panel’s settings, for example
http://llm.internal.example.com:11434/v1, and a model that supports tool calling. - Over HTTPS, the certificate must be trusted by the webserver host’s system.
VerifyComponentTLSdoes not apply to LLM calls. - Over HTTP, data and key travel in clear: keep it to the same host or a trusted network.
- Ollama listens on
127.0.0.1:11434by default. To serve another host, setOLLAMA_HOSTon the Ollama server. - Ollama’s default context window is small (4,096 tokens in its FAQ) compared with the tool definitions and results. Raise it with
OLLAMA_CONTEXT_LENGTH.
OLLAMA_HOST=0.0.0.0:11434 OLLAMA_CONTEXT_LENGTH=64000 ollama serve
Webserver and components
These are the platform’s usual flows. The AI tools reuse them and add no new port. A component’s port is the one registered for it in the Webserver (port in its configuration file): check your own values.
| ID | Source | Destination | Protocol | Port | Requirement | Used by |
|---|---|---|---|---|---|---|
| C1 | Webserver | Probes | TCP, HTTPS | Registered, reference 8072 | Mandatory for monitor questions and changes | Most tools |
| C2 | Webserver | Integrators | TCP, HTTPS | Registered, reference 8060 | Optional | Open events, component list, alerting and component tools |
| C3 | Webserver | Sentinel Agents and other registered components | TCP, HTTPS | Registered, reference 8078 | Optional | Component state, Sentinel settings and component tools |
| C4 | Sentinel Agents | Webserver | TCP, HTTPS | PortAPI, 8050 |
Optional | Data read by the Sentinel tools |
| C5 | Probes | Monitored target | Per monitor type | Target port | Conditional: test or run of a monitor | test_monitor, run_monitor |
| C6 | Probes | SNMP device | UDP, SNMP | 161 | Conditional: SNMP devices | test_device, device polling |
| C7 | Probes | Windows host | TCP, WMI (DCOM) | 135 and dynamic ports | Conditional: WMI devices | test_device, device polling |
| C8 | Webserver | Mail server | TCP, SMTP | Configured SMTP port | Conditional: a report sent by e-mail | send_report, oneoff_report |
If a probe cannot be reached, the tool reports it in the conversation. The rest of the answer can still succeed.
"VerifyComponentTLS": "true" is set. See Securing communication.
External agents (MCP)
Needed only for Claude Code, Codex, Mistral Vibe or another MCP client. The built-in Ask Mugi panel uses none of these.
| ID | Source | Destination | Protocol | Port | Requirement | Purpose |
|---|---|---|---|---|---|---|
| E1 | Host running mugnsoft-mcp |
Webserver | TCP, HTTPS | PortAPI, 8050 |
Mandatory for external agents | Login and REST API |
| E2 | Agent workstation | Shared mugnsoft-mcp host |
TCP, HTTPS (MCP streamable HTTP) | MNS_HTTP_ADDR, for example 8765 |
Conditional: shared server | /mcp |
| E3 | Agent | Its LLM provider, or a local LLM | TCP, HTTPS or HTTP | 443 or the local port | Mandatory for external agents | The agent’s own model calls |
In stdio mode, the agent and mugnsoft-mcp share a workstation and no port is opened. The shared server listens on 127.0.0.1 until you set another address, which then requires TLS.
High availability
| ID | Source | Destination | Protocol | Port | Requirement |
|---|---|---|---|---|---|
| H1 | Each cluster node | Other nodes | TCP, cluster channel | HA.Bind, for example 7001 |
Mandatory in a cluster |
A standby forwards requests to the active node over this channel. Give every node that can become active the same LLM access (L1 to L5, proxy variables, DNS) and component access, or Ask Mugi stops working after a failover. A witness serves no requests.
Reverse proxy or load balancer
If one sits in front of the web port:
- do not buffer the
text/event-streamresponses of/ai/chat,/ai/chat/confirmand/chat/send. The webserver sendsX-Accel-Buffering: no; - allow long silences on those requests: a model call or a tool can take minutes without sending an event;
- list the proxy in
TrustedProxiesinwebserver.json, otherwise all guests share one rate limit.
To expose only the guest chat to the internet, publish /chat, /chat/status, /chat/send and the static files under /web/, and keep the other routes internal.
Check the connectivity
From the webserver host, test the LLM address. Any HTTP answer, even 401, shows that the network path and TLS work.
curl -sS -o /dev/null -w "%{http_code}\n" https://api.anthropic.com/v1/models
For an OpenAI-compatible server:
curl -sS -o /dev/null -w "%{http_code}\n" http://llm.internal.example.com:11434/v1/models
For a probe:
curl -sS -k -o /dev/null -w "%{http_code}\n" https://probe.example.com:8072/uptime
curl reads the proxy variables of your shell, not those of the service.
See also
- Ask Mugi: request flow — architecture, sequences, endpoints and authentication
- Claude Code, Codex and Mistral Vibe — set up an external agent
- Security model — platform network flows
- High availability configuration — cluster channel and front door