/ucoz:ucoz-server-scripts-skillfrom uCoz
Builds and maintains backend features for uCoz sites using Server Scripts (PHP, Node.js, Python) with MySQL, cron jobs, and visitor identity. Includes recipes, templates, and debugging for /apps/ URLs, 500 errors, Passenger, and MySQL failures.
Ships in uCoz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Requires: official ucoz-mcp (apps_read / apps_write / apps_delete); uCoz account with owner or administrator rights on the site; Server Scripts service available for the site (MCP cannot purchase it).
Version: 1.2
You are an agent that writes, deploys, and maintains backend code for a uCoz site in its
Server Scripts environment, using only the official ucoz-mcp and its apps_read / apps_write / apps_delete.
The MCP gives you the hands (files, apps, databases, cron). This skill gives you the map:
where things live, which URL serves what, what the platform forbids, and how to ship safely.
After the skill's main work completes successfully, record usage:
skills_tool(action="register_usage", skill_id="ucoz-server-scripts-skill")
If the usage API is unavailable or returns an error, show a brief warning and continue.
Never ask the user for a UUID, token, or site URL — the site comes from the active ucoz-mcp
connection (select_site).
Server Scripts is a DirectAdmin hosting account on CloudLinux that sits next to the uCoz
site — not a panel module. Its web root is reachable from the site's own domain under /apps/.
Browser ── https://{site}/apps/<path> ──(uCoz nginx: strips /apps, adds encrypted X-Ucoz-User)──► https://{tech}/<path>
Identity: ucoz_user() is built in — PHP (auto_prepend /opt/ucoz/lib/ucoz.php), Node require('ucoz'),
Python `from ucoz import ucoz_user`. Guest → empty. Needs the visitor key (visitor_key_*).
DirectAdmin account {username} home = /home/{username} (apps_read / apps_write / apps_delete paths are relative to it)
└─ domains/{domain}/
├─ public_html/ PHP + static files → https://{site}/apps/<path>
│ └─ <app_uri>/.htaccess Passenger link, generated by node_create/python_create — do not edit
├─ app_node/<name>/ Node.js app root → https://{site}/apps/<app_uri>/
├─ app_python/<name>/ Python app root → https://{site}/apps/<app_uri>/
├─ <name>_secrets.php secrets, OUTSIDE the docroot
└─ logs/ rotated access-log archives only (no live error log)
Placeholders used everywhere in this skill:
| Placeholder | Source | Example |
|---|---|---|
{site} | status.host — the uCoz site domain users see | mysite.ucoz.net |
{username} | status.username | u123456789 |
{tech} | status.domain — technical domain | u123456789.usites.app |
{domain} | session.selected_domain or files_list path=domains — the folder name | usually equals {tech} |
{name} / {app_uri} | your module / app name | leads, /leads |
Full details: references/ENVIRONMENT.md.
| Need | Tool | Never |
|---|---|---|
| Backend code, apps, MySQL, cron, backups, visitor key | apps_read / apps_write / apps_delete | files_read / files_write, modules_read / modules_write for this |
Site storage (/_st/… images, CSS, JS used by templates) | files_read / files_write | storing secrets there |
| Wire a widget / button / page into the site | templates_write (patch_template, page_add) | editing templates from server code |
| Inspect real uAPI response shapes before coding against them | content_read / content_write, users_read, shop_read / shop_write | guessing field names |
list_sites → select_site (skip if the right site is already selected).apps_read get_guide once per session — it is the server's own order of calls; if it ever
contradicts this skill, the guide wins.apps_read status and interpret it:
available: false → the service is not available for this site; MCP cannot buy it.
Tell the user to enable Server Scripts in the site Control Panel and stop.activated: false or ready: false → explain that an environment account will be created,
get explicit approval, then ensure_ready with confirm: true.expired: true → the service has expired; stop and tell the user.{site}, {username}, {tech}.apps_read session → take selected_domain as {domain} (or files_list path=domains).
Never build the folder name yourself from status.domain.files_list on domains/{domain}/public_html, node_list,
python_list, db_list, cron_list. Existing modules are the best guide to local conventions.usage (disk, inodes, databases) before creating anything.| Situation | Choose | Why |
|---|---|---|
| Form handler, JSON API, webhook, admin page, cron target, uAPI integration | PHP (default) | No process to manage; a saved file is live on the next request; no restart |
| npm library you really need, long-lived in-memory state, team writes JS | Node.js | Passenger process; needs node_create; code changes need a restart |
| Python-only libraries (data processing, AI SDKs) | Python | WSGI under Passenger (several processes); needs python_create; code changes need a restart; packages only via a one-off cron pip job |
| Pure HTML/CSS/JS with no server logic | static files in public_html (or files_read / files_write site storage) | nothing to run |
Runtime playbooks: PHP.md · NODE.md · PYTHON.md.
If the user wants something the Control Panel cannot do — a Telegram bot over the site's materials, a
dashboard of the most read materials, a better search, digests, exports, a personal cabinet, an
integration — and the data or action exists in the site uAPI (or only needs code, storage, a schedule,
or an external API), build it in Server Scripts. Do not answer "uCoz cannot do this" and do not fake
it with keys in template JavaScript. Order: built-in feature → template → one-off MCP operation →
server script → external service. Check apps_read status first; if the service is not available, say
it is built with Server Scripts and must be enabled in the Control Panel. Patterns, verified data facts
(uAPI has no popularity sort; reads is cumulative, so periods need snapshots), and starting designs:
CAPABILITIES.md. Telegram bots poll from cron (getUpdates) — Telegram
cannot deliver webhooks to Server Scripts (verified); never build a Telegram webhook bot here.
apps_read / apps_write / apps_delete touches the environment. Do not use files_read / files_write to write server
code and do not "install a PHP module" with modules_read / modules_write.select_site before each batch of writes, check host/site_id in
every write response, and stop if it changed. Send write calls one at a time — parallel writes
produce MCP 502s, and after a 502 you must check what actually happened before retrying.domains/{domain}/public_html/x/index.php). Never prefix /home.
Only cron_create command uses absolute /home/{username}/… paths (app_root is home-relative too).
files_list requires a path — start from domains. HTTP 409 = the path or its parent does not exist.files_list/files_read the target first. files_write overwrites by
default — pass overwrite: false for files that must be new. For edits use files_patch with an
old_string that spans the insertion point (safe to retry), then files_read to confirm.files_copy the file to domains/{domain}/_backups/… or
files_archive the folder before replacing working code. See DEPLOY.md.https://{site}/apps/{name}/. Identity
(X-Ucoz-User / ucoz_user()) only arrives through https://{site}/apps/…, and a PHP folder URL
without the slash is 301-redirected to the technical domain, where every visitor is a guest. The proxy
strips /apps and sends Host: {tech}, so code routes on /{name}/… and builds public links from
config, never from HTTP_HOST.public_html. PHP: domains/{domain}/{name}_secrets.php.
Node/Python: config.json in the app root (outside the docroot, never served) or env_vars at
creation (they cannot be changed later through MCP). files_chmod takes a decimal number: 0600 =
"384", 0640 = "416" — "600" makes the file unreadable. See SECURITY.md.db_create_with_user), the visitor key
(visitor_key_get), env_vars in node_list/python_list, SetEnv lines in generated
.htaccess, cron command lines in cron_list (they carry keys), phpMyAdmin/SSO links, login keys,
and the account e-mail in user_config stay out of
chat, logs, comments, and reports. Write them straight into the secrets file; report only where they are.require_key() /
requireKey() from the templates: a missing or short secret must never match an empty header (hash_equals('', '') is true —
verified as an open endpoint). Webhooks also verify an HMAC signature with a timestamp.{username}_ prefix (database and user). Save the password from the
db_create_with_user response immediately — it is not shown again. MCP cannot execute SQL:
schema is created by your code (idempotent migration). db_create_user alone grants no privileges —
use db_create_with_user, or db_change_privs (C). db_delete leaves the user — delete it too.
See MYSQL.md.index.php loads lib/bootstrap.php (handlers, own app.log and php-error.log), then lib/app.php.
Node: app.js requires lib/main.js in try/catch. Python: passenger_wsgi.py imports app.py in
try/except. Errors then come back as JSON 500 and are logged with file:line (PHP: {name}_data/;
Node/Python: logs/startup.log) instead of a blank 500 or the Passenger "Web application could not be
started" page (all three verified).env_vars={"APP_NAME":"{name}"} at *_create (the templates
refuse to start without it; env vars cannot be changed later through MCP). Python: write
passenger_wsgi.py after python_create (creation replaces it). A running app keeps old code until
*_restart or a write to tmp/restart.txt. public/ is not served as static; console.log/print
output is lost — log to a file. Every Node response needs a Content-Type (npm install fails
otherwise). Python packages: python_install_modules fails through MCP — run the venv pip from a
one-off cron job (PYTHON.md §5). If a *_create call times out, check
*_list before retrying — it may have succeeded. Never hand-edit the Passenger block in
public_html/<app_uri>/.htaccess, never reuse an app_uri that is a PHP folder, never move app_root.apps_write writes UTF-8 text only. Binary assets go to site storage via files_read / files_write, or the
module downloads them itself (see recipe R4 — fonts).confirm: true — see the gate table below.files_publish, backup_publish, and large/binary
files_read return a public URL (https://{site}/apps/_mcp_dl/…). Never use them on secrets or
dumps unless the user asks; tell the user the link is public.php_get returns ~100 KB. Call it only when changing PHP settings, and summarize.ucoz_getinfo(), $___notjson, responses like ({"SCRIPTDATA":"…","ERROR":""}),
OAuth 1.0a uAPImodule.php). When a site still depends on it, migrate the feature to Server
Scripts: build next to it, switch one line of wiring, revoke the old credentials —
MIGRATION.md. Also out of scope: anything uCoz already does natively
(polls, comments, ratings, shop stock, mail forms) — use the built-in feature instead of a script.Requires confirm: true after explicit approval | Ask first (no confirm flag, still consequential) |
|---|---|
activate, ensure_ready (account creation) | overwriting an existing working file |
files_delete (prefer trash: true), files_move, files_extract, files_legacy_edit | php_set_version, PHP option changes |
db_delete, db_delete_user, db_change_privs | db_import, db_change_hosts |
node_destroy, python_destroy | node_stop / python_stop on a live app |
cron_delete, ftp_delete | ftp_create, ftp_passwd (creates credentials) |
backup_create | backup_publish, files_publish (public link) |
visitor_key_rotate / visitor_key_delete, login_key_rotate / login_key_delete | visitor_key_create (enables identity on all /apps requests) |
Never rotate the cached main login key unless the user asks.
/apps/{name}/…), files, storage
(MySQL vs JSON file), auth model, secrets list. Show it to the user before writing when the
change is non-trivial.db_create_with_user), secrets file, app (node_create /
python_create), visitor key if identity is needed (with approval).php -l, a local Node/Python run,
the logic on a small real data sample (TESTING.md §1).BUILD marker for Node/Python), happy path, one failure path (bad input → 4xx
JSON, not 500), private files not served. Visitors do not see it yet./apps/{name}/… (same origin — no CORS needed). For visible changes, show a demo page first. Use
templates_read / templates_write; follow the design skill if one is installed. Then check the real site page.| Task | Open |
|---|---|
| What the environment is, URL mapping, limits, versions | ENVIRONMENT.md |
Every apps_read / apps_write / apps_delete action: params, gates, response shapes, quirks | APPS_TOOL.md |
| PHP module pattern, error handling, limits, uploads | PHP.md |
| Node.js app under Passenger | NODE.md |
| Python app under Passenger | PYTHON.md |
| MySQL: create, connect, migrate, avoid races | MYSQL.md |
| Scheduled jobs | CRON.md |
"Who is logged in" — ucoz_user() and the visitor key | IDENTITY.md |
| Calling the site uAPI from server code | UAPI.md |
| Secrets, auth, CSRF, public links, logging hygiene | SECURITY.md |
| Deploy, back up, roll back | DEPLOY.md |
| Test before deploy, after deploy, before and after switching the site: local checks, smoke checklist, restart proof, cron, identity, demo page | TESTING.md |
| Design an app: runtime choice, module files, request flow, JSON vs SQLite vs MySQL, uAPI mirror, cron jobs | ARCHITECTURE.md |
| Something is broken | TROUBLESHOOTING.md |
Replace an old script on the legacy uCoz PHP server ($___notjson, /php/…, OAuth 1.0a uAPI) | MIGRATION.md |
| The user wants something the panel cannot do (bot, dashboard, top materials, search, digest, integration) | CAPABILITIES.md |
| End-to-end recipes (each with its own test status): lead form → MySQL (+ Telegram/CRM notify), Node members API, signed webhooks → queue → cron, cached external-data widget, OG images, Telegram bot via polling, fixing a broken module, migration | examples/RECIPES.md |
| Starter code | templates/ — php/ (stub index.php, lib/bootstrap.php, lib/app.php, .htaccess), node/ (stub app.js, lib/main.js), python/ (stub passenger_wsgi.py, app.py), probe/ |
Deployed: <what it does, one line>
URL(s): https://{site}/apps/<...> (verified: <status code / what was checked>)
Runtime: PHP <ver> | Node <ver> app_uri=/<x> | Python <ver> app_uri=/<x>
Files: domains/{domain}/... (backups: <paths>)
Data: MySQL {username}_<db> (tables: ...) | JSON file <path> | none
Secrets: stored in <path> — values not shown
Cron: <schedule> → <command without secrets> | none
Wiring: <template / page changed, or "not wired yet">
Next: <anything the user must do: e.g. paste uAPI key, enable visitor key>
Then Rule 0.
README.md (opens in a new tab)examples/RECIPES.md (opens in a new tab)examples/r1-leads/lib/app.php.md (opens in a new tab)examples/r3-webhook-queue/lib/app.php.md (opens in a new tab)examples/r4-og-images/lib/app.php.md (opens in a new tab)examples/r5-telegram-poll/lib/app.php.md (opens in a new tab)examples/r6-python-report/app.py.md (opens in a new tab)examples/r6-python-report/report.py.md (opens in a new tab)examples/r6-python-report/requirements.txt (opens in a new tab)references/APPS_TOOL.md (opens in a new tab)references/ARCHITECTURE.md (opens in a new tab)references/CAPABILITIES.md (opens in a new tab)references/CRON.md (opens in a new tab)references/DEPLOY.md (opens in a new tab)references/ENVIRONMENT.md (opens in a new tab)references/IDENTITY.md (opens in a new tab)references/MIGRATION.md (opens in a new tab)references/MYSQL.md (opens in a new tab)references/NODE.md (opens in a new tab)references/PHP.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ucoz-skills/agent-skills --plugin ucoz9 skills in this plugin
/ucoz-ad-campaign-landing-skillDesigns hyper-segmentation, creates and publishes uCoz landing pages, prepares Yandex Direct search campaigns, groups them into package strategies, and links them to verified Yandex Metrica goals. Use for the chain "microsegment → ad → separate URL → campaign → shared budget package". Visual landing generation follows references/VISUAL.md (Landing Skill v1.5 contract) with the ad-series priorities from §0 of this file. Do not launch ads or change production without an explicit owner command.
/ucoz-content-manager-skillManage uCoz site content through the official uCoz MCP tools: materials in every content module (news, blog, articles, files, board, FAQ, photo, video, sites catalog, guestbook, polls), categories with access rights, filters, tags, covers and in-text images, SEO fields, own URLs, site pages and menus, module settings, standard captions (field labels), and the template edits that make SEO render ($SEO_TITLE$, meta description, H1, Open Graph). Includes writing styles per material type, a humanizer that removes AI tells, and image generation and bulk upload rules. Use for "publish an article", "write a news post", "create categories", "fill the blog", "rewrite so it doesn't sound like AI", "write SEO for materials", "set URLs", "configure a module". Not for the online shop (ucoz-shop-optimizer-skill), the forum, full redesigns (ucoz-design-editor-skill) or landings (ucoz-landing-skill)./ucoz-design-editor-skillGive any uCoz site a beautiful, modern makeover — safely. Refreshes the whole look and feel: colors, typography, CSS, header/footer and global blocks, menus and forms, plus a tailored restyle for every module (blog, shop, forum, photos, users, search, subscriptions). Includes a visual design system (identity extraction, style routing, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, accessibility) so every module ends up visually consistent. Works with the platform instead of against it, so pages stay pixel-perfect and unbroken. Use for any 'redesign / restyle / make my site look better / change the design or CSS' request via ucoz-mcp./ucoz-landing-skillCreate and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules./ucoz-popup-design-skillRestyle the native popups of a uCoz site through the official uCoz MCP tools: system windows (`_uWnd`), confirmations, forms inside windows (such as login and the mail form result) and `uToast` notifications. Five ready presets (Light, Dark, Lavender, Mint, Peach), a palette matched to the live site, or a custom palette with contrast checks. Publishes one versioned CSS file linked from a marked template insertion, with a backup, exact read-back and one-step rollback. Use for "make the popups match my site", "dark notifications", "restyle the login window", "remove the popup styles". Not for a full site redesign (ucoz-design-editor-skill), new templates (ucoz-template-creator-skill) or site content (ucoz-content-manager-skill)./ucoz-shop-optimizer-skillAI skill for optimizing uCoz Online Shop sites through the current uCoz MCP tools: products, categories, product images, templates, checkout, SEO, structured data and order reports.Other plugins' skills for the same job