Skip to content

OpenClaw Integration

Use Nefia as an MCP server for OpenClaw to manage remote PCs from your AI assistant.

OpenClaw is an open-source autonomous AI agent that connects large language models to your local environment. By registering Nefia as an MCP server, OpenClaw gains the ability to execute commands, manage files, and orchestrate workflows across all your remote PCs — with full policy enforcement and audit logging.

Prerequisites

Before connecting OpenClaw to Nefia, make sure the following are in place:

  1. Nefia is installed and configured on your operator PC with at least one target host enrolled.
  2. OpenClaw is installed and running on the same machine. See the OpenClaw documentation for installation instructions.
  3. You are logged in to Nefia. Run nefia login before starting the MCP server. If you skip this step, the server exits silently and OpenClaw will not see any tools.

Configuration

Add Nefia to your openclaw.json configuration file:

json
{
  "mcpServers": {
    "nefia": {
      "command": "nefia",
      "args": ["mcp", "serve"]
    }
  }
}

Windows

On Windows, some MCP clients cannot execute .exe files directly. Use the cmd /c wrapper:

json
{
  "mcpServers": {
    "nefia": {
      "command": "cmd",
      "args": ["/c", "nefia", "mcp", "serve"]
    }
  }
}

Available Tools

Once connected, OpenClaw discovers all 207 Nefia MCP tools automatically:

CategoryTools
Sessionsession.open, session.close, session.summary, session.list
Executionexec, exec.sudo, cancel
File Systemfs.read, fs.write, fs.patch, fs.list, fs.stat, fs.copy, fs.move, fs.grep, fs.du, fs.find, fs.tail, fs.mkdir, fs.remove, fs.chmod, fs.chown, fs.stream_read, fs.stream_write, fs.stream_read_resumable, fs.stream_write_resumable, fs.symlink, fs.readlink, fs.archive.create, fs.archive.extract, fs.diff
Multi-Host Filepush, sync
Host Inventoryhosts.list, hosts.show, hosts.update, hosts.groups, hosts.import, hosts.remove, hosts.refresh
Playbooksplaybook.run, playbook.list, playbook.show, playbook.validate
System Infofacts, sys.processes, sys.services, sys.ports, sys.users, sys.logs, sys.logs.search, sys.service.control, sys.network, sys.disk, sys.env, sys.kill, sys.group.list
Package Mgmtsys.package.list, sys.package.install, sys.package.remove
User Mgmtsys.user.create, sys.user.modify, sys.user.delete
Cronsys.cron.list, sys.cron.create, sys.cron.delete
Service Mgmtsys.service.enable, sys.service.disable, sys.service.reload, sys.service.logs, sys.service.show
Network Diagnet.ping, net.traceroute, net.dns, net.connections, net.listen
Firewallnet.firewall.list, net.firewall.add, net.firewall.remove, net.firewall.status
System Updatesys.update.check, sys.update.apply, sys.hostname, sys.time, sys.sysctl.list, sys.sysctl.set
Mountsys.mount.list, sys.mount, sys.umount
Containercontainer.list, container.logs, container.start, container.stop, container.restart, container.inspect
VPN & Connectivityvpn.status, vpn.diagnose, vpn.ping, vpn.revoke, vpn.key.rotate, vpn.config, vpn.enroll_status, vpn.invite, vpn.invite_list, vpn.invite_revoke, vpn.peer.stats, netcheck, conn.health
Policypolicy.test, policy.test_batch, policy.capabilities
JIT Accessjit.request, jit.list
Auditaudit.search, audit.export, audit.verify
Agentagent.status, agent.upgrade, agent.pin
Scheduleschedule.list, schedule.create, schedule.delete, schedule.show, schedule.update, schedule.enable, schedule.disable, schedule.history, schedule.trigger
Queuequeue.list, queue.show, queue.cancel, queue.retry
Diagnosticsstatus, doctor, explain, validate, recording.list, recording.show, recording.delete, recording.export
Reactorreactor.status, reactor.events, reactor.rule.create, reactor.rule.delete, reactor.rule.enable
Powerpower.wake, power.reboot, power.shutdown
Securitysecrets.list, secrets.test, compliance.report
Device Securitydevice_lock.status, device_lock.verify, device_lock.init, device_lock.sign, device_lock.revoke, posture.check
Configurationconfig.show
Webhookswebhook.list, webhook.test, webhook.create, webhook.update, webhook.delete
Backupbackup.list, backup.create, backup.verify, backup.restore
Compositerun, investigate, file.deploy, service.deploy, config.apply, system.baseline, system.health
Cluster Mgmtcluster.init, cluster.status, cluster.members, cluster.add_peer, cluster.remove_peer
SSH CAsshca.init, sshca.sign_user, sshca.sign_host, sshca.status, sshca.trust, sshca.server_snippet
Mutual TLSmtls.init, mtls.issue_client, mtls.status, mtls.revoke
Team Mgmtteam.current, team.list, team.use, team.create, team.invite, team.join, team.members, team.leave, team.role
Profile Mgmtprofile.list, profile.show, profile.create, profile.delete, profile.set_default
Discoverytools.schema, approval.check
Approvalapproval.list, approval.respond

