Skip to main content
Glama

🌐 mcp-porkbun

A Model Context Protocol server for Porkbun domain registration and DNS management. Let AI agents buy domains and configure DNS — no browser required.

Python 3.11+ License: MIT MCP Porkbun API


✨ Overview

mcp-porkbun exposes Porkbun's domain registration and DNS API as MCP tools, enabling AI agents to:

  • šŸ” Check availability — look up domains and get first-year + renewal pricing

  • šŸ›’ Register domains — purchase domains programmatically

  • šŸ“‹ List domains — inventory all domains in the account

  • šŸ”§ Manage DNS — create, list, and delete any DNS record type

Originally built to power cold email infrastructure automation: an AI agent checks availability, purchases domains, and configures MX + SPF + DMARC records — all in a single workflow.


Related MCP server: namecheap-api-mcp

šŸ“‹ Prerequisites

  1. A Porkbun account

  2. A Porkbun API key and secret key — generate them at porkbun.com/account/api

  3. API access enabled per domain in the Porkbun dashboard (Domain Settings → API)

  4. Python 3.11+


šŸš€ Setup

1. Install

git clone https://github.com/keyserfaty/mcp-porkbun
cd mcp-porkbun

python -m venv .venv
source .venv/bin/activate    # Windows: .venv\Scripts\activate

pip install -e .

2. Configure Environment

export PORKBUN_API_KEY="pk1_..."
export PORKBUN_SECRET_KEY="sk1_..."

āš™ļø MCP Configuration

Add to your ~/.claude.json (or project .mcp.json):

{
  "mcpServers": {
    "porkbun": {
      "type": "stdio",
      "command": "/path/to/.venv/bin/python",
      "args": ["/path/to/mcp-porkbun/server.py"],
      "env": {
        "PORKBUN_API_KEY": "pk1_...",
        "PORKBUN_SECRET_KEY": "sk1_..."
      }
    }
  }
}

šŸ› ļø Tools Reference

Auth

Tool

Description

ping

Test credentials — returns your public IP if successful

Domain Management

Tool

Description

Key Parameters

check_domain

Check availability and pricing

domain: str

register_domain

Purchase a domain

domain, price_dollars, years?, autorenew?

list_domains

List all domains in the account

start?: int

get_domain_info

Get nameservers and status for a domain

domain: str

Typical purchase flow:

# 1. Check availability + price
result = check_domain("example.com")
# → result["available"] == True, result["price_first_year"] == "9.73"

# 2. Register using the exact price returned
register_domain("example.com", price_dollars=9.73)

āš ļø After registering, enable API access for the domain in the Porkbun dashboard (Domain → Settings → API) before making DNS calls.

DNS Management

Tool

Description

Key Parameters

get_dns_records

List records, optionally filtered

domain, record_type?, subdomain?

create_dns_record

Add a DNS record

domain, record_type, content, name?, ttl?, priority?

delete_dns_record

Delete a record by ID

domain, record_id

delete_dns_records_by_type

Bulk delete all records of a type

domain, record_type, subdomain?

Google Workspace DNS setup example:

# SPF
create_dns_record("example.com", "TXT", "v=spf1 include:_spf.google.com ~all", name="@")

# DMARC
create_dns_record("example.com", "TXT", "v=DMARC1; p=none; rua=mailto:dmarc@example.com", name="_dmarc")

# MX records
create_dns_record("example.com", "MX", "ASPMX.L.GOOGLE.COM", name="@", priority=1)
create_dns_record("example.com", "MX", "ALT1.ASPMX.L.GOOGLE.COM", name="@", priority=5)

# DKIM (after generating key in Google Workspace)
create_dns_record("example.com", "TXT", "v=DKIM1; k=rsa; p=...", name="google._domainkey")

šŸ¤– Example Agent Workflow

1. check_domain("newdomain.com")           — confirm available + get price
2. register_domain("newdomain.com", 9.73)  — purchase
3. create_dns_record(...)                  — SPF, DMARC, MX (Ɨ5), DKIM
4. get_dns_records("newdomain.com")        — verify all records are live

šŸ“ Project Structure

mcp-porkbun/
ā”œā”€ā”€ server.py       # MCP server & tool definitions
ā”œā”€ā”€ api.py          # Porkbun API helper (auth + requests)
ā”œā”€ā”€ pyproject.toml  # Package metadata & dependencies
└── README.md

šŸ¤ Contributing

Contributions welcome — especially:

  • Domain transfer tools

  • URL forwarding management

  • SSL certificate retrieval

  • Bulk operations with built-in rate limiting


šŸ“„ License

MIT Ā© Karen Serfaty


Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers