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
- Sign up at squareup.com
- Go to Developer Dashboard
- Create a new application
- Copy your Access Token and Location ID
2. Configuration
- Python
- TypeScript
from paymcp.providers import SquareProvider
PayMCP(mcp, providers=[
SquareProvider(
access_token="YOUR_ACCESS_TOKEN",
location_id="YOUR_LOCATION_ID",
sandbox=True
)
])
import { SquareProvider } from 'paymcp/providers';
installPayMCP(mcp, {
providers: [
new SquareProvider({
access_token: "YOUR_ACCESS_TOKEN",
location_id: "YOUR_LOCATION_ID",
sandbox: true
})
]
});
3. Test Your Integration
- Python
- TypeScript
@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}"
mcp.tool(
"test_square_payment",
{
description: "Test Square payment integration",
inputSchema: { item: z.string() },
price: { amount: 1.50, currency: "USD" },
},
async ({ item }, ctx) => {
return { content: [{ type: "text", text: `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
- Square Documentation - Official docs
- Test Integration - Verify setup