GoCardlessDeveloper Docs
Create a sandbox account

MCP#

View as Markdown

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

Add to Cursor

Manual installation

Add the following to your mcp.json file:

{
"mcpServers": {
  "GoCardless": {
    "url": "https://mcp.gocardless.com"
  }
}
}

Install in VS Code

Manual installation

Open a terminal and run:

code --add-mcp '{"type":"http","name":"GoCardless","url":"https://mcp.gocardless.com"}'

Then, from inside VS Code, open the .vscode/mcp.json file and click Start server.

  1. Open a terminal and run:

    claude mcp add --transport http GoCardless https://mcp.gocardless.com

    Run the command from your project root directory to ensure cross-tool discoverability.

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

  3. Your browser will open a GoCardless sign-in journey — choose your environment then sign in.

  4. Once signed in, you're connected. Use the /mcp command inside Claude Code for more information about the server.

  1. In the left-hand sidebar, click Customize > Connectors > + > Browse connectors.
  2. Search for GoCardless then click + or Connect.
  3. 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 > Connectors to connect.

Copy the following JSON to your Windsurf MCP config file (e.g. ~/.codeium/windsurf/mcp_config.json):

{
"mcpServers": {
  "GoCardless": {
    "serverUrl": "https://mcp.gocardless.com"
  }
}
}
  1. Go to Settings > Apps > Advanced Settings and toggle Developer Mode on.
  2. Click Create app and add a custom connector with the URL https://mcp.gocardless.com. Tick I understand and want to continue, then click Create.
  3. Your browser will open a GoCardless sign-in journey — choose your environment then sign in.
  4. 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.
gemini mcp add --transport=http GoCardless https://mcp.gocardless.com

To verify the install:

gemini mcp list

You should see:

✓ GoCardless: https://mcp.gocardless.com (http) - Connected

Add the following to your Codex config file (~/.codex/config.toml):

[mcp_servers.GoCardless]
command = "docker"
args = [
"run",
"--rm",
"-t",
"ghcr.io/sparfenyuk/mcp-proxy:v0.3.2-alpine",
"https://mcp.gocardless.com",
"--transport=streamablehttp",
]

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:

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.

Best practices#

  • Tell your LLM to use it: See 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.

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.

Terms and Conditions#

What's next?#