Square Integration
Manage Square merchants, locations, customers, catalog, orders, payments, refunds, and invoices
The Square integration provides access to manage Square merchants, locations, customers, catalog, orders, payments, refunds, and invoices through the Integrate MCP server.
Installation
The Square integration is included with the SDK:
import { squareIntegration } from "integrate-sdk/server";Setup
1. Create a Square OAuth App
- Create an OAuth application for Square
- Configure your redirect URI
- Note your Client ID and Client Secret
2. Configure the Integration on Your Server
Add the Square integration to your server configuration. The integration automatically reads SQUARE_CLIENT_ID and SQUARE_CLIENT_SECRET from your environment variables:
import { createMCPServer, squareIntegration } from "integrate-sdk/server";
export const { client: serverClient } = createMCPServer({
apiKey: process.env.INTEGRATE_API_KEY,
integrations: [
squareIntegration({
scopes: ["MERCHANT_PROFILE_READ", "PAYMENTS_READ", "PAYMENTS_WRITE", "CUSTOMERS_READ", "CUSTOMERS_WRITE", "ORDERS_READ", "ORDERS_WRITE", "ITEMS_READ", "ITEMS_WRITE", "INVOICES_READ", "INVOICES_WRITE"], // Optional
}),
],
});You can override the environment variables by passing explicit values:
squareIntegration({
clientId: process.env.CUSTOM_SQUARE_ID,
clientSecret: process.env.CUSTOM_SQUARE_SECRET,
scopes: ["MERCHANT_PROFILE_READ", "PAYMENTS_READ", "PAYMENTS_WRITE", "CUSTOMERS_READ", "CUSTOMERS_WRITE", "ORDERS_READ", "ORDERS_WRITE", "ITEMS_READ", "ITEMS_WRITE", "INVOICES_READ", "INVOICES_WRITE"], // Optional
});3. Client-Side Usage
The default client automatically includes all integrations. You can use it directly:
import { client } from "integrate-sdk";
await client.authorize("square");
const result = await client.square.getMerchant({});
console.log(result);If you're using a custom client, add the integration to the integrations array:
import { createMCPClient, squareIntegration } from "integrate-sdk";
const customClient = createMCPClient({
integrations: [squareIntegration()],
});Configuration Options
export interface SquareIntegrationConfig {
clientId?: string;
Default Scopes
These defaults are applied unless you override scopes in the integration config:
MERCHANT_PROFILE_READPAYMENTS_READPAYMENTS_WRITECUSTOMERS_READCUSTOMERS_WRITEORDERS_READORDERS_WRITEITEMS_READITEMS_WRITEINVOICES_READINVOICES_WRITE
Tools
square_get_merchant
Get merchant
No parameters.
square_list_locations
List locations
No parameters.
square_list_customers
List customers
export interface SquareListCustomersParams { cursor?: string;
square_get_customer
Get customer
export interface SquareGetCustomerParams { customer_id: string }
square_create_customer
Create customer
export interface SquareCreateCustomerParams { customer_json: string }
square_update_customer
Update customer
export interface SquareUpdateCustomerParams { customer_id: string;
square_delete_customer
Delete customer
export interface SquareDeleteCustomerParams { customer_id: string }
square_search_catalog
Search catalog
export interface SquareSearchCatalogParams { search_json: string }
square_retrieve_catalog_object
Retrieve catalog object
export interface SquareRetrieveCatalogObjectParams { object_id: string }
square_upsert_catalog_object
Upsert catalog object
export interface SquareUpsertCatalogObjectParams { object_json: string }
square_search_orders
Search orders
export interface SquareSearchOrdersParams { search_json: string }
square_create_order
Create order
export interface SquareCreateOrderParams { order_json: string }
square_pay_order
Pay order
export interface SquarePayOrderParams { order_id: string;
square_list_payments
List payments
export interface SquareListPaymentsParams { location_id?: string;
square_get_payment
Get payment
export interface SquareGetPaymentParams { payment_id: string }
square_create_payment
Create payment
export interface SquareCreatePaymentParams { payment_json: string }
square_list_refunds
List refunds
export interface SquareListRefundsParams { cursor?: string;
square_refund_payment
Refund payment
export interface SquareRefundPaymentParams { refund_json: string }
square_list_invoices
List invoices
export interface SquareListInvoicesParams { location_id?: string;
square_get_invoice
Get invoice
export interface SquareGetInvoiceParams { invoice_id: string }
square_create_invoice
Create invoice
export interface SquareCreateInvoiceParams { invoice_json: string }
Notes
- Category: Finance
- Authentication mode: OAuth