Hostinger MCP
Hostinger MCP is an MCP server for Hostinger API offering tools to manage hosting, domains, billing, VPS, and WordPress deployments efficiently. It supports JSON config, HTTP/stdio transport, enabling seamless integration and automation of hosting services.
How to Install and Use Hostinger MCP
If you want to manage Hostinger services easily using code, the Hostinger MCP (Model Context Protocol) server is a great tool. It allows your applications to communicate with Hostinger’s API via a special protocol called MCP. Here's a simple guide to help you install and use Hostinger MCP step-by-step.
Step 1: Check Your Node.js Version
Before installing Hostinger MCP, you need Node.js on your computer. Make sure you have version 24 or higher. If you don’t have Node.js yet, you can get it from the official website nodejs.org.
If you want, you can also use a tool called NVM (Node Version Manager) which helps you manage multiple Node.js versions easily. Once you have NVM, run these commands in your terminal to install and use Node.js v24:
nvm install v24
nvm use v24
Step 2: Install Hostinger MCP Globally
Now that your environment is ready, you can install the Hostinger MCP server globally using your package manager. Depending on what you use, run one of these commands in your terminal:
- Using npm:
npm install -g hostinger-api-mcp
- Using yarn:
yarn global add hostinger-api-mcp
- Using pnpm:
pnpm add -g hostinger-api-mcp
This installs the MCP server as a command you can run anywhere on your computer.
Step 3: Set Up Environment Variables
Before running the server, you need to configure it with your Hostinger API token. This token is a secret key that lets the MCP talk to Hostinger APIs on your behalf. Also, you can turn on debugging if you want.
The two important environment variables are:
API_TOKEN: Your API token from Hostinger.DEBUG: Set this totrueif you want to see more detailed logs (default isfalse).
You can set these like this for example in a .env file or directly in your terminal:
export API_TOKEN=your_actual_token_here
export DEBUG=false
Step 4: Run the Hostinger MCP Server
You can start the MCP server in two ways: using standard input/output (stdio) or via HTTP streaming transport.
The default way is stdio, just run:
hostinger-api-mcp
If you want to use HTTP streaming (which allows connections over the network), run:
hostinger-api-mcp --http
To change the host or port HTTP listens on, add these options:
hostinger-api-mcp --http --host 0.0.0.0 --port 8150
Step 5: Using Hostinger MCP in Your Code
Here’s a basic example of how you can connect to the Hostinger MCP server and call a tool. This example uses JavaScript:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
// Create HTTP transport to connect to the MCP server
const transport = new StreamableHTTPClientTransport({
url: "http://localhost:8100/",
headers: {
"Authorization": `Bearer ${process.env.API_TOKEN}`
}
});
// Create a new MCP client
const client = new Client({
name: "my-client",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);
// List available tools
const { tools } = await client.listTools();
console.log("Available tools:", tools);
// Call a Hostinger billing tool as example
const result = await client.callTool({
name: "billing_getCatalogItemListV1",
arguments: { category: "DOMAIN" }
});
console.log("Tool result:", result);
This code connects to your running Hostinger MCP server and gets a list of billing catalog items.
Now you know how to install the Hostinger MCP server, configure it, run it, and start calling Hostinger’s API tools programmatically. This setup helps you automate many Hostinger services like billing, hosting, domains, and VPS management in your applications.