@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 +12 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/core/oauth.js +42 -15
- package/src/core/oauth.ts +29 -11
- package/src/core/runtime.js +1 -1
- package/src/core/runtime.ts +1 -1
- package/src/servers/agency-hosting.js +1 -1
- package/src/servers/agency-hosting.ts +1 -1
- package/src/servers/agent-readiness.js +1 -1
- package/src/servers/agent-readiness.ts +1 -1
- package/src/servers/all.js +1 -1
- package/src/servers/all.ts +1 -1
- package/src/servers/billing.js +1 -1
- package/src/servers/billing.ts +1 -1
- package/src/servers/dns.js +1 -1
- package/src/servers/dns.ts +1 -1
- package/src/servers/domains.js +1 -1
- package/src/servers/domains.ts +1 -1
- package/src/servers/ecommerce.js +1 -1
- package/src/servers/ecommerce.ts +1 -1
- package/src/servers/horizons.js +1 -1
- package/src/servers/horizons.ts +1 -1
- package/src/servers/hosting.js +1 -1
- package/src/servers/hosting.ts +1 -1
- package/src/servers/mail.js +1 -1
- package/src/servers/mail.ts +1 -1
- package/src/servers/reach.js +1 -1
- package/src/servers/reach.ts +1 -1
- package/src/servers/vps.js +1 -1
- package/src/servers/vps.ts +1 -1
- package/src/servers/wordpress.js +1 -1
- package/src/servers/wordpress.ts +1 -1
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
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
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.
|
|
9
|
+
"version": "3.20.2",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@hostinger/mcp",
|
|
14
|
-
"version": "3.20.
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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 {
|
|
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)
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
}
|
package/src/core/runtime.js
CHANGED
|
@@ -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.
|
|
69
|
+
* Generated from OpenAPI spec version 2.5.1
|
|
70
70
|
*/
|
|
71
71
|
class MCPServer {
|
|
72
72
|
constructor({ name, version, tools, instructions, skills = [] }) {
|
package/src/core/runtime.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
6
|
+
startServer({ name: 'hostinger-agent-readiness-mcp', version: '3.20.2', tools });
|
package/src/servers/all.js
CHANGED
|
@@ -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.
|
|
8
|
+
startServer({ name: 'hostinger-api-mcp', version: '3.20.2', tools, instructions, skills });
|
package/src/servers/all.ts
CHANGED
|
@@ -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.
|
|
8
|
+
startServer({ name: 'hostinger-api-mcp', version: '3.20.2', tools, instructions, skills });
|
package/src/servers/billing.js
CHANGED
package/src/servers/billing.ts
CHANGED
package/src/servers/dns.js
CHANGED
package/src/servers/dns.ts
CHANGED
package/src/servers/domains.js
CHANGED
package/src/servers/domains.ts
CHANGED
package/src/servers/ecommerce.js
CHANGED
package/src/servers/ecommerce.ts
CHANGED
package/src/servers/horizons.js
CHANGED
package/src/servers/horizons.ts
CHANGED
package/src/servers/hosting.js
CHANGED
|
@@ -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.
|
|
7
|
+
startServer({ name: 'hostinger-hosting-mcp', version: '3.20.2', tools, instructions });
|
package/src/servers/hosting.ts
CHANGED
|
@@ -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.
|
|
7
|
+
startServer({ name: 'hostinger-hosting-mcp', version: '3.20.2', tools, instructions });
|
package/src/servers/mail.js
CHANGED
package/src/servers/mail.ts
CHANGED
package/src/servers/reach.js
CHANGED
package/src/servers/reach.ts
CHANGED
package/src/servers/vps.js
CHANGED
package/src/servers/vps.ts
CHANGED
package/src/servers/wordpress.js
CHANGED
package/src/servers/wordpress.ts
CHANGED