Skip to content

Commit 0a3d814

Browse files
feat: automate MCP release sync (#4)
1 parent 153705c commit 0a3d814

14 files changed

Lines changed: 183 additions & 86 deletions

File tree

‎.cursor-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hostinger-connector",
33
"displayName": "Hostinger Connector",
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"description": "MCP plugin to deploy and manage Hostinger websites, WordPress, domains, DNS, VPS, and subscriptions from inside Cursor.",
66
"author": "Hostinger",
77
"license": "MIT",

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,3 @@ jobs:
3636

3737
- name: Check hook script is executable
3838
run: test -x scripts/check-no-token-leak.sh
39-
40-
# The MCP server ships new tools regularly. This is advisory: it tells us the
41-
# checked-in catalog has fallen behind, without failing PRs that didn't cause it.
42-
catalog-drift:
43-
runs-on: ubuntu-latest
44-
continue-on-error: true
45-
steps:
46-
- uses: actions/checkout@v4
47-
48-
- uses: actions/setup-node@v4
49-
with:
50-
node-version: 22
51-
52-
- name: Regenerate the catalog from the latest published server
53-
run: node scripts/sync-mcp-tools.mjs
54-
55-
- name: Report drift
56-
run: |
57-
if git diff --quiet -- scripts/mcp-tools.json; then
58-
echo "Catalog is up to date with hostinger-api-mcp@latest."
59-
else
60-
echo "::warning::scripts/mcp-tools.json is behind hostinger-api-mcp@latest."
61-
echo "Run 'node scripts/sync-mcp-tools.mjs' and commit the result."
62-
git --no-pager diff --stat -- scripts/mcp-tools.json
63-
fi
64-
65-
skills-drift:
66-
runs-on: ubuntu-latest
67-
continue-on-error: true
68-
steps:
69-
- uses: actions/checkout@v4
70-
71-
- uses: actions/setup-node@v4
72-
with:
73-
node-version: 22
74-
75-
- name: Regenerate skills from the latest published server
76-
run: node scripts/sync-skills.mjs
77-
78-
- name: Report drift
79-
run: |
80-
if [ -z "$(git status --porcelain -- skills)" ]; then
81-
echo "Skills are up to date with hostinger-api-mcp@latest."
82-
else
83-
echo "::warning::skills/ is behind hostinger-api-mcp@latest."
84-
echo "Run 'node scripts/sync-skills.mjs' and commit the result."
85-
git status --short -- skills
86-
fi

‎.github/workflows/mcp-sync.yml‎

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: mcp-sync
2+
3+
# Opens (or refreshes) one PR that brings skills/ and the operation catalog up
4+
# to a published @hostinger/mcp release. Every run rebuilds from main, so
5+
# several releases between merges collapse into one PR and one bump. If the
6+
# release renamed operations the hand-written rules/agents/commands use, CI's
7+
# check-tool-names fails on the PR; fix those names on the PR branch.
8+
9+
on:
10+
schedule:
11+
- cron: "0 6 * * *"
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: "@hostinger/mcp version (default: latest)"
16+
required: false
17+
type: string
18+
19+
concurrency:
20+
group: mcp-sync
21+
cancel-in-progress: false
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
sync:
28+
runs-on: ubuntu-latest
29+
steps:
30+
# PRs opened with GITHUB_TOKEN don't trigger ci.yml, so use the App.
31+
- name: Get GitHub token
32+
uses: actions/create-github-app-token@v2
33+
id: token
34+
with:
35+
app-id: ${{ secrets.HOSTINGERBOT_APP_ID }}
36+
private-key: ${{ secrets.HOSTINGERBOT_PRIVATE_KEY }}
37+
38+
- uses: actions/checkout@v4
39+
with:
40+
ref: main
41+
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
46+
- name: Resolve version
47+
id: version
48+
env:
49+
INPUT_VERSION: ${{ inputs.version }}
50+
run: |
51+
V=$(npm view "@hostinger/mcp@${INPUT_VERSION:-latest}" version)
52+
if ! [[ "$V" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "::error::Unresolvable @hostinger/mcp version '${INPUT_VERSION:-latest}'"; exit 1; fi
53+
echo "version=$V" >> "$GITHUB_OUTPUT"
54+
55+
- name: Sync skills and operation catalog
56+
env:
57+
V: ${{ steps.version.outputs.version }}
58+
run: |
59+
node scripts/sync-skills.mjs "$V"
60+
node scripts/sync-mcp-tools.mjs "$V"
61+
# mcp-tools.json records the source version; a release that changes no
62+
# operation would otherwise open a PR for that one line.
63+
# shellcheck disable=SC2143
64+
if [ -z "$(git diff -U0 -- scripts/mcp-tools.json | grep '^[-+] ' | grep -v '"version":')" ]; then
65+
git checkout -- scripts/mcp-tools.json
66+
fi
67+
68+
# No early exit on an empty diff: create-pull-request then closes a stale
69+
# chore/mcp-sync PR, which is what we want once main has caught up.
70+
- name: Bump version and CHANGELOG
71+
id: bump
72+
env:
73+
V: ${{ steps.version.outputs.version }}
74+
run: |
75+
git add -A
76+
if git diff --cached --quiet; then
77+
echo "Already in sync with @hostinger/mcp $V."
78+
exit 0
79+
fi
80+
CHANGES=$(git diff --cached --name-only | sed -E \
81+
-e 's#^skills/([^/]+)/.*#\1#' \
82+
-e 's#^scripts/mcp-tools\.json$#operation catalog#' | sort -u | paste -sd, - | sed 's/,/, /g')
83+
OLD=$(jq -r .version .cursor-plugin/plugin.json)
84+
IFS=. read -r MAJOR MINOR PATCH <<< "$OLD"
85+
NEW="$MAJOR.$MINOR.$((PATCH + 1))"
86+
jq --arg v "$NEW" '.version = $v' .cursor-plugin/plugin.json > plugin.tmp
87+
mv plugin.tmp .cursor-plugin/plugin.json
88+
sed -i "s/plugin;cursor;$OLD/plugin;cursor;$NEW/g" mcp.json
89+
ENTRY="## [$NEW] - $(date -u +%F)\n\n### Changed\n\n- Synced with \`@hostinger/mcp\` $V: $CHANGES\n"
90+
awk -v e="$ENTRY" 'NR==2 { print; printf "%s\n", e; next } { print }' CHANGELOG.md > CHANGELOG.tmp
91+
mv CHANGELOG.tmp CHANGELOG.md
92+
echo "new=$NEW" >> "$GITHUB_OUTPUT"
93+
94+
- name: Open or update the sync PR
95+
uses: peter-evans/create-pull-request@v7
96+
with:
97+
token: ${{ steps.token.outputs.token }}
98+
branch: chore/mcp-sync
99+
base: main
100+
delete-branch: true
101+
sign-commits: true
102+
add-paths: .
103+
commit-message: "chore: sync with @hostinger/mcp ${{ steps.version.outputs.version }}"
104+
title: "chore: sync with @hostinger/mcp ${{ steps.version.outputs.version }}"
105+
body: |
106+
Synced with `@hostinger/mcp` ${{ steps.version.outputs.version }}; version bumped to ${{ steps.bump.outputs.new }}.
107+
If CI's check-tool-names fails, the release renamed operations the hand-written rules/agents/commands use — fix them on this branch before merging.

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.3.1] - 2026-10-02
4+
5+
### Changed
6+
7+
- MCP servers run from `@hostinger/mcp` instead of the legacy `hostinger-api-mcp` alias. Same servers and binaries.
8+
- Skills and the operation catalog synced with `@hostinger/mcp` 2.7.0.
9+
- New MCP server releases now arrive as an automated sync PR; the advisory `catalog-drift` and `skills-drift` jobs are gone.
10+
311
## [0.3.0] - 2026-09-30
412

513
Catches the plugin up with `hostinger-api-mcp` 2.5.0, which renamed every operation after the CLI commands (2.1.0) and consolidated each server to `search`, `execute` and `multi-execute` (2.0.0).

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Official Cursor plugin for [Hostinger](https://hostinger.com/) — deploy and manage Hostinger websites, WordPress, Agency Plan sites, domains, DNS, VPS, and subscriptions without leaving Cursor.
44

5-
The plugin wires the official [`hostinger-api-mcp`](https://www.npmjs.com/package/hostinger-api-mcp) servers into Cursor, plus a set of skills, rules, an agent, and a command so the agent can take real actions on your Hostinger account.
5+
The plugin wires the official [`@hostinger/mcp`](https://www.npmjs.com/package/@hostinger/mcp) servers into Cursor, plus a set of skills, rules, an agent, and a command so the agent can take real actions on your Hostinger account.
66

77
---
88

@@ -50,8 +50,8 @@ Access tokens refresh automatically, and the credentials are shared across every
5050
To sign in ahead of time, or to sign out:
5151

5252
```bash
53-
npx --package=hostinger-api-mcp@latest hostinger-hosting-mcp --login
54-
npx --package=hostinger-api-mcp@latest hostinger-hosting-mcp --logout
53+
npx --package=@hostinger/mcp@latest hostinger-hosting-mcp --login
54+
npx --package=@hostinger/mcp@latest hostinger-hosting-mcp --logout
5555
```
5656

5757
### API token (optional)
@@ -89,7 +89,7 @@ Each product area runs as its own MCP server, so you can disable areas you don't
8989
| `hostinger-ecommerce` | `hostinger-ecommerce-mcp` | 29 | Stores, products, sales channels, shipping |
9090
| `hostinger-vps` | `hostinger-vps-mcp` | 64 | Virtual machines, firewalls, snapshots, backups, SSH keys, metrics |
9191

92-
`hostinger-api-mcp` also publishes `hostinger-mail-mcp` and `hostinger-horizons-mcp`, which the plugin doesn't wire up.
92+
`@hostinger/mcp` also publishes `hostinger-mail-mcp` and `hostinger-horizons-mcp`, which the plugin doesn't wire up.
9393

9494
Operation names follow the API — `hosting_websites_list`, `dns_records_list`, `billing_subscriptions_list` — and the prefix tells you which server owns the operation. For the full catalog, see [`scripts/mcp-tools.json`](scripts/mcp-tools.json) or [hostinger/api-mcp-server](https://github.com/hostinger/api-mcp-server).
9595

@@ -159,14 +159,14 @@ node scripts/sync-skills.mjs 2.5.0
159159
node scripts/sync-skills.mjs ../public-api-generator/mcp/assets/skills
160160
```
161161

162-
`scripts/mcp-tools.json` is a checked-in snapshot of the published server's operation catalog, so `check-tool-names.mjs` runs offline in CI. `skills/` is generated the same way and is replaced wholesale on every sync. CI runs advisory jobs that flag when either has fallen behind `hostinger-api-mcp@latest`.
162+
`scripts/mcp-tools.json` is a checked-in snapshot of the published server's operation catalog, so `check-tool-names.mjs` runs offline in CI. `skills/` is generated the same way and is replaced wholesale on every sync. The `mcp-sync` workflow (daily, or on demand from the Actions tab) refreshes both from the latest `@hostinger/mcp` release and opens a `chore/mcp-sync` PR.
163163

164164
---
165165

166166
## Links
167167

168168
- MCP server source: https://github.com/hostinger/api-mcp-server
169-
- MCP server on npm: https://www.npmjs.com/package/hostinger-api-mcp
169+
- MCP server on npm: https://www.npmjs.com/package/@hostinger/mcp
170170
- Hostinger VS Code extension: https://open-vsx.org/extension/hostinger/hostinger-connector
171171
- Hostinger API docs: https://developers.hostinger.com
172172
- Hostinger: https://hostinger.com/

‎mcp.json‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22
"mcpServers": {
33
"hostinger-hosting": {
44
"command": "npx",
5-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-hosting-mcp"],
6-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
5+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-hosting-mcp"],
6+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
77
},
88
"hostinger-wordpress": {
99
"command": "npx",
10-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-wordpress-mcp"],
11-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
10+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-wordpress-mcp"],
11+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
1212
},
1313
"hostinger-agency-hosting": {
1414
"command": "npx",
15-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-agency-hosting-mcp"],
16-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
15+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-agency-hosting-mcp"],
16+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
1717
},
1818
"hostinger-domains": {
1919
"command": "npx",
20-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-domains-mcp"],
21-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
20+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-domains-mcp"],
21+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
2222
},
2323
"hostinger-dns": {
2424
"command": "npx",
25-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-dns-mcp"],
26-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
25+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-dns-mcp"],
26+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
2727
},
2828
"hostinger-billing": {
2929
"command": "npx",
30-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-billing-mcp"],
31-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
30+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-billing-mcp"],
31+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
3232
},
3333
"hostinger-reach": {
3434
"command": "npx",
35-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-reach-mcp"],
36-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
35+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-reach-mcp"],
36+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
3737
},
3838
"hostinger-ecommerce": {
3939
"command": "npx",
40-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-ecommerce-mcp"],
41-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
40+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-ecommerce-mcp"],
41+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
4242
},
4343
"hostinger-vps": {
4444
"command": "npx",
45-
"args": ["--yes", "--package=hostinger-api-mcp@latest", "hostinger-vps-mcp"],
46-
"env": { "USER_AGENT": "plugin;cursor;0.3.0" }
45+
"args": ["--yes", "--package=@hostinger/mcp@latest", "hostinger-vps-mcp"],
46+
"env": { "USER_AGENT": "plugin;cursor;0.3.1" }
4747
}
4848
}
4949
}

‎scripts/mcp-tools.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"package": "hostinger-api-mcp",
3-
"version": "2.5.0",
2+
"package": "@hostinger/mcp",
3+
"version": "2.7.0",
44
"total": 403,
55
"groups": {
66
"agency-hosting": [

‎scripts/sync-mcp-tools.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/**
3-
* Regenerate scripts/mcp-tools.json from a published hostinger-api-mcp tarball.
3+
* Regenerate scripts/mcp-tools.json from a published @hostinger/mcp tarball.
44
*
55
* node scripts/sync-mcp-tools.mjs # latest
66
* node scripts/sync-mcp-tools.mjs 1.29.0 # a specific version
@@ -16,7 +16,7 @@ import path from "node:path";
1616
import process from "node:process";
1717

1818
const version = process.argv[2] ?? "latest";
19-
const spec = `hostinger-api-mcp@${version}`;
19+
const spec = `@hostinger/mcp@${version}`;
2020
const outFile = path.join(import.meta.dirname, "mcp-tools.json");
2121

2222
const work = mkdtempSync(path.join(tmpdir(), "hostinger-mcp-tools-"));
@@ -53,7 +53,7 @@ try {
5353
const total = Object.values(groups).reduce((n, g) => n + g.length, 0);
5454
writeFileSync(
5555
outFile,
56-
`${JSON.stringify({ package: "hostinger-api-mcp", version: resolvedVersion, total, groups }, null, 2)}\n`,
56+
`${JSON.stringify({ package: "@hostinger/mcp", version: resolvedVersion, total, groups }, null, 2)}\n`,
5757
);
5858

5959
console.log(`Wrote ${path.relative(process.cwd(), outFile)}`);

‎scripts/sync-skills.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function resolveSkillsRoot() {
1616
return { root, label: root };
1717
}
1818

19-
const spec = `hostinger-api-mcp@${source}`;
19+
const spec = `@hostinger/mcp@${source}`;
2020
const packed = execFileSync("npm", ["pack", spec, "--silent", "--pack-destination", work], {
2121
encoding: "utf8",
2222
})
@@ -27,7 +27,7 @@ function resolveSkillsRoot() {
2727

2828
const pkgRoot = path.join(work, "package");
2929
const { version } = JSON.parse(readFileSync(path.join(pkgRoot, "package.json"), "utf8"));
30-
return { root: path.join(pkgRoot, "skills"), label: `hostinger-api-mcp@${version}` };
30+
return { root: path.join(pkgRoot, "skills"), label: `@hostinger/mcp@${version}` };
3131
}
3232

3333
function skillName(skillFile) {

‎skills/deploy-to-hosting/SKILL.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@ Archive rules (name archives `name_YYYYMMDD_HHMMSS.zip`):
4242
- **Node.js source:** no `node_modules/`, no build output (`dist/`, `.next/`, `build/`), no `.env*`, nothing matched by `.gitignore`; 50 MB at most. `git archive --format=zip -o app_20260101_120000.zip HEAD` produces exactly the committed files — mention that uncommitted changes are left out.
4343
- Agency deploys are synchronous: the site is live when the call returns.
4444

45+
The operations in the table read the archive from this machine, so only the local `hostinger-api-mcp` server has them. On the hosted server (`mcp.hostinger.com`) `search` does not find them — upload the files yourself as below.
46+
47+
### Without the local deploy operations
48+
49+
1. Get upload credentials: `hosting_files_generate-upload-url` (`username`, `domain`); Agency: `agency-hosting_files_generate-upload-url` (`website_uid`). Both return `url`, `auth_key` and `rest_auth_key`, which authenticate the upload instead of the API token.
50+
2. Upload each file with TUS, where `DEST` is its path in the website's storage:
51+
52+
```bash
53+
SIZE=$(wc -c < "$FILE" | tr -d ' ')
54+
curl -sS -X POST "$URL/$DEST?override=true" -H "X-Auth: $AUTH_KEY" -H "X-Auth-Rest: $REST_AUTH_KEY" -H "Tus-Resumable: 1.0.0" -H "Upload-Length: $SIZE" -H "Upload-Offset: 0"
55+
curl -sS -X PATCH "$URL/$DEST?override=true" -H "X-Auth: $AUTH_KEY" -H "X-Auth-Rest: $REST_AUTH_KEY" -H "Tus-Resumable: 1.0.0" -H "Content-Type: application/offset+octet-stream" -H "Upload-Offset: 0" --data-binary "@$FILE"
56+
```
57+
58+
The first call returns `201`, the second `204` with an `Upload-Offset` header equal to the file size. `override=true` makes a retry safe.
59+
3. Deploy from the uploaded files (`RANDOM8` is any fresh 8-character string, e.g. `$(LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | head -c 8)`):
60+
61+
| Project | `DEST` | Then |
62+
| --- | --- | --- |
63+
| Static or PHP | `site.zip` | `hosting_websites_deploy-static-site-archive` with `archive_path: "site.zip"` |
64+
| Node.js | `app.zip` | `hosting_nodejs_build-settings-from-archive` with `archive_path: "app.zip"`, then `hosting_nodejs_start-build` with those settings, `source_type: "archive"` and `source_options.archive_path: "app.zip"` |
65+
| WordPress plugin | every file, as `wp-content/plugins/SLUG-RANDOM8/<path in the plugin>` | `wordpress_plugins_deploy` with `slug` and `plugin_path: "SLUG-RANDOM8"` |
66+
| WordPress theme | every file, as `wp-content/themes/SLUG-RANDOM8/<path in the theme>` | `wordpress_themes_deploy` with `slug`, `theme_path: "SLUG-RANDOM8"` and optional `is_activated` |
67+
| Agency, extracted as-is | `.h5g/site.zip` | `agency-hosting_files_import-website-from-archive` with `archive_name: "site.zip"` |
68+
| Agency `node-static` | `.h5g/RANDOM8/app.zip` | `agency-hosting_websites_build-nodejs-assets` with `archive_path: ".h5g/RANDOM8"` — the directory, not the file |
69+
4570
## 3. Node.js builds
4671

4772
`hosting_deploy-js-application` uploads the archive to the document root, detects settings from `package.json` and starts a build. Track it with `hosting_nodejs_list-builds` and `hosting_nodejs_build` (by `uuid`), polling every 10–20 s — builds take minutes.

0 commit comments

Comments
 (0)