@hostinger/mcp 3.20.0 → 3.20.2

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ Generated at release time from the diff between the previous and current
4
4
  build. Tool changes are listed individually; everything else is summarised
5
5
  by area.
6
6
 
7
+ ## v3.20.2 — 2026-10-28
8
+
9
+ ### Also in this release
10
+
11
+ - OAuth sign-in flow: `src/core/oauth.js`, `src/core/oauth.ts`
12
+
13
+ ## v3.20.1 — 2026-10-28
14
+
15
+ ### Also in this release
16
+
17
+ - Request handling and authentication: `src/core/runtime.js`, `src/core/runtime.ts`
18
+
7
19
  ## v3.20.0 — 2026-10-28
8
20
 
9
21
  ### Operations
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hostinger-api-mcp",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
4
4
  "description": "Hostinger API — manage domains, DNS, hosting, VPS, billing and more from Gemini CLI.",
5
5
  "mcpServers": {
6
6
  "hostinger": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostinger/mcp",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
4
4
  "mcpName": "io.github.hostinger/hostinger-api-mcp",
5
5
  "description": "MCP server for Hostinger API",
6
6
  "repository": {
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/hostinger/api-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "3.20.0",
9
+ "version": "3.20.2",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@hostinger/mcp",
14
- "version": "3.20.0",
14
+ "version": "3.20.2",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
package/src/core/oauth.js CHANGED
@@ -2,7 +2,7 @@ import { createHash, randomBytes } from "crypto";
2
2
  import { createServer } from "http";
3
3
  import { readFile, writeFile, mkdir } from "fs/promises";
4
4
  import { existsSync, readFileSync } from "fs";
5
- import { exec } from "child_process";
5
+ import { execFile } from "child_process";
6
6
  import { fileURLToPath } from "url";
7
7
  import path from "path";
8
8
  import os from "os";
@@ -55,13 +55,41 @@ export function getEnvToken() {
55
55
  );
56
56
  }
57
57
 
58
+ /**
59
+ * The issuer must be a bare origin: https, or http only on loopback. It ends up
60
+ * in token requests and in the browser launch, so a path, query or userinfo is
61
+ * refused instead of carried along.
62
+ */
63
+ function parseIssuer(raw) {
64
+ let u;
65
+ try {
66
+ u = new URL(raw);
67
+ } catch {
68
+ throw new Error(`Invalid OAUTH_ISSUER: ${raw}`);
69
+ }
70
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(u.hostname);
71
+ const schemeOk =
72
+ u.protocol === "https:" || (u.protocol === "http:" && loopback);
73
+ if (
74
+ !schemeOk ||
75
+ u.username ||
76
+ u.password ||
77
+ u.pathname !== "/" ||
78
+ u.search ||
79
+ u.hash
80
+ ) {
81
+ throw new Error(
82
+ `Invalid OAUTH_ISSUER: ${raw} (expected an https origin such as ${DEFAULT_ISSUER})`,
83
+ );
84
+ }
85
+ return u.origin;
86
+ }
87
+
58
88
  export class OAuthProvider {
59
89
  constructor(issuerBaseUrl) {
60
- this.issuer = (
61
- issuerBaseUrl ||
62
- process.env["OAUTH_ISSUER"] ||
63
- DEFAULT_ISSUER
64
- ).replace(/\/$/, "");
90
+ this.issuer = parseIssuer(
91
+ issuerBaseUrl || process.env["OAUTH_ISSUER"] || DEFAULT_ISSUER,
92
+ );
65
93
  this._loginInProgress = null;
66
94
  }
67
95
 
@@ -387,15 +415,14 @@ export class OAuthProvider {
387
415
  process.stderr.write(
388
416
  "[OAuth] If the browser does not open, copy the URL above into one manually.\n\n",
389
417
  );
390
- let cmd;
391
- if (process.platform === "darwin") {
392
- cmd = `open "${url}"`;
393
- } else if (process.platform === "win32") {
394
- cmd = `start "" "${url}"`;
395
- } else {
396
- cmd = `xdg-open "${url}"`;
397
- }
398
- exec(cmd, (err) => {
418
+ // No shell: the URL is a single argv entry, never parsed by sh or cmd.
419
+ const [cmd, args] =
420
+ process.platform === "darwin"
421
+ ? ["open", [url]]
422
+ : process.platform === "win32"
423
+ ? ["rundll32", ["url.dll,FileProtocolHandler", url]]
424
+ : ["xdg-open", [url]];
425
+ execFile(cmd, args, (err) => {
399
426
  if (err) {
400
427
  process.stderr.write(
401
428
  `[OAuth] Could not auto-launch browser: ${err.message}\n`,
package/src/core/oauth.ts CHANGED
@@ -2,7 +2,7 @@ import { createHash, randomBytes } from 'crypto';
2
2
  import { createServer, Server } from 'http';
3
3
  import { readFile, writeFile, mkdir } from 'fs/promises';
4
4
  import { existsSync, readFileSync } from 'fs';
5
- import { exec } from 'child_process';
5
+ import { execFile } from 'child_process';
6
6
  import { fileURLToPath } from 'url';
7
7
  import path from 'path';
8
8
  import os from 'os';
@@ -68,12 +68,32 @@ export function getEnvToken(): string | undefined {
68
68
  || process.env['APITOKEN'];
69
69
  }
70
70
 
71
+ /**
72
+ * The issuer must be a bare origin: https, or http only on loopback. It ends up
73
+ * in token requests and in the browser launch, so a path, query or userinfo is
74
+ * refused instead of carried along.
75
+ */
76
+ function parseIssuer(raw: string): string {
77
+ let u: URL;
78
+ try {
79
+ u = new URL(raw);
80
+ } catch {
81
+ throw new Error(`Invalid OAUTH_ISSUER: ${raw}`);
82
+ }
83
+ const loopback = ['localhost', '127.0.0.1', '[::1]'].includes(u.hostname);
84
+ const schemeOk = u.protocol === 'https:' || (u.protocol === 'http:' && loopback);
85
+ if (!schemeOk || u.username || u.password || u.pathname !== '/' || u.search || u.hash) {
86
+ throw new Error(`Invalid OAUTH_ISSUER: ${raw} (expected an https origin such as ${DEFAULT_ISSUER})`);
87
+ }
88
+ return u.origin;
89
+ }
90
+
71
91
  export class OAuthProvider {
72
92
  private readonly issuer: string;
73
93
  private _loginInProgress: Promise<string> | null = null;
74
94
 
75
95
  constructor(issuerBaseUrl?: string) {
76
- this.issuer = (issuerBaseUrl || process.env['OAUTH_ISSUER'] || DEFAULT_ISSUER).replace(/\/$/, '');
96
+ this.issuer = parseIssuer(issuerBaseUrl || process.env['OAUTH_ISSUER'] || DEFAULT_ISSUER);
77
97
  }
78
98
 
79
99
  async getAccessToken(): Promise<string> {
@@ -357,15 +377,13 @@ export class OAuthProvider {
357
377
  private _openBrowser(url: string): void {
358
378
  process.stderr.write(`\n[OAuth] Opening browser for sign-in:\n ${url}\n`);
359
379
  process.stderr.write('[OAuth] If the browser does not open, copy the URL above into one manually.\n\n');
360
- let cmd: string;
361
- if (process.platform === 'darwin') {
362
- cmd = `open "${url}"`;
363
- } else if (process.platform === 'win32') {
364
- cmd = `start "" "${url}"`;
365
- } else {
366
- cmd = `xdg-open "${url}"`;
367
- }
368
- exec(cmd, (err) => {
380
+ // No shell: the URL is a single argv entry, never parsed by sh or cmd.
381
+ const [cmd, args]: [string, string[]] = process.platform === 'darwin'
382
+ ? ['open', [url]]
383
+ : process.platform === 'win32'
384
+ ? ['rundll32', ['url.dll,FileProtocolHandler', url]]
385
+ : ['xdg-open', [url]];
386
+ execFile(cmd, args, (err) => {
369
387
  if (err) {
370
388
  process.stderr.write(`[OAuth] Could not auto-launch browser: ${err.message}\n`);
371
389
  }
@@ -66,7 +66,7 @@ const GetSkillRequestSchema = z.object({
66
66
 
67
67
  /**
68
68
  * MCP Server for Hostinger API
69
- * Generated from OpenAPI spec version 2.5.0
69
+ * Generated from OpenAPI spec version 2.5.1
70
70
  */
71
71
  class MCPServer {
72
72
  constructor({ name, version, tools, instructions, skills = [] }) {
@@ -98,7 +98,7 @@ interface Skill { uri: string; frontmatter: Record<string, unknown>; resources:
98
98
 
99
99
  /**
100
100
  * MCP Server for Hostinger API
101
- * Generated from OpenAPI spec version 2.5.0
101
+ * Generated from OpenAPI spec version 2.5.1
102
102
  */
103
103
  class MCPServer {
104
104
  private readonly name: string;
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agency-hosting.js';
5
5
  import instructions from '../core/instructions.agency-hosting.js';
6
6
 
7
- startServer({ name: 'hostinger-agency-hosting-mcp', version: '3.20.0', tools, instructions });
7
+ startServer({ name: 'hostinger-agency-hosting-mcp', version: '3.20.2', tools, instructions });
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agency-hosting.js';
5
5
  import instructions from '../core/instructions.agency-hosting.js';
6
6
 
7
- startServer({ name: 'hostinger-agency-hosting-mcp', version: '3.20.0', tools, instructions });
7
+ startServer({ name: 'hostinger-agency-hosting-mcp', version: '3.20.2', tools, instructions });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agent-readiness.js';
5
5
 
6
- startServer({ name: 'hostinger-agent-readiness-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-agent-readiness-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agent-readiness.js';
5
5
 
6
- startServer({ name: 'hostinger-agent-readiness-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-agent-readiness-mcp', version: '3.20.2', tools });
@@ -5,4 +5,4 @@ import tools from '../core/tools/all.js';
5
5
  import instructions from '../core/instructions.js';
6
6
  import skills from '../core/skills.js';
7
7
 
8
- startServer({ name: 'hostinger-api-mcp', version: '3.20.0', tools, instructions, skills });
8
+ startServer({ name: 'hostinger-api-mcp', version: '3.20.2', tools, instructions, skills });
@@ -5,4 +5,4 @@ import tools from '../core/tools/all.js';
5
5
  import instructions from '../core/instructions.js';
6
6
  import skills from '../core/skills.js';
7
7
 
8
- startServer({ name: 'hostinger-api-mcp', version: '3.20.0', tools, instructions, skills });
8
+ startServer({ name: 'hostinger-api-mcp', version: '3.20.2', tools, instructions, skills });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/billing.js';
5
5
 
6
- startServer({ name: 'hostinger-billing-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-billing-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/billing.js';
5
5
 
6
- startServer({ name: 'hostinger-billing-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-billing-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/dns.js';
5
5
 
6
- startServer({ name: 'hostinger-dns-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-dns-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/dns.js';
5
5
 
6
- startServer({ name: 'hostinger-dns-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-dns-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/domains.js';
5
5
 
6
- startServer({ name: 'hostinger-domains-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-domains-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/domains.js';
5
5
 
6
- startServer({ name: 'hostinger-domains-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-domains-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/ecommerce.js';
5
5
 
6
- startServer({ name: 'hostinger-ecommerce-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-ecommerce-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/ecommerce.js';
5
5
 
6
- startServer({ name: 'hostinger-ecommerce-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-ecommerce-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/horizons.js';
5
5
 
6
- startServer({ name: 'hostinger-horizons-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-horizons-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/horizons.js';
5
5
 
6
- startServer({ name: 'hostinger-horizons-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-horizons-mcp', version: '3.20.2', tools });
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/hosting.js';
5
5
  import instructions from '../core/instructions.js';
6
6
 
7
- startServer({ name: 'hostinger-hosting-mcp', version: '3.20.0', tools, instructions });
7
+ startServer({ name: 'hostinger-hosting-mcp', version: '3.20.2', tools, instructions });
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/hosting.js';
5
5
  import instructions from '../core/instructions.js';
6
6
 
7
- startServer({ name: 'hostinger-hosting-mcp', version: '3.20.0', tools, instructions });
7
+ startServer({ name: 'hostinger-hosting-mcp', version: '3.20.2', tools, instructions });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/mail.js';
5
5
 
6
- startServer({ name: 'hostinger-mail-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-mail-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/mail.js';
5
5
 
6
- startServer({ name: 'hostinger-mail-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-mail-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/reach.js';
5
5
 
6
- startServer({ name: 'hostinger-reach-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-reach-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/reach.js';
5
5
 
6
- startServer({ name: 'hostinger-reach-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-reach-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/vps.js';
5
5
 
6
- startServer({ name: 'hostinger-vps-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-vps-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/vps.js';
5
5
 
6
- startServer({ name: 'hostinger-vps-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-vps-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/wordpress.js';
5
5
 
6
- startServer({ name: 'hostinger-wordpress-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-wordpress-mcp', version: '3.20.2', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/wordpress.js';
5
5
 
6
- startServer({ name: 'hostinger-wordpress-mcp', version: '3.20.0', tools });
6
+ startServer({ name: 'hostinger-wordpress-mcp', version: '3.20.2', tools });