Skip to content

Commit d835ec2

Browse files
committed
Add --version and -v flags to generated MCP runtime (hostinger#24)
1 parent 2fcf565 commit d835ec2

18 files changed

Lines changed: 34 additions & 19 deletions

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger-api-mcp",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "MCP server for Hostinger API",
55
"repository": {
66
"type": "git",

src/core/runtime.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2066,10 +2066,16 @@ class MCPServer {
20662066
export async function startServer({ name, version, tools }) {
20672067
const argv = minimist(process.argv.slice(2), {
20682068
string: ['host'],
2069-
boolean: ['stdio', 'http', 'help', 'login', 'logout'],
2069+
boolean: ['stdio', 'http', 'help', 'version', 'login', 'logout'],
2070+
alias: { v: 'version' },
20702071
default: { host: '127.0.0.1', port: 8100, stdio: true }
20712072
});
20722073

2074+
if (argv.version) {
2075+
console.log(version);
2076+
process.exit(0);
2077+
}
2078+
20732079
if (argv.help) {
20742080
console.log(`
20752081
${name}
@@ -2081,6 +2087,7 @@ export async function startServer({ name, version, tools }) {
20812087
--port <port> Port to bind to (default: 8100)
20822088
--login Run OAuth sign-in flow and exit
20832089
--logout Revoke stored OAuth credentials and exit
2090+
--version, -v Show version number
20842091
--help Show this help message
20852092
Environment Variables:
20862093
HOSTINGER_API_TOKEN Hostinger API token (overrides OAuth when set)

src/core/runtime.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,9 +2104,16 @@ class MCPServer {
21042104
export async function startServer({ name, version, tools }: { name: string; version: string; tools: OpenApiTool[] }): Promise<void> {
21052105
const argv = minimist(process.argv.slice(2), {
21062106
string: ['host'],
2107-
boolean: ['stdio', 'http', 'help', 'login', 'logout'],
2107+
boolean: ['stdio', 'http', 'help', 'version', 'login', 'logout'],
2108+
alias: { v: 'version' },
21082109
default: { host: '127.0.0.1', port: 8100, stdio: true }
21092110
});
2111+
2112+
if (argv.version) {
2113+
console.log(version);
2114+
process.exit(0);
2115+
}
2116+
21102117
if (argv.help) {
21112118
console.log(`
21122119
${name}
@@ -2118,6 +2125,7 @@ export async function startServer({ name, version, tools }: { name: string; vers
21182125
--port <port> Port to bind to (default: 8100)
21192126
--login Run OAuth sign-in flow and exit
21202127
--logout Revoke stored OAuth credentials and exit
2128+
--version, -v Show version number
21212129
--help Show this help message
21222130
Environment Variables:
21232131
HOSTINGER_API_TOKEN Hostinger API token (overrides OAuth when set)

src/servers/all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/all.js';
55

6-
startServer({ name: 'hostinger-api-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-api-mcp', version: '0.2.8', tools });

src/servers/all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/all.js';
55

6-
startServer({ name: 'hostinger-api-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-api-mcp', version: '0.2.8', tools });

src/servers/billing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/billing.js';
55

6-
startServer({ name: 'hostinger-billing-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-billing-mcp', version: '0.2.8', tools });

src/servers/billing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/billing.js';
55

6-
startServer({ name: 'hostinger-billing-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-billing-mcp', version: '0.2.8', tools });

src/servers/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/dns.js';
55

6-
startServer({ name: 'hostinger-dns-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-dns-mcp', version: '0.2.8', tools });

src/servers/dns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { startServer } from '../core/runtime.js';
44
import tools from '../core/tools/dns.js';
55

6-
startServer({ name: 'hostinger-dns-mcp', version: '0.2.7', tools });
6+
startServer({ name: 'hostinger-dns-mcp', version: '0.2.8', tools });

0 commit comments

Comments
 (0)