# MCP

Source: https://docs.gocardless.com/docs/developer-resources/mcp

# MCP

The GoCardless Model Context Protocol (MCP) tool enables Large Language Models (LLMs) like Claude or Copilot to provide intelligent guidance when building GoCardless integrations. It gives your LLM deep, structured knowledge of the GoCardless API, optimal integration patterns, and code samples across all supported languages.

The MCP also lets you query your live GoCardless account data directly from your LLM — see [Query your account data](#query_your_account_data) below.

## What is MCP?

Model Context Protocol provides a standardised, machine-readable schema that allows LLMs to "understand" our API's capabilities, write code, and make API calls in a context-aware manner. You can connect your LLM to the GoCardless MCP to access up-to-date, comprehensive integration guidance optimised for LLMs.

## How it works

The GoCardless MCP provides two capabilities:

- **Integration guidance**: Your LLM can query comprehensive information about GoCardless endpoints, integration patterns, webhooks, and code samples.
- **Account data queries**: With authentication, your LLM can perform read-only lookups against your live GoCardless account — checking payment statuses, listing customers, viewing payouts, and more. See [Query your account data](#query_your_account_data) for details.

## Connect

          Add to Cursor
            Manual installationAdd the following to your mcp.jsonfile:
          ```

  }
}
```),
    },
    
>             Ctrl+Shift+P(Windows/Linux) or Cmd+Shift+P(macOS),
>             then enter Developer: Reload Window.

          Install in VS Code
            Manual installationOpen a terminal and run:```
code --add-mcp ''
```Then, from inside VS Code, open the .vscode/mcp.jsonfile and click
            Start server.
          ),
    },
    Run the command from your project root directory to ensure cross-tool
                discoverability.
              Open Claude Code and write a prompt explicitly asking it to use the GoCardless MCP
                (e.g. "Using the GoCardless MCP, show me my five most recent payouts").
                You'll be prompted to authenticate.
              Your browser will open a GoCardless sign-in journey — choose your environment then
                sign in.
              Once signed in, you're connected. Use the /mcpcommand inside Claude
                Code for more information about the server.
              ),
    },
    
              Connectors +
              Browse connectors.
            Search for GoCardlessthen click +or
              Connect.
            Your browser will open a GoCardless sign-in journey — choose your environment then
              sign in.
            If you are a member of an organisation on a Team or Enterprise plan, an Owner or Primary
            Owner must complete the above steps first. Other members can then navigate to
            Customize  Connectorsto connect.
          ),
    },
    
            ~/.codeium/windsurf/mcp_config.json):
          ```

  }
}
```),
    },
    
              Settings  Apps  Advanced Settings
              
              and toggle Developer Modeon.
            Click Create appand add a custom connector with the URL
              https://mcp.gocardless.com. Tick
              I understand and want to continue, then click Create.
            Your browser will open a GoCardless sign-in journey — choose your environment then
              sign in.
            Refresh the page. The GoCardless connector will appear as a source when starting a new
              chat (under +  … More) and in the Deep Research
              tab under Apps  Connect more.
            ),
    },
    To verify the install:```
gemini mcp list
```You should see:```
✓ GoCardless: https://mcp.gocardless.com (http) - Connected
```),
    },
    ),
    },
  ]}
/>

### Ensure your LLM is using the MCP

Some LLMs have a tendency to search the web instead of using an MCP. Add this to your prompt:

> **Info:**
> For any prompt that mentions GoCardless, use the GoCardless MCP.

### Switching environment

To switch between Sandbox and Live (or vice versa):

1. Find the GoCardless MCP in your LLM.
2. Disconnect from it.
3. Reconnect following the steps above — this triggers the sign-in journey so you can choose the other environment.

If you're unsure which environment you're currently connected to, ask your LLM.

## What you can do with it

### Integration guidance

The MCP helps with:

- **Integration development:** Generate integration code, understand API parameters, and get code samples.
- **Payment pages implementation:** Set up hosted/custom payment pages, configure redirects, and handle different payment types.
- **Best practice guidance:** On integration approaches, error handling, webhooks, security, and compliance.

Example prompts:

- _"How do I collect recurring payments for new users that sign up on my website using GoCardless?"_
- _"Write code in Python that creates a billing request for a £30 monthly recurring payment and redirects the user to GoCardless hosted payment pages."_
- _"I own a gym. How do I collect a £30 joining fee plus a £50 per month membership fee using GoCardless?"_
- _"Show me how to handle GoCardless webhooks in Node.js to know when a mandate becomes active."_
- _"My billing request flow is failing — what are the common issues and how do I debug them?"_

### Query your account data

Once signed in, your LLM can look up payments, customers, mandates, subscriptions, payouts, refunds, and events on your behalf. This is useful for quickly checking payment statuses, debugging failed payments, or reviewing recent payouts without leaving your development environment.

All queries are strictly read-only — the MCP cannot create, cancel, or modify any resources. Sensitive customer data (email addresses, phone numbers, bank details) is automatically masked in responses.

Example queries:

- _"Why did payment `PM01K44FZ685ZVKP4E6J9C3NPHJX` fail?"_
- _"Show me all confirmed payments from this month."_
- _"How much did I receive in payouts last week?"_
- _"What active subscriptions does customer `CU01KNVS3PYJVAC8ZEHKK8EBZW7K` have?"_

For a full guide to account queries, see [Ask AI about your account](https://support.gocardless.com/hc/articles/26830050176028).

## Best practices

- **Tell your LLM to use it:** See [Ensure your LLM is using the MCP](#ensure-your-llm-is-using-the-mcp) above.
- **Be specific:** Include details about your use case, industry, and payment patterns.
- **Specify language:** Mention your preferred programming language upfront.
- **Share context:** Provide relevant code or error messages when troubleshooting.
- **Iterate:** Start with basic implementation, then refine based on testing.

Using the LLM in your editor with the relevant project open is strongly recommended.

> **Warning: Security considerations**
> Never share your API keys with your LLM. Use sandbox credentials during development and always
>   review generated code before executing it.

### Free & consumer-paid tier privacy

Using free or personal paid tiers (like "Plus" or "Pro" plans) on LLMs often means your conversations may be used for AI training. Review your provider's privacy policy and look for opt-out options in your account settings. For stricter data privacy where your data is contractually excluded from training, an Enterprise or Business subscription is typically required.

## Questions and feedback

If you have questions, need support, or have an idea for improvement, [let us know here](https://docs.google.com/forms/d/e/1FAIpQLSe3PLD4_2C2CLOMBXW9p9XsfzE8-e0FKUlCnu2OIoMAcPZA5A/viewform).

## Terms and Conditions

  
#### [Live Terms](/docs/developer-resources/mcp/terms)

Terms on use in the live environment

  
#### [Sanbox Terms](/docs/developer-resources/mcp/terms-sandbox)

Terms on use in the sandbox environment

## What's next?

  
#### [GoCardless CLI](/docs/developer-resources/gc-cli)

Install and use the CLI to manage resources, stream events, and test webhooks.

  
#### [Scenario Simulators](/docs/developer-resources/scenario-simulators)

Trigger sandbox scenarios to test your integration end-to-end.