payments-mcp

v0.2.0-beta.0
@easypaypt/payments-mcp Checked 2 days ago Published 22 days ago

MCP server for Easypay Payments API

MCP (Model Context Protocol) server that connects AI assistants to the Easypay Payments API. Manage payments, refunds, subscriptions, checkouts and more through natural conversation. 1. Log in to the Easypay Backoffice 2. Go to Configurations > Developer > Configuration API 2.0 3. Copy your Account ID and API Key 4. For testing, use the sandbox environment at Easypay Sandbox Backoffice Add the following to your Claude Desktop configuration file:

Summary extracted from the README.

Easypay Payments MCP Server

MCP (Model Context Protocol) server that connects AI assistants to the Easypay Payments API. Manage payments, refunds, subscriptions, checkouts and more through natural conversation.

Prerequisites

Getting Your Credentials

  1. Log in to the Easypay Backoffice
  2. Go to Configurations > Developer > Configuration API 2.0
  3. Copy your Account ID and API Key
  4. For testing, use the sandbox environment at Easypay Sandbox Backoffice

Installation

For maintainers: see DISTRIBUTION.md for how this package is published to clients (public vs private npm, step-by-step).

Claude Desktop

Add the following to your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "easypay-payments": {
      "command": "npx",
      "args": ["-y", "@easypaypt/payments-mcp"],
      "env": {
        "EASYPAY_ACCOUNT_ID": "your-account-id",
        "EASYPAY_API_KEY": "your-api-key",
        "EASYPAY_ENV": "sandbox"
      }
    }
  }
}

Claude Code

Add the MCP server to your project:

claude mcp add easypay-payments -- npx -y @easypaypt/payments-mcp

Then set the environment variables in your .claude/.env file:

EASYPAY_ACCOUNT_ID=your-account-id
EASYPAY_API_KEY=your-api-key
EASYPAY_ENV=sandbox

Alternatively, add it directly to your project's .mcp.json:

{
  "mcpServers": {
    "easypay-payments": {
      "command": "npx",
      "args": ["-y", "@easypaypt/payments-mcp"],
      "env": {
        "EASYPAY_ACCOUNT_ID": "your-account-id",
        "EASYPAY_API_KEY": "your-api-key",
        "EASYPAY_ENV": "sandbox"
      }
    }
  }
}

From Source (Development)

git clone <repo-url>
cd easypay-payments-mcp-ts
cp .env.example .env       # Edit with your credentials
npm install                # Installs dependencies
npm run build              # Builds the project

Then point your MCP client to the local build:

{
  "mcpServers": {
    "easypay-payments": {
      "command": "node",
      "args": ["/path/to/easypay-payments-mcp/dist/index.js"],
      "env": {
        "EASYPAY_ACCOUNT_ID": "your-account-id",
        "EASYPAY_API_KEY": "your-api-key",
        "EASYPAY_ENV": "sandbox"
      }
    }
  }
}

npm Scripts

Run npm run to list every available script. The most commonly used ones:

Command Description
npm install Install dependencies
npm run build Build the TypeScript project
npm run dev Start the MCP server in development mode (tsx)
npm start Start the MCP server (stdio transport — for Claude Desktop/Code)
npm run start:sse Start the MCP server (SSE transport on port 8000 — for web clients)
npm run inspect Open MCP Inspector to test tools interactively in a browser
npm run ping Quick credential validation against the Easypay API
npm test Run all tests
npm run spec:update Refresh spec/openapi.yaml from docs.easypay.pt and print the API changelog
npm run spec:check Report drift between the tools and the API spec
npm run clean Remove node_modules, dist, and coverage

Quick Start

npm install                 # 1. Install dependencies
cp .env.example .env        # 2. Add your credentials to .env
npm run build               # 3. Build the project
npm run ping                # 4. Verify credentials work
npm run inspect             # 5. Test tools interactively

Environment Variables

Variable Required Description
EASYPAY_ACCOUNT_ID Yes Your Easypay Account ID
EASYPAY_API_KEY Yes Your Easypay API Key
EASYPAY_ENV No sandbox (default) or production

