hostinger-api-mcp 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,53 @@
1
+ name: publish-release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ npmjs:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '20.x'
20
+ registry-url: 'https://registry.npmjs.org'
21
+
22
+ - name: Install dependencies
23
+ run: npm install
24
+
25
+ - name: Publish package
26
+ run: npm publish --provenance --access public
27
+ env:
28
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29
+
30
+ github:
31
+ runs-on: ubuntu-latest
32
+ permissions:
33
+ contents: read
34
+ id-token: write
35
+ packages: write
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - uses: actions/setup-node@v4
40
+ with:
41
+ node-version: '20.x'
42
+ registry-url: 'https://npm.pkg.github.com'
43
+ scope: '@hostinger'
44
+
45
+ - name: Install dependencies
46
+ run: npm install
47
+
48
+ - name: Publish package
49
+ run: |
50
+ sed -i 's+"name": ".*+"name": "@${{ github.repository }}",+gI' ./package.json
51
+ npm publish --provenance --access public
52
+ env:
53
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/README.md CHANGED
@@ -2,10 +2,47 @@
2
2
 
3
3
  Model Context Protocol (MCP) server for Hostinger API.
4
4
 
5
+ ## Prerequisites
6
+ - Node.js version 20 or higher
7
+
8
+ If you don't have Node.js installed, you can download it from the [official website](https://nodejs.org/en/download/).
9
+ Alternatively, you can use a package manager like [Homebrew](https://brew.sh/) (for macOS) or [Chocolatey](https://chocolatey.org/) (for Windows) to install Node.js.
10
+
11
+ We recommend using [NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) to install and manage installed Node.js versions.
12
+ After installing NVM, you can install Node.js with the following command:
13
+ ```bash
14
+ nvm install v20
15
+ nvm use v20
16
+ ```
17
+
5
18
  ## Installation
6
19
 
20
+ To install the MCP server, run one of the following command, depending on your package manager:
21
+
7
22
  ```bash
8
- npm install hostinger-api-mcp -g
23
+ # Install globally from npm
24
+ npm install -g hostinger-api-mcp
25
+
26
+ # Or with yarn
27
+ yarn global add hostinger-api-mcp
28
+
29
+ # Or with pnpm
30
+ pnpm add -g hostinger-api-mcp
31
+ ```
32
+
33
+ ## Update
34
+
35
+ To update the MCP server to the latest version, use one of the following commands, depending on your package manager:
36
+
37
+ ```bash
38
+ # Update globally from npm
39
+ npm update -g hostinger-api-mcp
40
+
41
+ # Or with yarn
42
+ yarn global upgrade hostinger-api-mcp
43
+
44
+ # Or with pnpm
45
+ pnpm update -g hostinger-api-mcp
9
46
  ```
10
47
 
11
48
  ## Configuration
@@ -151,6 +188,66 @@ This endpoint retrieves a list of all subscriptions associated with your account
151
188
 
152
189
 
153
190
 
191
+ ### DNS_getSnapshotV1
192
+
193
+ This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
194
+
195
+ - **Method**: `GET`
196
+ - **Path**: `/api/dns/v1/snapshots/{domain}/{snapshotId}`
197
+
198
+ **Parameters**:
199
+
200
+ - `domain`: Domain name (required)
201
+ - `snapshotId`: Snapshot ID (required)
202
+
203
+ ### DNS_restoreSnapshotV1
204
+
205
+ This endpoint restores DNS zone to the selected snapshot.
206
+
207
+ - **Method**: `POST`
208
+ - **Path**: `/api/dns/v1/snapshots/{domain}/{snapshotId}`
209
+
210
+ **Parameters**:
211
+
212
+ - `domain`: Domain name (required)
213
+ - `snapshotId`: Snapshot ID (required)
214
+
215
+ ### DNS_getSnapshotListV1
216
+
217
+ This endpoint retrieves list of DNS snapshots.
218
+
219
+ - **Method**: `GET`
220
+ - **Path**: `/api/dns/v1/snapshots/{domain}`
221
+
222
+ **Parameters**:
223
+
224
+ - `domain`: Domain name (required)
225
+
226
+ ### DNS_getRecordsV1
227
+
228
+ This endpoint retrieves DNS zone records for a specific domain.
229
+
230
+ - **Method**: `GET`
231
+ - **Path**: `/api/dns/v1/zones/{domain}`
232
+
233
+ **Parameters**:
234
+
235
+ - `domain`: Domain name (required)
236
+
237
+ ### DNS_resetZoneRecordsV1
238
+
239
+ This endpoint resets DNS zone to the default records.
240
+
241
+ - **Method**: `POST`
242
+ - **Path**: `/api/dns/v1/zones/{domain}/reset`
243
+
244
+ **Parameters**:
245
+
246
+ - `domain`: Domain name (required)
247
+ - `sync`: Determines if operation should be run synchronously
248
+ - `reset_email_records`: Determines if email records should be reset
249
+ - `whitelisted_record_types`: Specifies which record types to not reset
250
+
154
251
  ### domains_getDomainListV1
155
252
 
156
253
  This endpoint retrieves a list of all domains associated with your account.
package/build.js ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { exec } from 'child_process';
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ // Get proper paths for ES modules
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ // Ensure dist directory exists
13
+ if (!fs.existsSync('./dist')) {
14
+ fs.mkdirSync('./dist');
15
+ }
16
+
17
+ // Run TypeScript compiler
18
+ console.log('Compiling TypeScript...');
19
+ exec('npx tsc', (error, stdout, stderr) => {
20
+ if (error) {
21
+ console.error('Error compiling TypeScript:', error);
22
+ console.error(stderr);
23
+ process.exit(1);
24
+ }
25
+
26
+ if (stdout) {
27
+ console.log(stdout);
28
+ }
29
+
30
+ console.log('TypeScript compilation successful');
31
+
32
+ // Copy .env.example to dist
33
+ try {
34
+ if (fs.existsSync('./.env.example')) {
35
+ fs.copyFileSync('./.env.example', './dist/.env.example');
36
+ console.log('Copied .env.example to dist directory');
37
+ }
38
+
39
+ if (fs.existsSync('./README.md')) {
40
+ fs.copyFileSync('./README.md', './dist/README.md');
41
+ console.log('Copied README.md to dist directory');
42
+ }
43
+
44
+ // Create package.json in dist
45
+ const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
46
+ packageJson.main = 'server.js';
47
+ fs.writeFileSync('./dist/package.json', JSON.stringify(packageJson, null, 2));
48
+ console.log('Created package.json in dist directory');
49
+
50
+ console.log('Build completed successfully');
51
+ } catch (err) {
52
+ console.error('Error copying files:', err);
53
+ process.exit(1);
54
+ }
55
+ });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "hostinger-api-mcp",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "MCP server for Hostinger API",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/hostinger/api-mcp-server.git"
8
8
  },
9
+ "license": "MIT",
9
10
  "keywords": [
10
11
  "hostinger",
11
12
  "mcp",