Porkbun MCP Server

Porkbun MCP Server

Enables comprehensive domain and DNS management through the Porkbun API, including domain registration checks, DNS record operations, URL forwarding, DNSSEC configuration, and SSL certificate management. Provides 27 tools for complete domain administration through natural language interactions.

Category
访问服务器

README

Porkbun MCP Server

A production-ready Model Context Protocol (MCP) server that exposes the complete Porkbun domain and DNS management API to AI assistants like Claude and LibreChat.

Features

27 MCP Tools providing comprehensive Porkbun API access:

Authentication & General (2 tools)

  • porkbun_ping - Test API connectivity and get your IP
  • porkbun_get_pricing - Get domain pricing for all TLDs

Domain Management (4 tools)

  • porkbun_list_domains - List all domains in account
  • porkbun_check_domain - Check domain availability
  • porkbun_update_nameservers - Update nameservers at registry
  • porkbun_get_nameservers - Get current nameservers

URL Forwarding (3 tools)

  • porkbun_add_url_forward - Create URL redirects (301/302)
  • porkbun_get_url_forwarding - List URL forwards
  • porkbun_delete_url_forward - Delete URL forwards

Glue Records (4 tools)

  • porkbun_create_glue_record - Create glue records
  • porkbun_update_glue_record - Update glue records
  • porkbun_delete_glue_record - Delete glue records
  • porkbun_get_glue_records - List glue records

DNS Records (8 tools)

  • porkbun_create_dns_record - Create DNS records (A, AAAA, CNAME, MX, TXT, NS, SRV, etc.)
  • porkbun_edit_dns_record - Edit DNS record by ID
  • porkbun_edit_dns_records_by_name_type - Bulk edit by subdomain/type
  • porkbun_delete_dns_record - Delete DNS record by ID
  • porkbun_delete_dns_records_by_name_type - Bulk delete by subdomain/type
  • porkbun_retrieve_dns_records - Get all or specific DNS records
  • porkbun_retrieve_dns_records_by_name_type - Get records by subdomain/type

DNSSEC (3 tools)

  • porkbun_create_dnssec_record - Create DNSSEC records
  • porkbun_get_dnssec_records - List DNSSEC records
  • porkbun_delete_dnssec_record - Delete DNSSEC records

SSL Certificates (1 tool)

  • porkbun_retrieve_ssl_bundle - Get SSL certificate bundle

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Porkbun API credentials from porkbun.com/account/api
  • API access must be enabled for your domains in the Porkbun dashboard

Installation

  1. Clone the repository:
git clone https://github.com/myroslavtryhubets/porkbun-mcp.git
cd porkbun-mcp
  1. Create environment configuration:
make install
# Or manually:
cp .env.example .env
  1. Edit .env with your Porkbun API credentials:
PORKBUN_API_KEY=your_api_key_here
PORKBUN_SECRET_API_KEY=your_secret_api_key_here
  1. Build and start the server:
make build
make up
  1. Verify the server is running:
make test
# Or manually:
curl http://localhost:8000/health
curl http://localhost:8000/

Configuration

Environment Variables

Variable Required Default Description
PORKBUN_API_KEY Yes - Your Porkbun API key
PORKBUN_SECRET_API_KEY Yes - Your Porkbun secret API key
PORKBUN_BASE_URL No https://api.porkbun.com/api/json/v3 Porkbun API base URL
TIMEOUT No 30 Request timeout in seconds
MCP_PORT No 8000 MCP server port

Getting Porkbun API Credentials

  1. Log in to your Porkbun account
  2. Go to API Access
  3. Create API keys
  4. Enable API access for the domains you want to manage

MCP Client Configuration

LibreChat Configuration

Method 1: Environment Variable

Add to your LibreChat .env file:

MCP_SERVERS='{"porkbun":{"url":"http://localhost:8000/porkbun/mcp","name":"Porkbun Domain & DNS","type":"streamable-http","instructions":"You are an assistant with access to Porkbun domain and DNS management. Use these tools to help users manage their domains, configure DNS records, set up URL forwarding, and maintain domain security. Always confirm destructive operations before executing."}}'

Method 2: Configuration File

Add to librechat.yaml:

mcpServers:
  porkbun:
    url: "http://localhost:8000/porkbun/mcp"
    name: "Porkbun Domain & DNS"
    type: streamable-http  # Use 'type', not 'transport'
    instructions: |
      You are an assistant with access to Porkbun domain and DNS management.
      
      Available capabilities:
      - Domain management (list, check availability, nameservers)
      - DNS record management (create, edit, delete A/AAAA/CNAME/MX/TXT/etc.)
      - URL forwarding setup
      - Glue record management
      - DNSSEC configuration
      - SSL certificate retrieval
      
      Always confirm destructive operations (delete, bulk operations) with the user first.
    timeout: 120000

Claude Desktop Configuration

