Project OWNOpen Web Node
GitHub

08Server

API and AI assistants

Everything the Project OWN (Open Web Node) panel does is also available over a JSON API, with tokens you control. The same API powers an MCP server, so Claude or another AI assistant can help look after your server, with only the access you give it.

API tokens

A token lets a script, a CI pipeline or an AI assistant use the panel without your password.

  1. Open API tokens and expand Make a token.
  2. Name: what it's for, so you recognise it later, such as "GitHub deploy".
  3. Access: Same access as me, or Only chosen sites, each at a level: Manage, Deploy or View.
  4. Tick Read-only if it only needs to look: it can see everything it can reach, but change nothing.
  5. Expires after: 30 days, 90 days, 1 year or Never. Click Make token.
  6. Copy the token now. It isn't shown again.
  • A token never has more access than the person who made it.
  • Tokens are stored only as SHA-256 hashes. A read-only token can make only GET requests (and checks that change nothing).
  • The list shows each token's access and when it was last used. Revoke stops it at once. Removing a person stops their tokens too.
  • For deploys from CI, a token with Deploy access to that one site is enough. See Deploy from CI.

Using the API

Send the token in the Authorization header, to the panel's address:

curl -H "Authorization: Bearer own_..." https://your-server:8443/api/sites

The panel's certificate is its own, not from a public authority, so your tool has to be told to trust it.

Requests and answers are JSON. Long tasks, such as installs, backups and deploys, answer with a job ID; follow its progress at /api/jobs/{id}. Every change made through the API is in the activity log, like changes made in the panel.

The routes, by area

