Sophos XGS MCP Server
This server provides an MCP interface to Sophos XGS firewalls, offering read-only access to configuration (60+ tools) with optional write capabilities when SOPHOS_ENABLE_WRITE=1 is set, supporting multiple firewall profiles with runtime switching.
Firewall & Network Objects: List, get, and search firewall rules and rule groups; IP/FQDN/MAC hosts and host groups.
Services, Zones & Interfaces: Service definitions and groups; zones, interfaces, VLANs, aliases, LAG interfaces.
NAT & Routing: NAT rules (DNAT, SNAT, MASQ, etc.), static routes, SD-WAN policy routes/profiles, gateway hosts/configurations.
VPN: SSL VPN policies and IPsec VPN connections.
Security: IPS policies, web filter policies, URL groups, web exceptions, SSL/TLS inspection rules, engine settings, decryption profiles.
Users & Administration: Users, admin profiles, admin settings, authentication, user activity, local service ACLs, schedules, access time/surfing quota/data transfer policies.
DHCP & DNS: DHCP servers, DNS forwarders, request routes, host entries.
System & Monitoring: Backup/restore (including backup configuration), time/NTP, reports retention, syslog servers, notifications, SNMPv3 users, PIM-SM, captive portal.
Email & IPv6: SMTP email policies; IPv6 router advertisements.
Advanced Queries: raw_api_query for any entity with optional filters; pattern‑based searches.
Write Operations (Opt‑in): Create, update, delete, and preview changes (XML + field‑level diff). Read‑modify‑write updates fetch current state, merge changes, and send the complete definition, preventing partial updates and unintended data loss.
Security: Redacts sensitive data (passwords), protects against XML injection, uses credential isolation, and sanitizes error messages.
Multi‑firewall: Configure multiple profiles and switch at runtime.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Sophos XGS MCP Server List all firewall rules"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Sophos XGS MCP Server
A Model Context Protocol (MCP) server for the Sophos XGS Firewall XML API. Gives AI assistants like Claude visibility into your firewall configuration, and — only when you explicitly enable it — the ability to change it.
Read-only by default. The write tools are not registered unless
SOPHOS_ENABLE_WRITE=1 is set. Without it this server cannot modify the appliance.
Features
60+ read tools covering firewall rules, NAT, VPN, web filtering, network config, routing, DHCP, DNS, IPS, SSL/TLS inspection, and admin settings
Opt-in write tools — create, update, delete and preview any entity
Read-modify-write updates — updates never send a bare delta (see below)
Secret redaction — passwords, hashes and pre-shared keys never reach the client
XML injection protection — tag validation and escaping on every value; no tool accepts raw XML
Credential isolation — credentials come from protected config files
Scoped TLS handling — the self-signed cert bypass is per-request, not global
Related MCP server: Cisco FMC MCP Server
Tools
Category | Tools |
Profiles |
|
Firewall |
|
Network Objects |
|
Services |
|
Zones & Interfaces |
|
NAT |
|
VPN |
|
Web Filtering |
|
SSL/TLS Inspection |
|
IPS |
|
Routing & SD-WAN |
|
DHCP & DNS |
|
Users & Admin |
|
System |
|
| |
Access Control |
|
IPv6 |
|
Advanced |
|
Write (opt-in) |
|
Appliance quirks these tools cannot hide
list_schedulesdoes not return the SFOS built-ins.All The Timeis missing from the result and from an exact-name filter, yet it is the most-used schedule in a typical ruleset. Absence from this list is not evidence that a schedule does not exist — check the rules that reference it.Some entity names are plural where the object is singular. Service definitions live under
Services; aGetonServicefails with529 Input request module is Invalid. That code means unknown entity, not no such object — ifraw_api_queryreturns it, try the other spelling before concluding the object is gone.
Prerequisites
Node.js 18+
Sophos XGS Firewall with the XML API enabled (port 4444 by default)
An API admin account. For read-only use, a restricted profile is strongly recommended; see Write access.
Enabling the Sophos XML API
Log into your Sophos XGS web admin
Go to Backup & firmware > API
Enable the API and allow access from the host running the MCP server
Setup
1. Install
git clone https://github.com/Leon69924/sophos-xgs-mcp.git
cd sophos-xgs-mcp
pnpm install
pnpm build2. Configure credentials
mkdir -p ~/.config/sophos-xgs
chmod 700 ~/.config/sophos-xgsCreate ~/.config/sophos-xgs/config.json with one profile per firewall.
activeProfile selects which firewall the tools target; switch at runtime with the
switch_profile tool (the switch is persisted to this file):
{
"activeProfile": "main",
"profiles": {
"main": {
"host": "your-sophos-hostname-or-ip",
"port": "4444",
"username": "your-api-user",
"description": "optional free-text note"
}
}
}Create ~/.config/sophos-xgs/credentials-<profile> with just the password, one file
per profile:
echo -n "your-password" > ~/.config/sophos-xgs/credentials-main
chmod 600 ~/.config/sophos-xgs/config.json ~/.config/sophos-xgs/credentials-mainAlternatively, use environment variables — they override the config file entirely (profile switching is disabled while they are set):
export SOPHOS_HOST=your-sophos-hostname-or-ip
export SOPHOS_PORT=4444
export SOPHOS_USERNAME=your-api-user
export SOPHOS_PASSWORD=your-password3. Add to your MCP client
For Claude Code, add to ~/.mcp.json:
{
"mcpServers": {
"sophos-xgs": {
"type": "stdio",
"command": "node",
"args": ["/path/to/sophos-xgs-mcp/dist/index.js"]
}
}
}Write access
Write tools are registered only when SOPHOS_ENABLE_WRITE=1 is present in the
server's environment:
{
"mcpServers": {
"sophos-xgs": {
"type": "stdio",
"command": "node",
"args": ["/path/to/sophos-xgs-mcp/dist/index.js"],
"env": { "SOPHOS_ENABLE_WRITE": "1" }
}
}
}Back this with a restricted API user. The env flag governs what this server
offers; it does not limit what the credentials may do. Sophos authenticates the API
with ordinary administrator accounts, and their rights come from the assigned
administration profile, where every module can be set to None, Read-Only or
Read-Write. Use a read-only profile for read-only deployments, and give a write
deployment only the modules it actually needs. That boundary holds regardless of
bugs in this server.
Updates are read-modify-write
Set operation="update" replaces the entity definition on the appliance. Fields
omitted from the request fall back to defaults — they do not stay unchanged. An update
meant to flip one flag can silently empty a firewall rule's source and destination
networks.
update_entity therefore always fetches the current object, merges your fields onto
it, and sends the complete definition. It aborts rather than continuing if:
the current state cannot be loaded, or the name does not exist
more than one object matches the identifier
the object that came back does not carry the field it was addressed by (see below)
any field present before the update would be missing from what is about to be sent
after the write, a field changed that was not part of your update
That third condition exists because a filtered Get does not always answer "no such
object" by returning nothing. Four entities on an XGS 2100 — SSLVPNPolicy,
VPNIPSecConnection, AdminSettings, GatewayConfiguration — answer a Name filter
with the element and nothing inside it, because they hold their contents in one record
with no top-level Name to filter on. SSLVPNPolicy filtered by name returns literally
[{}].
An empty result is not null, so the "does not exist" check passes; merging onto it
yields little more than your delta; and the field-loss check has nothing to compare,
because the fields were never there. What would reach the appliance is a partial
update — against an API that replaces what it updates. For SSLVPNPolicy that is every
tunnel policy on the box reduced to a name.
create_entity aborts if the name already exists, delete_entity fetches the object
first so you can see what disappears, and preview_write shows the exact XML and
field-level diff without sending anything.
To clear a field on purpose, pass null. Omitting it means "leave unchanged".
Confirming every write
This server does not prompt — MCP gives it no mechanism to. In Claude Code you can get
a confirmation per write with a PreToolUse hook matching mcp__sophos-xgs__.* that
returns permissionDecision: "ask" for the write tools. ask outranks the permission
allowlist, so it keeps asking even after "don't ask again".
Two things such a guard should do, both learned the hard way:
Name the target appliance in the dialog.
switch_profilepersists across sessions, so without the hostname a change gets confirmed for one firewall and applied to another.Allowlist the read tools rather than denylisting the write tools. A tool added to a later version then lands on the safe side by default.
The design, including the guard's decision matrix, is written up in
docs/superpowers/specs/2026-08-04-write-support-design.md.
Security
Read-only by default — write tools are absent without
SOPHOS_ENABLE_WRITE=1Secrets are redacted —
Password,PasswordHash,PreSharedKeyand similar fields are masked before results leave the server, and writing a redaction placeholder back to the appliance is refusedNo raw XML from callers — tag names are validated against
^[A-Za-z][A-Za-z0-9_]*$and every value is escapedNo hardcoded credentials — loaded from
~/.config/sophos-xgs/or env varsError sanitization — credentials are stripped from error messages
TLS — all connections use HTTPS; the self-signed cert bypass is scoped to the Sophos connection only
Development
pnpm build # tsc
pnpm test # node --test
pnpm dev # run from sourceLicense
AGPL-3.0-only — see LICENSE
Available Tools
63 toolsget_admin_authenA
Get admin authentication settings
Inputs: no named parameters.
get_admin_settingsA
Get admin settings (hostname, web admin, login security, password complexity)
Inputs: no named parameters.
get_backup_configC
Get backup configuration settings
Inputs: no named parameters.
get_backup_restore_settingsA
Get scheduled backup configuration (frequency, destination)
Inputs: no named parameters.
get_captive_portalB
Get default captive portal template and settings
Inputs: no named parameters.
get_firewall_ruleA
Get a specific firewall rule by name
Inputs: name (required).
get_interfaceB
Get a specific network interface by name
Inputs: name (required).
get_ip_hostB
Get a specific IP host by name
Inputs: name (required).
get_pim_settingsA
Get PIM-SM dynamic multicast routing settings
Inputs: no named parameters.
get_reports_retentionB
Get reports data retention settings
Inputs: no named parameters.
get_serviceA
Get a specific service definition by name
Inputs: name (required).
get_ssl_tls_inspection_settingsA
Get SSL/TLS inspection engine settings (CA, TLS versions)
Inputs: no named parameters.
get_time_settingsA
Get timezone and NTP server settings
Inputs: no named parameters.
get_user_activityC
Get user activity/session information
Inputs: no named parameters.
get_zoneA
Get a specific zone by name
Inputs: name (required).
list_access_time_policiesA
List access time policies (internet access time restrictions)
Inputs: no named parameters.
list_acl_rulesB
List local service ACL rules (device access control)
Inputs: no named parameters.
list_admin_profilesC
List administrator profiles and their permissions
Inputs: no named parameters.
list_data_transfer_policiesB
List data transfer policies (bandwidth quotas)
Inputs: no named parameters.
list_decryption_profilesA
List decryption profiles (cipher settings, certificate validation)
Inputs: no named parameters.
list_dhcp_serversA
List DHCP server scopes (IP ranges, DNS, lease times, options)
Inputs: no named parameters.
list_dns_forwardersA
List DNS forwarder configurations
Inputs: no named parameters.
list_dns_host_entriesB
List DNS host entries (local DNS records)
Inputs: no named parameters.
list_dns_request_routesB
List DNS request routes (conditional forwarding)
Inputs: no named parameters.
list_firewall_rule_groupsB
List firewall rule groups
Inputs: no named parameters.
list_firewall_rulesA
List all firewall rules with zones, actions, and status
Inputs: no named parameters.
list_fqdn_host_groupsA
List FQDN host groups
Inputs: no named parameters.
list_fqdn_hostsB
List FQDN (domain name) host objects
Inputs: no named parameters.
list_gateway_configurationsA
List WAN gateway configurations (failover, health checks)
Inputs: no named parameters.
list_gateway_hostsA
List WAN gateway hosts (interfaces, health check, monitoring)
Inputs: no named parameters.
list_interface_aliasesA
List interface aliases (additional IPs on interfaces)
Inputs: no named parameters.
list_interfacesA
List network interfaces and their configurations
Inputs: no named parameters.
list_ip_host_groupsB
List IP host groups
Inputs: no named parameters.
list_ip_hostsA
List all IP host objects (addresses, networks, ranges)
Inputs: no named parameters.
list_ips_policiesB
List Intrusion Prevention System (IPS) policies
Inputs: no named parameters.
list_lag_interfacesB
List link aggregation group (LAG) interfaces
Inputs: no named parameters.
list_local_service_aclA
List local service ACL rules (device access from WAN/zones)
Inputs: no named parameters.
list_mac_hostsB
List MAC address host objects
Inputs: no named parameters.
list_nat_rulesA
List NAT rules (DNAT, SNAT, MASQ, loopback, reflexive)
Inputs: no named parameters.
list_notificationsB
List notification configurations
Inputs: no named parameters.
list_router_advertisementsA
List IPv6 router advertisement servers
Inputs: no named parameters.
list_schedulesA
List time schedule profiles
Inputs: no named parameters.
list_sdwan_policy_routesB
List SD-WAN policy routes (source/destination network mappings, profiles)
Inputs: no named parameters.
list_sdwan_profilesA
List SD-WAN profiles (gateway preferences, health checks, SLA settings)
Inputs: no named parameters.
list_service_groupsD
List service groups
Inputs: no named parameters.
list_servicesB
List service definitions (ports and protocols)
Inputs: no named parameters.
list_smtp_policiesA
List SMTP email policies per domain (spam protection, malware scanning, file type filters, routing)
Inputs: no named parameters.
list_snmpv3_usersA
List SNMPv3 user configurations
Inputs: no named parameters.
list_ssl_tls_inspection_rulesB
List SSL/TLS inspection rules (decrypt/do not decrypt actions)
Inputs: no named parameters.
list_sslvpn_policiesA
List SSL VPN tunnel policies (members, permitted networks, gateway settings)
Inputs: no named parameters.
list_static_routesB
List static/unicast routes
Inputs: no named parameters.
list_surfing_quota_policiesB
List surfing quota policies (time-based internet quotas)
Inputs: no named parameters.
list_syslog_serversC
List configured syslog servers
Inputs: no named parameters.
list_url_groupsB
List URL groups used in web filtering
Inputs: no named parameters.
list_usersB
List user accounts
Inputs: no named parameters.
list_vlansC
List VLAN configurations
Inputs: no named parameters.
list_vpn_ipsec_connectionsA
List IPsec VPN connections (site-to-site, host-to-host, tunnel interfaces, status)
Inputs: no named parameters.
list_web_filter_exceptionsA
List web filter exceptions (URL regex, scan bypass rules)
Inputs: no named parameters.
list_web_filter_policiesC
List web filter policies
Inputs: no named parameters.
list_zonesA
List network zones and their configurations
Inputs: no named parameters.
raw_api_queryB
Execute a raw API GET query for any entity (advanced usage)
Inputs: entity (required), filter_key, filter_criteria.
search_firewall_rulesB
Search firewall rules by name pattern (using 'like' operator)
Inputs: pattern (required).
search_ip_hostsA
Search IP hosts by name pattern (using 'like' operator)
Inputs: pattern (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 63 tools
Most tools have distinct purposes, but list_acl_rules and list_local_service_acl overlap, both describing local service ACL rules, which could cause confusion.
All tools follow a consistent verb_noun pattern (e.g., list, get, search), with no mixed conventions.
63 tools is excessive for a single server, even for a comprehensive firewall system, making it difficult to navigate.
The server only provides read operations (list/get/search). The lack of create, update, or delete tools is a significant gap for any management purpose.
Maintenance
Related MCP Connectors
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
2,000+ MCP servers read at source level. Know what one does before you connect. Free, no key.
Zero-log MCP server with 49 tools for AI guardrails, secret scanning, MCP linting & EU compliance.
491Microsoft Ads MCP server: 11 tools for search, PMax, Google Ads imports. Read-only by default.
Related MCP Servers
- AlicenseAqualityBmaintenanceA secure MCP server for managing OPNsense firewalls through AI assistants. Provides 81 tools across system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics, and security domains.81317 PyPI26MIT
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for Cisco Firepower Management Center (FMC) 7.4.x, allowing LLMs to query firewall configuration, search network objects, and check deployment status through natural language.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server for interacting with Sophos Central APIs, providing 255 tools for managing endpoints, alerts, policies, and more across partners, organizations, and single tenants.1,317 npm19MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that exposes Acronis Cyber Protect Cloud APIs as 14 read-only tools for managing alerts, tasks, agents, resources, policies, and tenants.-