GuidesAPI ReferenceChangelog
Log In
Guides

Model Context Protocol (MCP)

Enable AI agent interactions with the Moneris API using MCP

Overview

The Moneris Model Context Protocol (MCP) server exposes tools that MCP-compatible AI agents can use to interact with the Moneris APIs for payment processing, customer management, subscriptions, and more.

If you use an AI-powered code editor like Cursor, VS Code, or Claude Code, you can connect it to the Moneris MCP server. The same goes for general-purpose tools like GitHub Copilot and Claude.

Remote server

Moneris hosts a streamable HTTP MCP server at:

  • Sandbox: https://mcp.sb.moneris.io/
  • Production: https://mcp.moneris.io/

By the end of this guide, your agent will make authenticated requests to the Moneris API.

Prerequisites

  • A Moneris merchant account with API access.
  • Your Moneris API credentials (API key and Merchant ID).
  • MCP-compatible AI-powered tools such as: Cursor, VS Code, Claude.

Step 1: Configure the Moneris MCP server in your editor

Before your AI agent can interact with the Moneris API, it needs to know where the MCP server lives. This step registers the remote Moneris MCP server with your editor so all subsequent tool calls route through it.

Add the Moneris MCP server configuration to your editor. The Moneris remote MCP server is hosted at https://mcp.sb.moneris.io/.

Add the following to your ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "moneris": {
      "url": "https://mcp.sb.moneris.io/",
      "headers": {
        "x-api-key": "${env:MONERIS_API_KEY}",
        "x-merchant-id": "${env:MONERIS_MERCHANT_ID}"
      }
    }
  }
}

To learn more, see the Cursor MCP documentation.

Step 2: Process your first payment with an AI agent

This scenario walks through creating a customer and processing a basic payment using your AI agent and the Moneris MCP server.

Prerequisites

  • Step 1 completed.
  • A valid stored payment method ID, created outside of MCP, LLM, or agent interactions.

2.1 Create a customer (optional)

Example prompt: Create a customer with the first name Jane, last name Doe, and email [email protected].

Expected output: Customer ID.

2.2 Create a payment

Example prompt: Create a CAD payment for $10.00 using stored payment method ID <STORED_PAYMENT_METHOD_ID> and capture it automatically.

Expected output: Payment ID.

Additional notes

  • Payments are processed immediately when automaticCapture is set to true.
  • Enable human confirmation for payment-related tools.

Security considerations

  • Raw card data. Never pass raw card data in chat messages or to LLMs / agents.
  • MCP server scope. The Moneris MCP server doesn't request or expect raw card data.
  • Stored payment methods. Use Moneris stored payment method IDs instead of raw card data.
  • Credentials in chat. Avoid passing Merchant IDs or API keys in chat messages.
  • Hardcoded secrets. Never hardcode secrets in source code or version control.
  • Environment separation. Always use sandbox credentials for development and testing.
  • Tool confirmation. Enable human confirmation for payment-related tools in production.
  • HTTPS. Always use HTTPS in production environments.

Error handling

The MCP server returns errors for:

  • Network connectivity issues
  • Authentication failures
  • Invalid request parameters
  • API rate limiting
  • Server errors

Errors are returned in a consistent JSON-RPC format with a descriptive message field to help with debugging.

Available tools

The server exposes the following MCP tools for interacting with the Moneris API. We recommend enabling human confirmation for tools and exercising caution when combining the Moneris MCP server with other MCP servers to avoid unintended transactions.

ResourceToolDescription
Paymentscreate_paymentCreate a payment using a payment method ID only
retrieve_paymentRetrieve a payment by ID
list_paymentsList payments with pagination and filtering
cancel_paymentCancel a payment
complete_paymentComplete a payment (for two-step transactions)
Refundsretrieve_refundRetrieve a refund by ID
list_refundsList refunds with pagination and filtering
Payment methodsretrieve_payment_methodRetrieve a payment method by ID
list_payment_methodsList payment methods with pagination
Card validationretrieve_card_validationRetrieve card validation results
list_card_validationsList card validations with pagination
Customerscreate_customerCreate a new customer
retrieve_customerRetrieve customer details by ID
list_customersList customers with pagination and filtering
Multi-currency pricingmcpRateLock exchange rates for multi-currency payments or refunds
getMultiCurrencyPricingRateByIdRetrieve the locked MCP rate details by lookup ID
Subscriptionslist_subscriptionsRetrieves a list of subscriptions
retrieve_subscriptionRetrieve subscription details by subscription ID
Surchargesurcharge_lookupPerforms a surcharge lookup to determine if a payment method is eligible for surcharge

Support

For issues related to:

  • Moneris API: Contact Moneris support or refer to the Moneris Developer Portal.
  • MCP server: Check the server logs and ensure proper configuration. Contact [email protected] for any product feedback.
  • Integration: Verify your API credentials and network connectivity.

See also