Important: Always test with sandbox first. Only switch to production when you are ready to process real payments.

Available Tools

Single Payments

Tool Description
list_single_payments List all single payments with optional filters
get_single_payment Get details of a specific payment by ID
create_single_payment Create a new one-time payment
update_single_payment Update an existing payment (customer, mandate, currency, expiration)
delete_single_payment Cancel or void a payment

Frequent Payments (Tokenized)

Tool Description
list_frequent_payments List all tokenized payment references
get_frequent_payment Get details of a frequent payment
create_frequent_payment Create a new token for recurring variable-amount charges
update_frequent_payment Update a token's status, charge bounds, or customer data
delete_frequent_payment Delete a frequent payment token
create_frequent_authorisation Charge against an existing token

Subscriptions

Tool Description
list_subscriptions List all active subscriptions
get_subscription Get subscription details
create_subscription Set up a recurring fixed-amount payment
update_subscription Update a subscription's status, value, frequency, or retry policy
delete_subscription Cancel a subscription

Captures, Authorisations & Voids

Tool Description
list_captures List all captures
get_capture Get capture details
create_capture Capture a previously authorised payment
get_authorisation Get authorisation details
get_void Get void details
create_void Void an authorised payment

Refunds & Chargebacks

Tool Description
list_refunds List all refunds
get_refund Get refund details
create_refund Refund a captured payment (full or partial)
list_chargebacks List consumer-initiated reversals
get_chargeback Get chargeback details and dispute reason

Checkout

Tool Description
get_checkout Get checkout session details
create_checkout Create an embeddable payment form
delete_checkout Cancel a checkout session
Tool Description
list_payment_links List all payment links
get_payment_link Get payment link details
create_payment_link Generate a shareable payment URL
update_payment_link Change a payment link's expiration date
delete_payment_link Permanently delete a payment link

Reports

Tool Description
get_ledger Itemised ledger entries for reconciliation
get_transactions List account transactions (deprecated: End of Life in the API, use get_ledger)

Account Configuration

Tool Description
get_account_config View account configuration and notification URLs
update_account_config Update webhook and card redirect URLs

System

Tool Description
ping Test connectivity and validate credentials

Usage Examples

Once the MCP server is running, you can ask your AI assistant things like:

  • "List my recent payments"
  • "Create a Multibanco payment of 25.50 EUR for customer John"
  • "Show me the details of payment abc-123-def"
  • "Refund 10 EUR from capture xyz-456"
  • "Create a payment link for 100 EUR that expires in 7 days"
  • "What's my ledger for January 2025?"
  • "Set up a monthly subscription of 9.99 EUR via credit card"
  • "Change my subscription frequency to quarterly"
  • "Update my generic notification URL to https://example.com/webhook"
  • "Ping my account to check if credentials are working"

Security

  • Credentials are stored only on your machine as environment variables
  • The MCP server runs locally — no data is sent to third-party servers
  • API calls go directly from your machine to the Easypay API (api.test.easypay.pt or api.prod.easypay.pt)
  • Each user runs their own instance with their own credentials — there is no shared state

Troubleshooting

"Missing Easypay credentials" Ensure EASYPAY_ACCOUNT_ID and EASYPAY_API_KEY are set in the env block of your MCP configuration.

Connection errors Run the ping tool to test connectivity. If it fails, verify your credentials in the Easypay Backoffice.

"Invalid environment" EASYPAY_ENV must be either sandbox or production.

Keeping Up With the API

The tools are checked against a snapshot of the published OpenAPI spec (spec/openapi.yaml). npm test fails if a tool sends a request the spec doesn't accept. npm run spec:check lists the endpoints and fields that are not supported yet. A scheduled GitHub workflow opens a PR when the spec changes, and the /sync-api-spec Claude Code skill applies the changes. See spec/README.md.

Architecture

Easypay Payments MCP Architecture

License

Copyright (c) 2026 Easypay. All rights reserved.