What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI models to securely connect to external data sources and tools. It provides a unified way for AI applications to interact with various services, databases, and APIs while maintaining security and proper access controls.
MCP servers act as bridges between AI models and external systems, allowing models to:
- Access real-time data from external services
- Execute functions and operations on behalf of users
- Maintain secure authentication and authorization
- Provide structured responses that models can understand
The Mayar MCP Server specifically provides AI models with comprehensive access to payment processing, customer management, and transaction data through a secure, standardized interface.
๐ฅ๏ธ MCP Client Integration
To connect Mayar MCP Server to an MCP client application such as Claude Desktop, Cursor, or others, add the following configuration in Settings > Developer > Edit Config in your app. Replace your-api-key as needed.
{
"mcpServers": {
"mayar": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.mayar.id/mcp",
"--header",
"Authorization:${API_KEY}",
"--header",
"Environment:${ENVIRONMENT}"
],
"env": {
"API_KEY": "your-api-key",
"ENVIRONMENT": "sandbox"
}
}
}
}
Connection Details
- Recommended: https://mcp.mayar.id/mcp (Streamable HTTP). 15 lean tools, one per domain with an action argument.
- Legacy: https://mcp.mayar.id/sse (SSE). One tool per endpoint, listed below. Unchanged for existing clients.
Headers
- Authorization: [Mayar_API_Key]
- Environment: sandbox (api.mayar.io) or production (api.mayar.id). A missing or empty header means production, so set sandbox explicitly when testing. An unfilled placeholder such as ${ENVIRONMENT} and any other value are refused with 400.
Lean tools on /mcp
- account Mayar account: status (environment, key set; no API call), balance, payment channels, stats (product/customer/transaction totals).
actions: status, balance, channels, stats
- invoice Invoices. create: without expiredAt the invoice expires in 1 hour.
actions: list, get, by_email, create, update, close, reopen, set_status
- installment Installment (cicilan) plans. installment.dueDate is the day of month.
actions: list, get, create
- customer Customers. update merges the customer into toEmail. portal_link emails the customer.
actions: list, get, create, update, portal_link
- transaction Transactions. Dates ISO 8601. Cursor paging: after=nextStartingAfter.
actions: list, unpaid, get, daily, by_product
- product Products/payment links, bundles. create_* fields per docs. update/update_generic membership/saas/credit: no amount keeps current price; 500..1e9.
actions: list, by_type, get, create_generic, create_payment_link, create_digital, create_event, create_webinar, update, update_digital, update_webinar, update_event, update_generic, update_link, set_status, sort, bundles, bundle
- payment Single payment requests. create expires in 1h unless expiredAt.
actions: list, get, create, update, set_status
- membership Memberships: members, tiers, membership products. cancel_member stops a membership.
actions: members, member, add_member, update_member, cancel_member, member_invoice, tiers, tier_get, tier_create, product_get, product_create
- credit Credit wallets for credit-based memberships. add/spend change a customer's balance.
actions: balance, add, spend, history, register_usage, register_membership, checkout
- coupon Coupons. check: exists and active. validate: usable for a product (no final price). create returns couponCodes.
actions: list, get, check, validate, create
- webhook Webhooks. get_url reads the registered URL (Mayar returns it in a customer detail as user.urlHook). set_url replaces it. test: Mayar needs a valid urlHook but sends the test event to the registered URL.
actions: history, new_history, get_url, set_url, test, retry
- review Product reviews and ratings.
actions: list, product, customer, product_stats, merchant_stats, create, update, bulk_status
- qr QRIS: dynamic (one amount, new code) or static (merchant QR).
actions: dynamic, static
- license License keys: product license codes, SaaS licenses, software licenses.
actions: verify, software_verify, saas_activate, saas_deactivate, saas_verify
- search_docs Search the bundled Mayar guides and API notes.
Environment Variables
- API_KEY
Your Mayar API key for authentication
- ENVIRONMENT
Sent as the Environment header: sandbox or production. Always set it. If it is not set, mcp-remote sends the placeholder as is and the server answers 400.
๐ Getting Your API Key
You can obtain your Mayar API Key in Mayar Dashboard > Integration > Api Keys.