All tool names are prefixed with nefia. (e.g., nefia.exec, nefia.fs.read).

For detailed tool schemas, see the MCP Protocol Reference.

Security Considerations

OpenClaw's skill ecosystem has had reported security incidents including data exfiltration and prompt injection through third-party skills. When connecting Nefia, apply defense-in-depth:

1. Enforce Strict Policies

Define explicit allow/deny rules in your nefia.yaml to limit what OpenClaw can do:

yaml
policy:
  mode: enforce
  deny_commands:
    - "^rm -rf /$"
    - "^mkfs\\."
    - "^shutdown"
    - "^reboot"
  allow_commands:
    - "^ls "
    - "^cat "
    - "^systemctl status"
  deny_paths:
    - "^/etc/shadow$"
    - "^/etc/passwd$"
  allowed_roots:
    - "^/home/"
    - "^/var/www/"

2. Enable Approval Workflows

Require human approval for sensitive operations:

yaml
mcp:
  approval:
    enabled: true
    default_timeout: 120s
    rules:
      - tools: ["nefia.exec"]
        require_approval: true
      - tools: ["nefia.fs.read", "nefia.fs.list", "nefia.fs.stat"]
        require_approval: false

With approvals enabled, OpenClaw pauses and waits for your confirmation before executing commands. Read-only operations can be exempted to keep the workflow smooth.

3. Use Rate Limiting

Prevent runaway automation with rate limits:

yaml
mcp:
  rate_limit:
    rate: 1.0
    burst: 10

4. Monitor Audit Logs

Every operation OpenClaw performs through Nefia is recorded in the append-only audit log with hash-chain integrity. Review logs regularly:

bash
nefia audit show --tail 50

For real-time monitoring, forward logs to your SIEM platform. See SIEM Integration.

5. Restrict Third-Party Skills

Only install OpenClaw skills from trusted sources. Avoid skills that request broad filesystem or network access. Nefia's policy engine provides a second layer of defense, but preventing malicious skill installation is the first line of protection.

Example: OpenClaw Managing Server Updates

Here is a practical workflow where OpenClaw uses Nefia to update packages across a fleet:

1

OpenClaw discovers available hosts:

plaintext
User: "Check which servers need security updates and apply them."
OpenClaw → nefia.hosts.list
2

It gathers system facts from each host:

plaintext
OpenClaw → nefia.facts (target: "tag:production")
→ Returns OS version, uptime, package manager info for each host
3

It checks for available updates:

plaintext
OpenClaw → nefia.exec (target: "tag:production", command: "apt list --upgradable 2>/dev/null | head -20")
→ 3 hosts have pending security updates
4

It applies updates (triggers approval if configured):

plaintext
OpenClaw → nefia.exec (target: "host:prod-web-1", command: "sudo apt upgrade -y")
⏳ Waiting for operator approval...
✓ Approved — executing on prod-web-1
5

It verifies the updates:

plaintext
OpenClaw → nefia.exec (target: "tag:production", command: "uptime && apt list --upgradable 2>/dev/null | wc -l")
→ All hosts up-to-date, no pending updates

Every step is policy-checked, audited, and sandboxed. If OpenClaw attempts a denied operation, Nefia blocks it and returns a structured error with an explanation.

Comparison with Other MCP Clients

FeatureOpenClawClaude CodeClaude DesktopCodex CLI
Autonomous executionYes (always-on agent)Yes (interactive)Yes (interactive)Yes (interactive)
Messaging integrationWhatsApp, Discord, SlackTerminalDesktop appTerminal
Runs 24/7YesNo (session-based)No (session-based)No (session-based)
MCP supportNativeNativeNativeNative
Approval workflowVia NefiaVia NefiaVia NefiaVia Nefia

Troubleshooting

OpenClaw cannot find Nefia tools

  • Verify nefia is in PATH: which nefia
  • Check that you are logged in: nefia login
  • Try using the full binary path in openclaw.json

Operations are silently failing

  • Check Nefia audit logs: nefia audit show --tail 20
  • Verify policy rules are not blocking the operations
  • Check that VPN tunnels are active: nefia vpn status

Rate limit errors

If OpenClaw receives retry_after_ms errors, increase the rate limit in nefia.yaml or configure OpenClaw to respect the backoff interval.

MCP Integration

General MCP server setup for all AI agent clients.

Policy Engine

Configure command, path, and host restrictions for AI agents.

Audit Logging

Monitor all AI agent activity with tamper-proof audit logs.

SIEM Integration

Forward audit logs to Splunk, Datadog, or custom webhooks.