All checks were successful
Build and Push Docker Image / build (push) Successful in 1m32s
- 3 specific tools: ping, list_domains, list_dns_records - 1 pass-through tool: porkbun_api for full API access - Safety system with READ/WRITE/INFRA access levels - Embedded API documentation as MCP resource - Starlette wrapper with /health endpoint - Gitea Actions CI workflow for Docker build
82 lines
2.0 KiB
Markdown
82 lines
2.0 KiB
Markdown
# Porkbun DNS MCP
|
|
|
|
A lightweight MCP server for managing DNS records via the Porkbun API.
|
|
|
|
## Features
|
|
|
|
- **3 specific tools** for common operations (ping, list domains, list DNS records)
|
|
- **1 pass-through tool** for full API access
|
|
- **Safety system** with READ/WRITE/INFRA access levels
|
|
- **Embedded API documentation** as MCP resource
|
|
|
|
## Safety Levels
|
|
|
|
| Level | Operations | Environment Variable |
|
|
|-------|-----------|---------------------|
|
|
| READ | List domains, retrieve records, ping | Default |
|
|
| WRITE | Create/edit/delete DNS records, DNSSEC | `PORKBUN_ALLOW_WRITES=true` |
|
|
| INFRA | Nameserver changes, glue records | `PORKBUN_ALLOW_INFRA=true` |
|
|
|
|
## Quick Start
|
|
|
|
### Local Development
|
|
|
|
```bash
|
|
# Create .env from template
|
|
cp .env.example .env
|
|
|
|
# Add your Porkbun API keys to .env
|
|
# Get keys at: https://porkbun.com/account/api
|
|
|
|
# Install dependencies
|
|
uv pip install -e .
|
|
|
|
# Run server
|
|
python server.py
|
|
```
|
|
|
|
### Docker
|
|
|
|
```bash
|
|
docker run -d \
|
|
-e PORKBUN_API_KEY=pk1_xxx \
|
|
-e PORKBUN_SECRET_KEY=sk1_xxx \
|
|
-e PORKBUN_ALLOW_WRITES=false \
|
|
-p 8000:8000 \
|
|
gitea.ext.ben.io/b3nw/porkbun-dns-mcp:latest
|
|
```
|
|
|
|
## MCP Tools
|
|
|
|
### `ping`
|
|
Test API connectivity and return your public IP address.
|
|
|
|
### `list_domains`
|
|
List all domains in your Porkbun account.
|
|
|
|
### `list_dns_records`
|
|
Retrieve DNS records for a specific domain.
|
|
|
|
### `porkbun_api`
|
|
Execute any Porkbun API call. Refer to the `porkbun://api-reference` resource for endpoint documentation.
|
|
|
|
## MCP Resources
|
|
|
|
- `porkbun://api-reference` - Full API documentation
|
|
- `porkbun://safety-status` - Current safety configuration
|
|
|
|
## Configuration
|
|
|
|
| Variable | Required | Default | Description |
|
|
|----------|----------|---------|-------------|
|
|
| `PORKBUN_API_KEY` | Yes | - | Porkbun API key |
|
|
| `PORKBUN_SECRET_KEY` | Yes | - | Porkbun secret key |
|
|
| `PORKBUN_ALLOW_WRITES` | No | `false` | Enable write operations |
|
|
| `PORKBUN_ALLOW_INFRA` | No | `false` | Enable infrastructure changes |
|
|
| `PORT` | No | `8000` | Server port |
|
|
|
|
## Endpoints
|
|
|
|
- `GET /health` - Health check
|
|
- `POST /mcp/` - MCP SSE endpoint
|