The Hostinger API MCP server allows you to interact with Hostinger's services programmatically through the Model Context Protocol (MCP). This server provides access to various Hostinger APIs including domains, VPS, DNS, and billing functionalities.
If you don't have Node.js installed, you can download it from the official website. Alternatively, you can use NVM to manage Node.js versions:
nvm install v20
nvm use v20
Install the MCP server using one of the following commands:
# Install globally from npm
npm install -g hostinger-api-mcp
# Or with yarn
yarn global add hostinger-api-mcp
# Or with pnpm
pnpm add -g hostinger-api-mcp
To update to the latest version:
# Update globally from npm
npm update -g hostinger-api-mcp
# Or with yarn
yarn global upgrade hostinger-api-mcp
# Or with pnpm
pnpm update -g hostinger-api-mcp
The following environment variables can be configured:
DEBUG
: Enable debug logging (true/false) (default: false)APITOKEN
: Your API token, which will be sent in the Authorization
headerYou can configure the MCP server in your application using this JSON configuration:
{
"mcpServers": {
"hostinger-api": {
"command": "hostinger-api-mcp",
"env": {
"DEBUG": "false",
"APITOKEN": "YOUR API TOKEN"
}
}
}
}
To use the MCP server with Server-Sent Events:
hostinger-api-mcp --sse --host 127.0.0.1 --port 8100
This server implements the Model Context Protocol and can be used with any MCP-compatible consumer:
import { MCP } from "claude-js";
import { createStdio } from "claude-js/mcp";
// Create stdin/stdout transport
const transport = createStdio({ command: "hostinger-api-mcp" });
// Connect to the MCP server
const mcp = new MCP({ transport });
await mcp.connect();
// List available tools
const { tools } = await mcp.listTools();
console.log("Available tools:", tools);
// Call a tool
const result = await mcp.callTool({
id: "TOOL-ID",
arguments: { param1: "value1" }
});
console.log("Tool result:", result);
The MCP server provides many tools for interacting with different Hostinger services. Here are some examples:
Each tool corresponds to a specific API endpoint and accepts various parameters to perform operations on your Hostinger account.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "hostinger-api" '{"command":"hostinger-api-mcp","env":{"DEBUG":"false","APITOKEN":"YOUR API TOKEN"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"hostinger-api": {
"command": "hostinger-api-mcp",
"env": {
"DEBUG": "false",
"APITOKEN": "YOUR API TOKEN"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"hostinger-api": {
"command": "hostinger-api-mcp",
"env": {
"DEBUG": "false",
"APITOKEN": "YOUR API TOKEN"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect