> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paynext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Connect PayNext docs and account data to AI tools like Claude, Cursor, and VS Code using the Model Context Protocol.

The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard that connects AI applications to external data sources. PayNext hosts two MCP servers:

| Server            | URL                            | Use it for                                                             | Sign-in              |
| :---------------- | :----------------------------- | :--------------------------------------------------------------------- | :------------------- |
| **Documentation** | `https://docs.paynext.com/mcp` | Searching the docs, guides, and API reference                          | Not required         |
| **Account**       | `https://mcp.paynext.com/mcp`  | Reading payments, customers, and subscriptions, plus running analytics | Sign in with PayNext |

Connect one or both. The documentation server is read-only and needs no credentials. The account server connects to your live PayNext data and requires sign-in.

## Documentation server

The documentation server lets AI tools search PayNext documentation directly instead of relying on training data or web search. You get answers from the latest docs, including new features and API changes, with relevant code examples while you work.

URL: `https://docs.paynext.com/mcp`

## Account server

The account server connects AI tools to your PayNext data. After you sign in, your tools can query and act on your account:

* `get_payments`, `get_payment_by_id`, `get_payment_timeline` — find payments and inspect a payment's full lifecycle
* `get_customers`, `get_customer_by_id` — find customers with their payment methods and subscriptions
* `payments_analytics_query` — totals, breakdowns, and rates such as revenue, acceptance rate, and declines
* `refund_payment` — refund a settled payment
* `cancel_subscription` — cancel a subscription immediately or at the end of the billing cycle
* `list_my_organizations`, `current_organization`, `set_active_organization` — choose which organization the session uses

Ask in plain language — "show last week's declined payments" or "refund payment pay\_…". Your AI tool picks the right tool and builds the query for you.

URL: `https://mcp.paynext.com/mcp`

<Warning>
  The account server reads and changes live data. The first time you connect, your browser opens to sign in to PayNext and authorize access. `refund_payment` and `cancel_subscription` change account state, so your AI tool asks for confirmation before running them.
</Warning>

## Connect to AI tools

Each example adds both servers. Drop the **PayNext** server if you only need documentation search.

<Tabs>
  <Tab title="Cursor">
    1. Press `Cmd + Shift + P` (Mac) or `Ctrl + Shift + P` (Windows) to open the command palette
    2. Search for **Open MCP settings**
    3. Select **Add custom MCP** to open `mcp.json`
    4. Add the PayNext servers:

    ```json theme={"system"}
    {
      "mcpServers": {
        "PayNext Docs": {
          "url": "https://docs.paynext.com/mcp"
        },
        "PayNext": {
          "url": "https://mcp.paynext.com/mcp"
        }
      }
    }
    ```

    5. In Cursor's chat, ask "What tools do you have available?" to verify the connection
  </Tab>

  <Tab title="VS Code">
    1. Create a `.vscode/mcp.json` file in your project
    2. Add the PayNext servers:

    ```json theme={"system"}
    {
      "servers": {
        "PayNext Docs": {
          "type": "http",
          "url": "https://docs.paynext.com/mcp"
        },
        "PayNext": {
          "type": "http",
          "url": "https://mcp.paynext.com/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude">
    1. Open Claude and navigate to **Settings → Connectors**
    2. Select **Add custom connector**
    3. Add the documentation server:
       * **Name**: PayNext Docs
       * **URL**: `https://docs.paynext.com/mcp`
    4. Select **Add custom connector** again and add the account server:
       * **Name**: PayNext
       * **URL**: `https://mcp.paynext.com/mcp`
    5. Select **Add**. For the account server, complete the PayNext sign-in when prompted
    6. When chatting, click the attachments button (plus icon) and select a PayNext server
  </Tab>

  <Tab title="Claude Code">
    Run these commands in your terminal:

    ```bash theme={"system"}
    claude mcp add --transport http paynext-docs https://docs.paynext.com/mcp
    claude mcp add --transport http paynext https://mcp.paynext.com/mcp
    ```

    Verify the connection:

    ```bash theme={"system"}
    claude mcp list
    ```
  </Tab>
</Tabs>

## Quick connect

You can also connect the documentation server from any documentation page:

1. Click the contextual menu (three dots) at the top of any page
2. Select **Connect to Cursor** or **Connect to VS Code** for one-click installation
3. Or select **Copy MCP server URL** to get the URL for other tools
