Skip to content

Commit 0e5a52e

Browse files
committed
chore: mcp server update
1 parent 0c0baf2 commit 0e5a52e

File tree

5 files changed

+63
-37
lines changed

5 files changed

+63
-37
lines changed

README.md

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Model Context Protocol (MCP) server for Hostinger API.
44

55
## Prerequisites
6-
- Node.js version 20 or higher
6+
- Node.js version 24 or higher
77

88
If you don't have Node.js installed, you can download it from the [official website](https://nodejs.org/en/download/).
99
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.
1010

1111
We recommend using [NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) to install and manage installed Node.js versions.
1212
After installing NVM, you can install Node.js with the following command:
1313
```bash
14-
nvm install v20
15-
nvm use v20
14+
nvm install v24
15+
nvm use v24
1616
```
1717

1818
## Installation
@@ -49,11 +49,7 @@ pnpm update -g hostinger-api-mcp
4949

5050
The following environment variables can be configured when running the server:
5151
- `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.
5753

5854
## Usage
5955

@@ -73,43 +69,73 @@ The following environment variables can be configured when running the server:
7369
}
7470
```
7571

76-
### Using SSE Transport
72+
### Transport Options
7773

78-
To use the MCP server with SSE transport, you must run the server with the `--sse` option.
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:
8175

82-
Example of running the server with SSE transport:
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:
8383

8484
```bash
85-
hostinger-api-mcp --sse --host 127.0.0.1 --port 8100
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
86101
```
87102

88103
### Using as an MCP Tool Provider
89104

90-
This server implements the Model Context Protocol (MCP) and can be used with any MCP-compatible consumer, like Claude.js client or other MCP consumers.
105+
This server implements the Model Context Protocol (MCP) and can be used with any MCP-compatible consumer.
91106

92-
Example of connecting to this server from a Claude.js client:
107+
Example of connecting to this server using HTTP streaming transport:
93108

94109
```javascript
95-
import { MCP } from "claude-js";
96-
import { createStdio } from "claude-js/mcp";
97-
98-
// Create stdin/stdout transport
99-
const transport = createStdio({ command: "hostinger-api-mcp" });
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+
});
100120

101121
// Connect to the MCP server
102-
const mcp = new MCP({ transport });
103-
await mcp.connect();
122+
const client = new Client({
123+
name: "my-client",
124+
version: "1.0.0"
125+
}, {
126+
capabilities: {}
127+
});
128+
129+
await client.connect(transport);
104130

105131
// List available tools
106-
const { tools } = await mcp.listTools();
132+
const { tools } = await client.listTools();
107133
console.log("Available tools:", tools);
108134

109135
// Call a tool
110-
const result = await mcp.callTool({
111-
id: "TOOL-ID",
112-
arguments: { param1: "value1" }
136+
const result = await client.callTool({
137+
name: "billing_getCatalogItemListV1",
138+
arguments: { category: "DOMAIN" }
113139
});
114140
console.log("Tool result:", result);
115141
```

package-lock.json

Lines changed: 5 additions & 5 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.0.32",
3+
"version": "0.0.33",
44
"description": "MCP server for Hostinger API",
55
"repository": {
66
"type": "git",

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,7 +2507,7 @@ class MCPServer {
25072507
this.server = new Server(
25082508
{
25092509
name: "hostinger-api-mcp",
2510-
version: "0.0.32",
2510+
version: "0.0.33",
25112511
},
25122512
{
25132513
capabilities: {
@@ -2532,7 +2532,7 @@ class MCPServer {
25322532
});
25332533
}
25342534

2535-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.32';
2535+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.33';
25362536

25372537
return headers;
25382538
}

server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,7 +2528,7 @@ class MCPServer {
25282528
this.server = new Server(
25292529
{
25302530
name: "hostinger-api-mcp",
2531-
version: "0.0.32",
2531+
version: "0.0.33",
25322532
},
25332533
{
25342534
capabilities: {
@@ -2553,7 +2553,7 @@ class MCPServer {
25532553
});
25542554
}
25552555

2556-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.32';
2556+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.33';
25572557

25582558
return headers;
25592559
}

0 commit comments

Comments
 (0)