> For the complete documentation index, see [llms.txt](https://docs.bunny.com/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bunny.com/guide/tour/bunny-ai/mcp-server.md).

# MCP Server

## The Bunny MCP Server

The Bunny MCP server connects your billing platform directly to AI assistants like Claude, ChatGPT, and any other client that speaks the [Model Context Protocol](https://modelcontextprotocol.io/). Instead of clicking through screens or writing scripts against the API, you (or your team) can simply ask questions and give instructions in plain language — and the assistant works against your live Bunny data through a secure, permission-aware connection.

### What is MCP?

The Model Context Protocol is an open standard for connecting AI assistants to external systems. An MCP server exposes a set of **tools** (actions the assistant can take) and **resources** (data the assistant can read). When you connect Bunny to your assistant, it gains the ability to read your accounts, subscriptions, and revenue data, and to compose quotes, manage subscriptions, and update records — all on your behalf and within your existing permission scope.

### Why it's useful

The Bunny MCP server turns natural-language requests into real billing operations:

* **Answer questions instantly.** "What's our MRR right now?" or "Which accounts have overdue invoices?" are answered from live data, with no report-building required.
* **Drive the quoting workflow.** Compose a quote, add charges, apply a discount, and activate it — entirely through conversation.
* **Manage the subscription lifecycle.** Update renewal terms, apply price adjustments, cancel subscriptions, and migrate between price lists.
* **Maintain records.** Create and update accounts and contacts without leaving the chat.
* **Preview before you commit.** Check exactly what an account will be charged before any invoice is generated.

Because every action runs under the authenticated user's authorization scope, the assistant can only see and do what that user could do in Bunny directly. Read operations never change data, and quotes are always created in a draft state that must be explicitly applied before they take effect.

### Connecting

#### Endpoint

The Bunny MCP server is available at:

```
https://<subdomain>.bunny.com/api/mcp
```

Replace `<subdomain>` with your own Bunny subdomain (your warren). Once connected, your client automatically discovers the tools and resources described below.

#### Authentication

The server uses **OAuth 2.0** with the **Authorization Code grant and PKCE**. To connect a client you first create an API client in Bunny, then register that client's credentials and the client's redirect URI in your MCP host.

**1. Create an API client in Bunny**

In Bunny, create a new API client and enable the **Authorization Code Grant + PKCE** flow. Note the **Client ID** and **Client Secret** — you'll add these to your MCP host. You'll also add a redirect URI to this API client, which differs per host (see below).

{% hint style="warning" %}
Treat the client secret like a password. Don't commit it, log it, or share it.
{% endhint %}

**2. Add the connector in your AI client**

Most hosts add Bunny as a *custom connector*, supplying the endpoint URL and then the OAuth client credentials under an advanced settings section.

**Claude (claude.ai)**

1. Go to **Settings → Connectors → Add custom connector**.
2. Enter the server URL: `https://<subdomain>.bunny.com/api/mcp`.
3. Open **Advanced settings** and enter the **Client ID** and **Client Secret** from the API client you created in Bunny.
4. In Bunny, add this redirect URI to that API client:

```
   https://claude.ai/api/mcp/auth_callback
```

5. Save, then connect — Claude will walk you through the Bunny OAuth login and consent screen.

**ChatGPT**

Custom connectors in ChatGPT require **Developer mode** and a **Business, Enterprise, or Edu plan** — they aren't available on the Free or Plus tiers.

1. In ChatGPT, go to **Settings → Apps & Connectors → Advanced settings** and turn on **Developer mode**.
2. Back in **Apps & Connectors**, choose to create/add a connector and enter the server URL: `https://<subdomain>.bunny.com/api/mcp`.
3. Select **OAuth** authentication and enter the **Client ID** and **Client Secret** from the API client you created in Bunny.
4. In Bunny, add this redirect URI to that API client:

```
   https://chatgpt.com/connector_platform_oauth_redirect
```

5. Save, then authorize — ChatGPT will redirect you to Bunny to log in and grant access.

**Other clients**

Any MCP-compatible host that supports OAuth custom connectors will work. Point it at `https://<subdomain>.bunny.com/api/mcp`, supply the Client ID and Client Secret, and register that host's redirect URI on the Bunny API client. Check your host's documentation for its exact callback URL.

### A note on results across clients

The [Bunny AI RevOps agent and the Bunny Slack bot](/guide/tour/bunny-ai/revops-agent.md) both use the same MCP tools described here — the exact same set of tools and resources is available to any connected client. However, you may not get identical results across different clients.

Bunny's own agents are guided by extensive skills files: instructions that tell the underlying language model which tools to reach for, in what order, and how to interpret the results. A general-purpose client connected to the same MCP server has the same capabilities but lacks this guidance, so its tool choices, sequencing, and phrasing of answers may differ. The tools are the same; the strategy for using them is not.

***

### Resources

Resources are read-only data feeds the assistant can pull in for context. They're the fastest way to answer aggregate and reporting questions, and the assistant prefers them over running queries by hand. Resources are read through a single mechanism (`mcp_read_resource`) using the URIs below.

| Resource URI                              | What it provides                                                                                                                                                             |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bunny://session`                         | The current user (id, email, role, entity), the warren (subdomain, name, default currency, entities), and the current datetime. Refreshed every turn.                        |
| `bunny://resource_catalog`                | A live listing of all available context resources.                                                                                                                           |
| `bunny://mrr_arr`                         | Current MRR and ARR per currency, derived from the latest computed recurring revenue per account.                                                                            |
| `bunny://dashboard`                       | A top-line snapshot: MRR/ARR per currency, active subscription count, open invoice totals per currency, and pipeline deal counts and amounts per currency.                   |
| `bunny://aging_summary`                   | Accounts-receivable aging buckets (current, 1–30, 31–60, 61–90, 91+ days past due) per currency across all payable invoices.                                                 |
| `bunny://upcoming_renewals`               | Active evergreen subscriptions renewing within the next 90 days, sorted by days until renewal.                                                                               |
| `bunny://at_risk_accounts`                | Accounts with overdue invoices (due or unpaid, past due date), with overdue amounts per currency.                                                                            |
| `bunny://invoice_forecast`                | A pre-computed 24-month invoice forecast per account, grouped by month and currency (recurring, usage, and total).                                                           |
| `bunny://subscription/{id}/charge_report` | The full charge report for a single subscription: charges and discounts per period, with name, type, quantity, price, and subtotal. Replace `{id}` with the subscription ID. |

***

### Tools

The tools fall into six groups: querying and links, the quoting workflow, subscription management, account and contact management, catalog management, and revenue.

#### Querying & links

**`mcp_docs_search`**

Searches the official Bunny documentation and returns the relevant content. Use it to answer "how do I…", "what is…", and "how does … work" questions about Bunny's features, settings, billing, quoting, and workflows.

**`gql_query`**

Runs a read-only GraphQL query against the Bunny schema. This is the workhorse for retrieving specific records — accounts, subscriptions, invoices, contacts, plans, products, price lists, and quotes — with rich filtering, pagination, and date logic. Mutations are not supported; the tool is strictly read-only and runs under the current user's authorization scope. For aggregate and reporting questions, the resources above are preferred over hand-written queries.

**`mcp_read_resource`**

Reads any of the context resources listed above by its URI. This is the entry point for dashboards, revenue metrics, aging, renewals, at-risk accounts, forecasts, and per-subscription charge reports.

**`mcp_get_link`**

Generates a shareable URL to a Bunny entity — a quote, subscription, account, invoice, credit note, product, plan, price list, coupon, or payment — given its type and numeric ID. Useful whenever someone asks for a direct link to a record.

#### The quoting workflow

Quoting in Bunny is a compose-then-apply flow. You build up a draft quote with charges, optionally apply discounts, and then activate it as a final, explicit step.

**`quotes_compose`**

Composes a draft quote. It supports four kinds: **subscribe** (a brand-new subscription for an account from a price list), **update** (quantity or price changes on an active subscription), **renew** (a renewal draft for one or more subscriptions on the same account), and **price\_list\_change** (migrating an active subscription to a different price list). The result is always a draft that must be applied separately to take effect.

**`quote_charges_compose`**

Adds a charge line to a draft quote. The `kind` parameter determines the behaviour: **add** (a new line from a price list charge, or a carried-over subscription charge), **update** (a quantity or price override), **discount** (a discount line from a price list charge or coupon), **adjustment** (a one-off adjustment against an existing charge), **ramp** (a ramped charge structure with stepped intervals), and **free\_period** (granting free billing periods at the start or end). This is how you fine-tune what a quote contains before applying it.

**`quotes_create_subscription_discount`**

Creates a discount quote for an active or pending subscription that has unbilled charges. Optionally wraps the quote in a deal by specifying an owner. A convenient shortcut when the goal is specifically to discount an existing subscription.

**`quotes_apply_changes`**

Applies a draft quote, activating its changes on the account's subscriptions — the final step in the quoting workflow. The quote must have charges and a contact with an email address, and must not already be applied or undone. Applying creates the billing schedules and generates invoices according to the charge types and billing rules.

#### Subscription management

**`subscriptions_update`**

Updates a subscription's settings: renewal behaviour (evergreen on/off), renewal term length, price-adjustment rules (no change, a fixed percentage, or catalog-based) and their timing, what happens when a trial expires (cancel or convert), and any custom attributes. Changes cascade automatically to add-on subscriptions; evergreen and renewal term must be set on the parent rather than directly on an add-on.

**`subscriptions_cancel`**

Cancels one or more subscriptions belonging to the same account, optionally on a specified future date. Add-on subscriptions cancel automatically with their parent, and any unbilled charges at cancellation generate a final invoice.

#### Account & contact management

**`accounts_update`**

Updates an account's attributes — name, code, currency, net payment days, billing contact, consolidated billing, owner, description — and can reassign the account to a different entity. Note that currency can't be changed once an account has invoices, and consolidated billing can't be disabled while invoices are queued.

**`contacts_create`**

Creates a contact on an account. The first contact added becomes the billing contact automatically and must have an email address. Supports name, email, phone, mobile, job title, and portal access.

**`contacts_update`**

Updates a contact's details — name, email, phone, mailing address, job title, portal access, LinkedIn URL, and more. Billing contacts can't have their email removed or portal access disabled, and a billing contact must be removed from that role before being moved to another account.

#### Catalog management

**`plans_create`**

Creates a new plan within a product. Plans define the pricing model (priced, quoted, or free) and billing terms for subscriptions. Supports availability windows, self-service portal options (buy, cancel, renew), visibility, display position, a customer-facing description, internal notes, and add-on designation.

#### Revenue

**`revenue_movements_compose`**

Recomputes all revenue movements for an account from its subscription activity. It's idempotent and safe to rerun, and it never modifies or deletes manually-created revenue movement records. Useful for refreshing recognized-revenue figures after subscription changes.

**`invoices_preview`**

Previews the next invoice for an account without actually creating it. Returns every line item with amounts, plus subtotal, tax, and total. Use it to confirm exactly what will be charged before a billing run, optionally for a specific past or future billing date.

***

### Safety & permissions

* **Scoped access.** Every tool runs under the authenticated user's authorization scope. The assistant can only access records and fields that user is permitted to see.
* **Read vs. write.** `gql_query` and the resources are strictly read-only. Mutations happen only through the dedicated action tools.
* **Explicit activation.** Quotes are always composed as drafts. Nothing bills a customer until a quote is explicitly applied with `quotes_apply_changes`.
* **Preview first.** `invoices_preview` lets you verify charges before any invoice is generated.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bunny.com/guide/tour/bunny-ai/mcp-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
