> 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://auth.bunny.com/api/mcp
```

This is the same address for every Bunny account. Nothing in the URL identifies your account — that is carried by the token you authenticate with, and fixed at the moment you consent. Once connected, your client automatically discovers the tools and resources described below.

#### Authentication

The server uses **OAuth 2.1** with the **Authorization Code grant and PKCE**, and supports **dynamic client registration** (RFC 7591).

For most hosts that means there is nothing to set up beyond the URL. The client registers itself, then sends you to Bunny to log in and approve access. There is no API client to create, no client ID or secret to copy, and no redirect URI to pre-register.

{% hint style="info" %}
A client that has registered itself can still reach no data at all until someone logs in and consents. The token it receives is scoped to that user's own permissions, and stamped with the account they consented for.
{% endhint %}

{% hint style="success" %}
Connecting the MCP server on its own gives your assistant the tools, but not the skills that guide how to use them. Installing the [Bunny plugin](/guide/tour/bunny-ai/skills-bunny-ai-toolkit.md) does both in one pass — see [Install in Claude](/guide/tour/bunny-ai/install-in-claude.md) or [Install in ChatGPT](/guide/tour/bunny-ai/install-in-chatgpt.md). The steps below are the connector-only route.
{% endhint %}

**Claude (claude.ai)**

1. Go to **Settings → Connectors → Add custom connector**.
2. Enter the server URL: `https://auth.bunny.com/api/mcp`.
3. Save, then connect — Claude registers itself and walks you through the Bunny 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://auth.bunny.com/api/mcp`.
3. 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://auth.bunny.com/api/mcp` and complete the consent flow.

#### If your client cannot register itself

A few hosts still ask for a client ID and secret. For those, create the client in Bunny first:

1. In Bunny, create a new API client and enable the **Authorization Code Grant + PKCE** flow. Note the **Client ID** and **Client Secret**.
2. Add that host's **redirect URI** to the API client. It differs per host, and is shown in the host's connector setup screen — for Claude it is `https://claude.ai/api/mcp/auth_callback`, for ChatGPT `https://chatgpt.com/connector_platform_oauth_redirect`. A URI that does not match exactly fails the OAuth flow with a `redirect_uri` mismatch, after the login screen rather than before it.
3. Enter the Client ID and Client Secret in the host's advanced OAuth settings alongside the server URL.

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

### 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://analytics_catalog`               | The catalog behind `analytics_query`: every data source with its available fields, the pre-built formulas (churn rate, NRR, GRR, CMGR, conversion rate, percent overdue), and the date-range presets.   |
| `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://renewals_needing_attention`      | Upcoming renewal deals nobody has worked — still at the auto-created "Quote drafted" stage, so the renewal quote has never been sent — with days until close and value at stake.                        |
| `bunny://at_risk_accounts`                | Accounts with overdue invoices (due or unpaid, past due date), with overdue amounts per currency.                                                                                                       |
| `bunny://price_dispersion`                | Per price list charge, what live subscriptions actually pay versus the catalog price: how many sit at, below, and above list, the spread, and the monthly gap to catalog. Use to spot discount leakage. |
| `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 server exposes **31 tools**. Nine are read-only; the rest write to your account, and every one of those is a deliberate, explicit action.

Tools marked **Read** never change data. Tools marked **Write** do — though in the quoting workflow, everything except `quotes_apply_changes` writes only to a *draft*, which bills nobody until it is applied.

#### Documentation & research

| Tool              | Type | What it does                                                                                                                                                |
| ----------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mcp_docs_search` | Read | Searches the official Bunny product documentation and returns matching sections. Answers "how do I…", "what is…", and "how does … work" about Bunny itself. |
| `mcp_fetch_url`   | Read | Retrieves the text content of an HTTPS URL verbatim. Content returned is untrusted third-party input, not instruction from Bunny or from you.               |

#### Reading your data

