Skip to main content

Square Provider

Square provides payment processing with support for credit cards, digital wallets, and in-person payments. Known for transparent pricing and excellent developer tools.

Features

  • Global Coverage - Available in US, Canada, UK, Australia, and more
  • Developer-Friendly - Excellent sandbox and testing tools

Quick Setup

1. Get Square Credentials

  1. Sign up at squareup.com
  2. Go to Developer Dashboard
  3. Create a new application
  4. Copy your Access Token and Location ID

2. Configuration

from paymcp.providers import SquareProvider

PayMCP(mcp, providers=[
SquareProvider(
access_token="YOUR_ACCESS_TOKEN",
location_id="YOUR_LOCATION_ID",
sandbox=True
)
])

3. Test Your Integration

@mcp.tool()
@price(amount=1.50, currency="USD")
def test_square_payment(item: str, ctx: Context) -> str:
"""Test Square payment integration"""
return f"Square payment successful for: {item}"

Configuration Options

providers = {
"square": {
"access_token": "YOUR_ACCESS_TOKEN", # Required
"location_id": "YOUR_LOCATION_ID", # Required
"sandbox": True, # True for testing
"redirect_url": "https://yourapp.com/success", # Optional
"api_version": "2025-03-19" # Optional, defaults to latest
}
}

Next Steps