Loopia DNS管理MCP服务

这是一个将Loopia DNS API全部23个方法封装为MCP工具的服务,使用户可以通过Claude等MCP客户端自然语言管理域名、DNS记录、账单及经销商操作。

  • by everlof
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 everlof/mcp_loopia

使用说明

mcp-loopia

MCP server for the Loopia DNS API. Exposes all 23 Loopia API methods as MCP tools, enabling Claude (or any MCP client) to manage domains, DNS records, subdomains, billing, and reseller operations.

Prerequisites

  • Python 3.10+
  • A Loopia account with API access enabled
  • uv (recommended) or pip

Create a Loopia API user

  1. Log in to Loopia Customer Zone
  2. Go to Account Settings > LoopiaAPI
  3. Create an API user — you'll get a username (e.g. user@loopiaapi) and password

Installation

There are three ways to install, from simplest to most hands-on:

Method Requires clone? Requires PyPI publish?
PyPI (uvx mcp-loopia) No Yes
Git remote (uvx --from git+https://...) No No
Local (uv run --directory ...) Yes No

Setup

Claude Code

From PyPI (simplest, once published):

claude mcp add loopia \
  -e LOOPIA_USERNAME=user@loopiaapi \
  -e LOOPIA_PASSWORD=your_password_here \
  -- uvx mcp-loopia

From GitHub (no clone needed):

claude mcp add loopia \
  -e LOOPIA_USERNAME=user@loopiaapi \
  -e LOOPIA_PASSWORD=your_password_here \
  -- uvx --from git+https://github.com/everlof/mcp_loopia mcp-loopia

From a local clone:

git clone https://github.com/everlof/mcp_loopia.git
cd mcp_loopia
claude mcp add loopia \
  -e LOOPIA_USERNAME=user@loopiaapi \
  -e LOOPIA_PASSWORD=your_password_here \
  -- uv run --directory /path/to/mcp_loopia mcp-loopia

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

From PyPI:

{
  "mcpServers": {
    "loopia": {
      "command": "uvx",
      "args": ["mcp-loopia"],
      "env": {
        "LOOPIA_USERNAME": "user@loopiaapi",
        "LOOPIA_PASSWORD": "your_password_here"
      }
    }
  }
}

From GitHub:

{
  "mcpServers": {
    "loopia": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/everlof/mcp_loopia", "mcp-loopia"],
      "env": {
        "LOOPIA_USERNAME": "user@loopiaapi",
        "LOOPIA_PASSWORD": "your_password_here"
      }
    }
  }
}

From a local clone:

{
  "mcpServers": {
    "loopia": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mcp_loopia", "mcp-loopia"],
      "env": {
        "LOOPIA_USERNAME": "user@loopiaapi",
        "LOOPIA_PASSWORD": "your_password_here"
      }
    }
  }
}

Manual / development

git clone https://github.com/everlof/mcp_loopia.git
cd mcp_loopia

# Install and run
uv run mcp-loopia

# Or test with MCP Inspector
mcp dev src/mcp_loopia/server.py

Or skip the -e flags / env block and use a .env file instead:

cp .env.example .env
# Edit .env with your credentials

Configuration

Environment variable Description Default
LOOPIA_USERNAME Loopia API username (required)
LOOPIA_PASSWORD Loopia API password (required)
LOOPIA_API_URL XML-RPC endpoint https://api.loopia.se/RPCSERV

For Norway or Serbia, set LOOPIA_API_URL to https://api.loopia.no/RPCSERV or https://api.loopia.rs/RPCSERV.

Available tools

Domains

Tool Description
get_domains List all domains on the account
get_domain Get details for a single domain
add_domain Add a domain to the account (does not register it)
remove_domain Remove a domain from the account
domain_is_free Check if a domain is available for registration
order_domain Order (register) a domain
transfer_domain Transfer a domain to Loopia using an auth/EPP code
update_dns_servers Update the nameservers for a domain

Subdomains

Tool Description
get_subdomains List all subdomains for a domain
add_subdomain Add a subdomain to a domain
remove_subdomain Remove a subdomain from a domain

DNS records

Tool Description
get_zone_records Get all DNS zone records for a subdomain
add_zone_record Add a DNS zone record (A, AAAA, CNAME, MX, TXT, etc.)
update_zone_record Update an existing DNS zone record
remove_zone_record Remove a DNS zone record by its ID

Billing

Tool Description
get_credits_amount Get the account credit balance
get_invoice Get details for a specific invoice
get_unpaid_invoices List all unpaid invoices
pay_invoice_using_credits Pay an invoice using account credits

Reseller

Tool Description
create_new_account Create a new customer account
get_customers List all customer accounts
get_order_status Check the status of a domain order
transfer_credits_by_currency Transfer credits between customer accounts