hostinger-api-mcp 0.0.32 → 0.0.33
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/README.md +53 -27
- package/package.json +1 -1
- package/server.js +2 -2
- package/server.ts +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Model Context Protocol (MCP) server for Hostinger API.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
|
-
- Node.js version
|
|
6
|
+
- Node.js version 24 or higher
|
|
7
7
|
|
|
8
8
|
If you don't have Node.js installed, you can download it from the [official website](https://nodejs.org/en/download/).
|
|
9
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.
|
|
@@ -11,8 +11,8 @@ Alternatively, you can use a package manager like [Homebrew](https://brew.sh/) (
|
|
|
11
11
|
We recommend using [NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) to install and manage installed Node.js versions.
|
|
12
12
|
After installing NVM, you can install Node.js with the following command:
|
|
13
13
|
```bash
|
|
14
|
-
nvm install
|
|
15
|
-
nvm use
|
|
14
|
+
nvm install v24
|
|
15
|
+
nvm use v24
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
@@ -49,11 +49,7 @@ pnpm update -g hostinger-api-mcp
|
|
|
49
49
|
|
|
50
50
|
The following environment variables can be configured when running the server:
|
|
51
51
|
- `DEBUG`: Enable debug logging (true/false) (default: false)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- `APITOKEN`: Your API token, which will be sent in the `Authorization` header.
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
- `API_TOKEN`: Your API token, which will be sent in the `Authorization` header.
|
|
57
53
|
|
|
58
54
|
## Usage
|
|
59
55
|
|
|
@@ -73,43 +69,73 @@ The following environment variables can be configured when running the server:
|
|
|
73
69
|
}
|
|
74
70
|
```
|
|
75
71
|
|
|
76
|
-
###
|
|
72
|
+
### Transport Options
|
|
77
73
|
|
|
78
|
-
|
|
79
|
-
This will enable the server to communicate with clients using Server-Sent Events on localhost port 8100.
|
|
80
|
-
Additionally, you can specify the `--host` and `--port` options to set the host and port for the server to listen on.
|
|
74
|
+
The MCP server supports two transport modes:
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
#### Standard I/O Transport
|
|
77
|
+
|
|
78
|
+
The server can use standard input / output (stdio) transport (default). This provides local streaming:
|
|
79
|
+
|
|
80
|
+
#### Streamable HTTP Transport
|
|
81
|
+
|
|
82
|
+
The server can use HTTP streaming transport. This provides bidirectional streaming over HTTP:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
|
|
85
|
+
# Default HTTP transport on localhost:8100
|
|
86
|
+
hostinger-api-mcp --http
|
|
87
|
+
|
|
88
|
+
# Specify custom host and port
|
|
89
|
+
hostinger-api-mcp --http --host 0.0.0.0 --port 8150
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Command Line Options
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Options:
|
|
96
|
+
--http Use HTTP streaming transport
|
|
97
|
+
--stdio Use Server-Sent Events transport (default)
|
|
98
|
+
--host {host} Hostname or IP address to listen on (default: 127.0.0.1)
|
|
99
|
+
--port {port} Port to bind to (default: 8100)
|
|
100
|
+
--help Show help message
|
|
86
101
|
```
|
|
87
102
|
|
|
88
103
|
### Using as an MCP Tool Provider
|
|
89
104
|
|
|
90
|
-
This server implements the Model Context Protocol (MCP) and can be used with any MCP-compatible consumer
|
|
105
|
+
This server implements the Model Context Protocol (MCP) and can be used with any MCP-compatible consumer.
|
|
91
106
|
|
|
92
|
-
Example of connecting to this server
|
|
107
|
+
Example of connecting to this server using HTTP streaming transport:
|
|
93
108
|
|
|
94
109
|
```javascript
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
|
|
98
|
-
// Create
|
|
99
|
-
const transport =
|
|
110
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
111
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
112
|
+
|
|
113
|
+
// Create HTTP transport
|
|
114
|
+
const transport = new StreamableHTTPClientTransport({
|
|
115
|
+
url: "http://localhost:8100/",
|
|
116
|
+
headers: {
|
|
117
|
+
"Authorization": `Bearer ${process.env.API_TOKEN}`
|
|
118
|
+
}
|
|
119
|
+
});
|
|
100
120
|
|
|
101
121
|
// Connect to the MCP server
|
|
102
|
-
const
|
|
103
|
-
|
|
122
|
+
const client = new Client({
|
|
123
|
+
name: "my-client",
|
|
124
|
+
version: "1.0.0"
|
|
125
|
+
}, {
|
|
126
|
+
capabilities: {}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
await client.connect(transport);
|
|
104
130
|
|
|
105
131
|
// List available tools
|
|
106
|
-
const { tools } = await
|
|
132
|
+
const { tools } = await client.listTools();
|
|
107
133
|
console.log("Available tools:", tools);
|
|
108
134
|
|
|
109
135
|
// Call a tool
|
|
110
|
-
const result = await
|
|
111
|
-
|
|
112
|
-
|
|
136
|
+
const result = await client.callTool({
|
|
137
|
+
name: "billing_getCatalogItemListV1",
|
|
138
|
+
arguments: { category: "DOMAIN" }
|
|
113
139
|
});
|
|
114
140
|
console.log("Tool result:", result);
|
|
115
141
|
```
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -2507,7 +2507,7 @@ class MCPServer {
|
|
|
2507
2507
|
this.server = new Server(
|
|
2508
2508
|
{
|
|
2509
2509
|
name: "hostinger-api-mcp",
|
|
2510
|
-
version: "0.0.
|
|
2510
|
+
version: "0.0.33",
|
|
2511
2511
|
},
|
|
2512
2512
|
{
|
|
2513
2513
|
capabilities: {
|
|
@@ -2532,7 +2532,7 @@ class MCPServer {
|
|
|
2532
2532
|
});
|
|
2533
2533
|
}
|
|
2534
2534
|
|
|
2535
|
-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.
|
|
2535
|
+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.33';
|
|
2536
2536
|
|
|
2537
2537
|
return headers;
|
|
2538
2538
|
}
|
package/server.ts
CHANGED
|
@@ -2528,7 +2528,7 @@ class MCPServer {
|
|
|
2528
2528
|
this.server = new Server(
|
|
2529
2529
|
{
|
|
2530
2530
|
name: "hostinger-api-mcp",
|
|
2531
|
-
version: "0.0.
|
|
2531
|
+
version: "0.0.33",
|
|
2532
2532
|
},
|
|
2533
2533
|
{
|
|
2534
2534
|
capabilities: {
|
|
@@ -2553,7 +2553,7 @@ class MCPServer {
|
|
|
2553
2553
|
});
|
|
2554
2554
|
}
|
|
2555
2555
|
|
|
2556
|
-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.
|
|
2556
|
+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.33';
|
|
2557
2557
|
|
|
2558
2558
|
return headers;
|
|
2559
2559
|
}
|