Add to claude_desktop_config.json:

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "porkbun": {
      "url": "http://localhost:8000/porkbun/mcp",
      "transport": "http"
    }
  }
}

Usage Examples

Example Conversations with AI Assistant

Check domain availability:

User: "Is example.com available for registration?"
Assistant: [Uses porkbun_check_domain]

List domains:

User: "Show me all my domains"
Assistant: [Uses porkbun_list_domains]

Create DNS record:

User: "Add an A record for www.example.com pointing to 1.2.3.4"
Assistant: [Uses porkbun_create_dns_record with domain="example.com", record_type="A", content="1.2.3.4", name="www"]

Set up URL forwarding:

User: "Forward old-site.com to https://new-site.com with a permanent redirect"
Assistant: [Uses porkbun_add_url_forward with domain="old-site.com", location="https://new-site.com", forward_type="permanent"]

View DNS records:

User: "What are the DNS records for example.com?"
Assistant: [Uses porkbun_retrieve_dns_records]

API Documentation

Once the server is running, access:

  • OpenAPI Documentation: http://localhost:8000/docs
  • OpenAPI JSON: http://localhost:8000/porkbun/openapi.json
  • Health Check: http://localhost:8000/health
  • Server Info: http://localhost:8000/

Development

Project Structure

porkbun-mcp/
├── src/
│   ├── __init__.py          # Package initialization
│   ├── main.py              # FastAPI app with MCP integration
│   └── models.py            # Pydantic configuration models
├── services/
│   ├── __init__.py
│   └── client.py            # Porkbun API client
├── ci/
│   └── semver.json          # Version metadata
├── Dockerfile               # Container build configuration
├── docker-compose.yml       # Service orchestration
├── requirements.txt         # Python dependencies
├── Makefile                 # Convenience commands
├── .env.example             # Environment template
├── .gitignore              # Git ignore rules
└── README.md               # This file

Makefile Commands

make help       # Show all available commands
make build      # Build Docker image
make up         # Start server
make down       # Stop server
make restart    # Restart server
make logs       # View server logs
make clean      # Remove containers and images
make test       # Test server endpoints
make install    # Create .env from template

Running Without Docker

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create .env file with your credentials
cp .env.example .env
# Edit .env with your API keys

# Run the server
python -m src.main

Logging

Logs are written to:

  • Console: Docker logs (view with make logs)
  • File: porkbun_mcp.log (inside container)

Log format:

%(asctime)s - %(name)s - %(levelname)s - %(message)s

Sensitive data (API keys) are automatically masked in logs.

Security Best Practices

  1. Never commit .env file - It contains your API credentials
  2. Restrict CORS in production - Update allow_origins in src/main.py
  3. Use HTTPS in production - Deploy behind a reverse proxy with SSL
  4. Rotate API keys regularly - Generate new keys at porkbun.com/account/api
  5. Monitor API usage - Check Porkbun dashboard for unusual activity
  6. Enable 2FA - Protect your Porkbun account with two-factor authentication

Troubleshooting

Server won't start

Check logs:

make logs

Common issues:

  • Missing API credentials in .env
  • Port 8000 already in use (change MCP_PORT in .env)
  • Invalid API keys (verify at porkbun.com/account/api)

API calls fail

Check API access:

  • Verify API access is enabled for your domains in Porkbun dashboard
  • Test with ping endpoint: curl http://localhost:8000/porkbun/mcp
  • Check that API keys have correct permissions

MCP client can't connect

LibreChat:

  • Verify type: streamable-http (not transport)
  • Check URL matches server: http://localhost:8000/porkbun/mcp
  • Restart LibreChat after configuration changes

Claude Desktop:

  • Verify transport: http in config
  • Check URL is accessible from Claude Desktop
  • Restart Claude Desktop after configuration changes

Rate Limits

Porkbun API has rate limits:

  • Domain checks: Limited (rate limit info returned in response)
  • Other operations: Generally generous limits

The server will return error messages if rate limits are exceeded.

Architecture

This MCP server follows the three-layer architecture pattern:

  1. MCP Transport Layer - FastAPI with fastapi_mcp for Streamable HTTP
  2. FastAPI Application Layer - RESTful endpoints with Pydantic validation
  3. External API Client Layer - Async httpx client for Porkbun API

Key Technologies

  • FastAPI - Modern async web framework
  • fastapi_mcp - MCP protocol integration
  • httpx - Async HTTP client
  • Pydantic - Configuration and validation
  • uvicorn - ASGI server
  • Docker - Containerization

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Copyright (c) 2025 Myroslav Tryhubets

Changelog

Version 1.0.0 (2025-10-29)

Initial release with 27 MCP tools:

  • Complete Porkbun API coverage
  • Domain management
  • DNS record operations
  • URL forwarding
  • Glue records
  • DNSSEC support
  • SSL certificate retrieval
  • Docker deployment
  • LibreChat and Claude Desktop support

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选