Skip to main content
Glama
README.md
# was-bunny-mcp 🐰

Production-grade, shareable **Model Context Protocol (MCP)** server for [bunny.net](https://bunny.net).

Manage your **Pull Zones (CDN)**, **Storage Zones**, **Bunny DNS**, edge cache purges, usage statistics, and execute raw REST API queries right from your AI assistant (Claude Desktop, Cursor, Antigravity, cline, etc.).

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![MCP Compliant](https://img.shields.io/badge/MCP-1.29.0-green.svg)](https://modelcontextprotocol.io/)

---

## Prerequisites

| | Required | How to install |
|---|---|---|
| **Node.js 18+** | running `npx` | Mac: `brew install node` · Windows: https://nodejs.org · Linux: `apt install nodejs npm` |
| **Git** | letting `npx` clone from GitHub | Mac: `brew install git` (or first `git --version` triggers Xcode tools) · Windows: https://git-scm.com · Linux: `apt install git` |
| **bunny.net Account** | to access CDN & DNS | [bunny.net](https://bunny.net/) |
| **Account API Key** | for authentication | Walked through below |

---

## Quick Start

### 1. Authenticate Once

Run the interactive setup via `npx`:

```bash
npx -y github:mnsmasum62786/was-bunny-mcp auth
```

You will be prompted to paste your bunny.net **Account API Key**. The key is tested against the bunny.net API immediately and securely saved at `~/.was-bunny-mcp/config.json` with strict `0600` permissions.

### 2. Connect to Your AI Assistant

Add the server to your MCP client configuration:

#### Claude Desktop (`claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "bunny": {
      "command": "npx",
      "args": ["-y", "github:mnsmasum62786/was-bunny-mcp"]
    }
  }
}
```

#### Cursor (`.cursor/mcp.json`)
```json
{
  "mcpServers": {
    "bunny": {
      "command": "npx",
      "args": ["-y", "github:mnsmasum62786/was-bunny-mcp"]
    }
  }
}
```

#### Antigravity MCP Config (`mcp_config.json`)
```json
{
  "mcpServers": {
    "bunny": {
      "command": "npx",
      "args": ["-y", "github:mnsmasum62786/was-bunny-mcp"]
    }
  }
}
```

---

## Getting Your bunny.net API Key

1. Log into your [bunny.net Dashboard](https://dash.bunny.net).
2. Click on your profile icon in the top right and select **Account Settings**.
3. Navigate to **API** in the sidebar.
4. Copy your **Account API Key**.

---

## CLI Commands

| Command | Description |
|---|---|
| `npx -y github:mnsmasum62786/was-bunny-mcp auth` | Interactive setup to enter & validate your API key |
| `npx -y github:mnsmasum62786/was-bunny-mcp status` | Check current authentication status and active profile |
| `npx -y github:mnsmasum62786/was-bunny-mcp logout` | Clear saved credentials |
| `npx -y github:mnsmasum62786/was-bunny-mcp help` | Show available CLI flags and usage information |

### Multi-Account / Multi-Profile Support

You can configure and switch between multiple bunny.net accounts (e.g. personal vs company):

```bash
# Authenticate a secondary profile
npx -y github:mnsmasum62786/was-bunny-mcp auth --profile agency

# Check profile status
npx -y github:mnsmasum62786/was-bunny-mcp status --profile agency

# Run MCP server under a specific profile
npx -y github:mnsmasum62786/was-bunny-mcp --profile agency
```

Or configure via environment variable:
```bash
export BUNNY_PROFILE=agency
# Or bypass local file storage completely in CI/CD:
export BUNNY_API_KEY="your-api-key"
```

---

## Available Tools

| Tool | Category | Description |
|---|---|---|
| `bunny_list_pull_zones` | Pull Zone | List all CDN Pull Zones with bandwidth, origins, and status. |
| `bunny_get_pull_zone` | Pull Zone | Retrieve detailed settings for a specific Pull Zone ID. |
| `bunny_create_pull_zone` | Pull Zone | Create a new Pull Zone with origin URL and pricing tiers. |
| `bunny_update_pull_zone` | Pull Zone | Update caching, headers, origins, or edge rules for a zone. |
| `bunny_purge_pull_zone` | Cache | Purge the entire edge cache for a Pull Zone. |
| `bunny_purge_url` | Cache | Purge a single specific URL or file path across the global edge. |
| `bunny_add_hostname` | Hostname | Attach a custom domain/hostname to a Pull Zone. |
| `bunny_delete_hostname` | Hostname | Detach/remove a custom hostname from a Pull Zone. |
| `bunny_list_storage_zones` | Storage | List all Storage Zones with region, storage usage, and files. |
| `bunny_get_storage_zone` | Storage | Get details and storage credentials for a Storage Zone. |
| `bunny_create_storage_zone` | Storage | Create a new Bunny Storage Zone in a selected main region. |
| `bunny_list_dns_zones` | DNS | List all DNS zones registered in Bunny DNS. |
| `bunny_get_dns_zone` | DNS | Retrieve details and all DNS records for a DNS zone. |
| `bunny_add_dns_record` | DNS | Add an A, AAAA, CNAME, TXT, MX, etc. record to a DNS zone. |
| `bunny_delete_dns_record` | DNS | Delete a DNS record by ID. |
| `bunny_get_statistics` | Analytics | Fetch bandwidth, requests, cache hit rate, and traffic metrics. |
| `bunny_api` | Universal API | Execute any arbitrary bunny.net REST API endpoint directly. |

---

## Example AI Prompts

- *"Show all my active bunny.net pull zones and their origins."*
- *"Purge the cache for `https://cdn.example.com/assets/app.js` across bunny.net."*
- *"Purge the whole cache for pull zone ID 12345."*
- *"Add a CNAME record in my DNS zone `example.com` pointing `shop` to `mystore.shopify.com`."*
- *"Check my bandwidth and cache hit rate on bunny.net for the last 7 days."*
- *"Add custom hostname `cdn.myclient.com` to pull zone 12345."*

---

## Security

- **Local-first Credential Storage:** Credentials are saved only on your local machine in `~/.was-bunny-mcp/config.json`.
- **File Permissions:** Created and updated with POSIX `0600` permissions (owner read/write only).
- **Transport Security:** All communications with bunny.net use TLS `https://api.bunny.net`.
- **Environment Bypass:** In automated/Docker environments, credentials can be passed via `BUNNY_API_KEY` without ever touching the disk.

---

## License

MIT © [Web Analytics Solution](https://github.com/mnsmasum62786)