GC Logo
Developer Docs

Developer Resources

Scenario simulators MCP New
GoCardless CLIInstallation Testing Webhooks (CLI) About CLI gocardless gocardless analytics gocardless analytics disable gocardless analytics enable gocardless analytics status gocardless cancel gocardless completion gocardless config gocardless config current-session gocardless create gocardless delete gocardless get gocardless get creditor gocardless get customer gocardless get customer_bank_account gocardless get customer_notification gocardless get event gocardless get mandate gocardless get mandate_import gocardless get payer_authorisation gocardless get payment gocardless get payout gocardless get refund gocardless get subscription gocardless get webhook gocardless list gocardless list creditors gocardless list customer_bank_accounts gocardless list customer_notifications gocardless list customers gocardless list events gocardless list mandate_imports gocardless list mandates gocardless list payer_authorisations gocardless list payments gocardless list payouts gocardless list refunds gocardless list subscriptions gocardless list webhooks gocardless listen gocardless login gocardless mcp gocardless mcp add gocardless mcp add claude gocardless mcp add codex gocardless mcp remove gocardless mcp remove claude gocardless mcp remove codex gocardless mcp run gocardless open gocardless trigger gocardless trigger billing_request_fulfilled gocardless trigger billing_request_fulfilled_payment_failed gocardless trigger billing_request_fulfilled_payment_paid_out gocardless trigger billing_request_pending gocardless trigger mandate_activated gocardless trigger mandate_expired gocardless trigger mandate_failed gocardless trigger mandate_pending_submission gocardless trigger mandate_transferred gocardless trigger payment_chargeback_settled gocardless trigger payment_charged_back gocardless trigger payment_confirmed gocardless trigger payment_failed gocardless trigger payment_paid_out gocardless trigger payment_pending_submission gocardless trigger payment_submitted gocardless update gocardless version
Test Bank Details Testing Webhooks (Dashboard) Viewing events in the dashboard Client Libraries Postman Collection Custom Payment Page Tools Bank ID Scenario simulators

Tools: MCP

View as Markdown

Build with LLMs

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 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 that has been 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 for details.

Connect

Ensure your LLM is using the MCP

Some LLMs have a tendency to search the web instead of using an MCP. Be sure to give the LLM this prompt to ensure it is making use of the MCP:

For any prompt that mentions GoCardless, use the GoCardless MCP.

Switching environment

If or when you want to switch your connection from Sandbox to Live (or vice versa), the exact steps will vary based on which LLM/IDE you’re using but generally you must:

  1. Find the GoCardless MCP in your LLM.

  2. Disconnect from it.

  3. Connect again, following the steps above.

  4. This will trigger the sign-in journey, allowing you to choose (and sign into) the other environment.

If you are not sure which environment you are currently connected to you can ask your LLM.

What you can do with it

Where the MCP helps

  • 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 and workflows:

  • Getting started: "How do I collect recurring payments for new users that sign-up on my website using GoCardless?"

  • Code generation: "Write code in Python that creates a billing request for a £30 monthly recurring payment and redirects the user to GoCardless hosted payment pages"

  • Integration patterns: "I own a gym. How do I collect a £30 joining fee plus a £50 per month membership fee using GoCardless?"

  • Specific implementations: "Show me how to handle GoCardless webhooks in Node.js to know when a mandate becomes active"

  • Troubleshooting: "My billing request flow is failing - what are the common issues and how do I debug them?"

Query your account data

The MCP also provides read-only access to your GoCardless account. 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 — including more examples, tips, and troubleshooting — see Ask AI about your account.

Best practices

Getting the most from the MCP

  • Tell your LLM to use it: see the Ensure your LLM is using the MCP section 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.

Considerations

  • Never share your API keys with your LLM

  • Use sandbox credentials during development

  • Always review generated code before executing

  • Implement proper error handling and validation

Free & Consumer-Paid Tier LLM Privacy Notice

Using free or personal paid tiers (like "Plus" or "Pro" plans) on LLMs often means your conversations may be used for AI training, meaning your information and discussions could become part of their future datasets.

To protect yourself, review the 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, you typically need an Enterprise or Business subscription.

Questions and feedback

If you have questions, need support or have an idea for improvement please let us know here.