AreaRoutes
Sites/api/sites and /api/sites/{id} (list, add, change, delete), plus /ssl, /backups, /restore, /backup-plan, /deploy, /sftp, /share and /app under a site
LogsGET /api/sites/{id}/logs?log=error (or php, access, app), with &lines= up to 1000
App sitesGET, PUT /api/sites/{id}/app (status, start command), POST /api/sites/{id}/app/restart and /stop, GET /api/sites/{id}/app/logs, GET, PUT /api/sites/{id}/app/env (settings); GET /api/runtimes lists the kinds and their versions
DeploysPOST /api/sites/{id}/deploy deploys; /deploy/rollback; GET, PUT /api/sites/{id}/deploy/files read and write a file kept between deploys (?path=.env; {"path","content"}, up to 48 KB, only paths in the site's kept list); webhooks arrive at /api/hooks/deploy/{id}
AppsGET /api/apps lists the catalogue and what's installed; POST /api/apps installs (with "name": "custom" and a compose file for your own app); POST /api/apps/{id}/update; POST /api/apps/{id}/command for a game's console; /api/apps/{id}/backups, /restore, /backup-plan and /logs; DELETE /api/apps/{id} removes it (add ?deleteData=1 to delete its data too); GET /api/apps/community
PHP apps, OptimizeGET /api/phpapps, POST /api/sites/{id}/phpapp; GET, POST /api/sites/{id}/optimize ({"item": "wp-cache", "on": true}, or {"recommended": true})
Load balancersPOST /api/balancers/probe; GET, PUT /api/sites/{id}/balancer; POST /api/sites/{id}/balancer/check
BackupsGET, PUT, DELETE /api/backups/offsite; POST /api/backups/offsite/copy; GET /api/backups/kit (owners only); POST /api/backups/recover (at: bring them back as they were then, from S3 storage that keeps versions); GET /api/backups/offsite says how protected S3 copies are (protection)
ImportPOST /api/import/cpanel uploads a backup (the file as the request body), then /api/import/cpanel/{id}/inspect and /run; DELETE throws it away
EmailGET /api/mail; POST /api/mail/domains, DELETE /api/mail/domains/{domain}; GET /api/mail/domains/{domain}/dns; /api/mail/mailboxes, /api/mail/aliases; GET /api/mail/log?domain=
Scheduled tasksGET, POST /api/sites/{id}/tasks (command, every: minute, 5m, 15m, 30m, hourly, daily or weekly; at: HH:MM for daily and weekly), PUT, DELETE /api/sites/{id}/tasks/{task} (off to keep it without running it), POST /api/sites/{id}/tasks/{task}/run; each task with its last run, exit code, output and next run
Preview addressesPOST /api/sites/{id}/preview (on); GET, PUT /api/settings/preview (domain: your own wildcard domain, or empty for sslip.io)
Log serverGET, PUT, DELETE /api/syslog (host, port, protocol: udp, tcp or tls; what: all or security; ca), POST /api/syslog/test
Copies of the backupsGET /api/mirror, GET /api/mirror/{id}/files, GET /api/mirror/{id}/file?path=PATH (in parts with Range): the backup stores' files, encrypted, for an owner's or admin's token (read-only is enough)
LimitsGET, PUT /api/sites/{id}/limits (cpu: percent of one core; memoryMb; processes; phpWorkers: PHP requests at once; 0 for no limit; setting them is for owners and admins), with what the site uses now; GET /api/usage: every site's use, busiest first
AlertsGET, PUT /api/alerts (warnings, smtp), POST /api/alerts/channels (kind: email, discord, slack, telegram, ntfy or webhook; target; chatId for Telegram), DELETE /api/alerts/channels/{id}, POST /api/alerts/test, POST /api/alerts/check (the check-up now); owners and admins
Staging copiesPOST /api/sites/{id}/staging (domain, staging. and the site's by default) makes a copy, as a job; POST /api/sites/{id}/staging/push on the copy (files, database) pushes it to its live site, a safety snapshot first; a site's staging says which site a copy is of, or a site's copies
Bin, databases/api/bin, /api/databases (each with its engine, mariadb or postgresql; POST takes engine too, and hands back the database's host, port and url, its DATABASE_URL; POST /api/sites takes databaseEngine); GET /api/databases/{name}/export sends it as a .sql file; POST /api/databases/{name}/import (the .sql file as the body, up to 4 GB) replaces a site's database with it, as a job, keeping the database as it was on the server first
People and tokens/api/users, /api/tokens
Server/api/packages (/install, /remove), /api/firewall (panelFrom: addresses, tailscale or ssh; POST /api/firewall/outside checks the open ports from the internet), /api/remote, /api/doctor, /api/update (undone: an update that was undone by itself, and why; DELETE /api/update/undone hides it), /api/audit
SecurityGET /api/security; POST /api/security/audit and /scan; PUT /api/security/settings; POST /api/security/unban
Jobs/api/jobs/{id}
MCPPOST /api/mcp: the MCP server (one JSON-RPC message per request)

The README lists every route in full.

AI assistants (MCP)

Project OWN has an MCP (Model Context Protocol) server, so Claude, or any assistant that speaks MCP, can help look after the server. Ask it "why is my shop site showing error 500?": it reads the site's logs, runs Doctor and explains the fix.

  • 18 tools to look: the server, Doctor, sites, a site's details, logs and what it uses, backups, deploys, databases, apps and their logs, email and the mail log, security, the firewall, the activity log, the email check, and long jobs.
  • 6 tools to change things: back up a site or an app, deploy, roll back, restart an app, get a certificate. Nothing that deletes or restores: those stay with people, in the panel.
  • Two ready-made prompts: Troubleshoot a site and Server check-up.

Each tool is a call to the panel's own API, made with the access of whatever connected, so the same checks apply. Every change is in the activity log, marked "via MCP".

Project OWN sends nothing to any AI company itself. You choose the assistant, and what its tools return (logs, settings, the activity log) goes to that assistant, and from there to whoever runs its model.

The API tokens page has a Connect an AI assistant (MCP) section with all of this, and your server's address filled in.

Connect through SSH

This needs SSH with a key, as root, or as a user who can sudo without a password (then use sudo own mcp). Through SSH, the assistant can look at everything but change nothing.

For Claude Code:

claude mcp add my-server -- ssh -T root@my-server own mcp

For Claude Desktop and other assistants, in their MCP settings:

{
  "mcpServers": {
    "my-server": {
      "command": "ssh",
      "args": ["-T", "root@my-server", "own", "mcp"]
    }
  }
}
  • Add --allow-changes at the end to let it take backups, deploy, restart apps and get certificates. Each change still needs your approval in the assistant.
  • Add --token-file FILE to give it only an API token's access.

Connect over HTTPS

For assistants and tools that connect to an address: make a token (read-only, if it should only look) and point the assistant at:

https://my-server:8443/api/mcp

with the header Authorization: Bearer <token>. Over HTTPS it takes only API tokens, never a browser session, so a web page can't drive it. The panel's certificate is its own, so the assistant has to be told to trust it.

Staying safe with an assistant

Logs hold text that visitors choose, such as their browser's name, and a site's errors can quote what was sent to it. Someone could write instructions there, hoping an assistant reading the logs follows them. So:

  • changes are off unless you allow them;
  • approve each change in the assistant;
  • a read-only or site-limited token is the safest way to let an assistant look;
  • connect only an assistant you'd trust with what the token can see.

Something wrong or unclear on this page? Open an issue on GitHub.