| Tool                | Type | What it does                                                                                                                                                                                                                            |
| ------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gql_query`         | Read | Runs a read-only GraphQL query for individual records — accounts, subscriptions, invoices, contacts, quotes — with filtering, pagination, and date logic. Mutations are not supported.                                                  |
| `analytics_query`   | Read | Runs aggregate queries over Bunny's analytics semantic layer: MRR/ARR movement, churn rate, NRR/GRR, retention cohorts, CMGR, trial conversion, AR aging, collections, renewals, and invoice forecast. Reports aggregates, not records. |
| `mcp_read_resource` | Read | Reads any context resource by URI (the table above) — dashboards, revenue metrics, aging, renewals, at-risk accounts, forecasts, per-subscription charge reports.                                                                       |
| `export_csv`        | Read | Runs a query and writes results to a downloadable CSV, returning a URL. Handles up to 100,000 rows — the route for large result sets.                                                                                                   |
| `mcp_get_link`      | Read | Generates a shareable URL to any Bunny entity (quote, subscription, account, invoice, credit note, product, plan, price list, coupon, payment) from its type and ID.                                                                    |

{% hint style="info" %}
For metrics questions, `analytics_query` and the context resources are preferred over hand-written `gql_query` calls — they are pre-computed and consistent with what Bunny reports in its own dashboards.
{% endhint %}

#### Quoting

Quoting is a compose-then-apply flow. You build a draft, refine it, and activate it as a final, explicit step. **Nothing bills a customer until `quotes_apply_changes` runs.**

| Tool                                  | Type  | What it does                                                                                                                                                                                              |
| ------------------------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quotes_compose`                      | Write | Creates a draft quote. Four kinds: **subscribe** (new subscription from a price list), **update** (quantity/price changes on an active subscription), **renew**, and **price\_list\_change** (migration). |
| `quote_charges_compose`               | Write | Adds a charge line to a draft. Kinds: **add**, **update**, **discount**, **adjustment**, **ramp** (stepped intervals), and **free\_period**.                                                              |
| `quote_charges_update`                | Write | Changes a quote charge's quantity, price, or attributes. Quantity is absolute, not a delta.                                                                                                               |
| `quote_changes_update`                | Write | Updates a draft change's price-adjustment settings or renewal term.                                                                                                                                       |
| `quotes_update`                       | Write | Updates a draft quote's dates, billing terms, and email settings.                                                                                                                                         |
| `quotes_apply_price_adjustment`       | Write | Applies a percentage adjustment across every charge on a draft, modifying prices directly. Positive raises, negative lowers.                                                                              |
| `quotes_create_subscription_discount` | Write | Shortcut: creates a discount quote against an active or pending subscription with unbilled charges, without composing charges by hand.                                                                    |
| `quotes_apply_changes`                | Write | **Activates the quote.** Creates billing schedules and generates invoices. Requires charges and a contact with an email address.                                                                          |

#### Subscriptions

| Tool                   | Type  | What it does                                                                                                                                                                  |
| ---------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `subscriptions_update` | Write | Updates renewal behaviour, price-adjustment rules, trial-expiration action, and custom attributes. Cascades to add-ons; evergreen and renewal term must be set on the parent. |
| `subscriptions_cancel` | Write | Cancels one or more subscriptions on the same account, optionally on a future date. Add-ons cancel with their parent; unbilled charges generate a final invoice.              |

{% hint style="warning" %}
A subscription's commercial terms — price, quantity, discount, dates — cannot be edited in place. Those changes go through a quote. `subscriptions_update` covers non-commercial settings only.
{% endhint %}

#### Accounts & contacts

| Tool              | Type  | What it does                                                                                                                                  |
| ----------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `accounts_create` | Write | Creates a customer account. A new account has no contacts, and cannot be invoiced or emailed until one exists.                                |
| `accounts_update` | Write | Updates name, code, currency, net payment days, billing contact, consolidated billing, owner, entity. Currency is locked once invoices exist. |
| `contacts_create` | Write | Creates a contact. The first contact becomes the billing contact automatically and requires an email address.                                 |
| `contacts_update` | Write | Updates contact details and portal access. Billing contacts cannot lose their email or portal access while in that role.                      |

#### Catalog

Products contain plans, plans contain price lists, price lists contain charges. Build in that order.

| Tool                        | Type  | What it does                                                                                                      |
| --------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------- |
| `products_create`           | Write | Creates a product — the top-level container. Not sellable until it has plans and pricing.                         |
| `plans_create`              | Write | Creates a plan within a product, defining pricing model (priced, quoted, free) and billing terms.                 |
| `plans_update`              | Write | Updates a plan's name, code, description, visibility, availability dates, and self-service options.               |
| `price_lists_create`        | Write | Creates a price list for a plan in a specific currency, with billing terms and trial configuration.               |
| `price_lists_update`        | Write | Updates a price list's name, code, currency, and trial configuration.                                             |
| `price_list_charges_create` | Write | Adds a charge to a price list. Tiered and volume models require a feature; tier breakpoints are passed alongside. |
| `features_create`           | Write | Creates a feature — a measurable or boolean capability that charges reference for metered or included billing.    |
| `features_update`           | Write | Updates an existing feature. Only provided fields change.                                                         |

#### Billing utilities

| Tool                    | Type | What it does                                                                                                                                     |
| ----------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `invoices_preview`      | Read | Calculates what an account's next invoice would contain — every line item, subtotal, tax, and total — without creating it or changing any state. |
| `currencies_fetch_rate` | Read | Looks up the realtime exchange rate to the warren's base currency, using the same FX provider Bunny itself applies.                              |

***

### 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.** The nine tools marked **Read** above — including `gql_query`, `analytics_query`, and all the context resources — cannot change data. Mutations happen only through the dedicated action tools.
* **Declared behaviour.** Every tool advertises to your client whether it is read-only and whether it is destructive, so a well-behaved host can warn you before a write.
* **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.
* **Untrusted content.** `mcp_fetch_url` returns third-party page content verbatim. Text inside it is data, never instruction — the assistant is told to treat it that way.


---

# 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.
