Piggy MCP server
47 operations1 webhook
Piggy (rebranded Leat) is a loyalty platform. This plugin manages contacts and their credit, prepaid and tier state, records direct points and reward redemptions with their reversals, issues and redeems vouchers and giftcards, reads promotions, loyalty programs and business profiles, and manages webhook subscriptions with signature-verified deliveries.
Try Piggy with your agent
Connect Piggy, then paste this into Claude, ChatGPT or Cursor. For ideas from other apps, see the use cases.
Using Corsair, show me what you can do in Piggy on my account, then run one read-only example and show me the result.
Piggy tools and triggers
Tools are what your agent can do in Piggy through Corsair's MCP server. Triggers are the Piggy events a routine can start from.
Contacts
- ClaimDestructive
Claim an anonymous contact with a real email; merges into a matching contact, which cannot be undone
contacts.claim
- CreateWrite
Create a contact from an email address
contacts.create
- Create AnonymousWrite
Create an anonymous contact with a fictional email
contacts.createAnonymous
- DeleteDestructive
Delete a contact (DEFAULT or GDPR); cannot be undone
contacts.delete
- Find One By EmailRead-only
Read one contact by email address
contacts.findOneByEmail
- Find Or CreateWrite
Read a contact by email, creating one when missing
contacts.findOrCreate
- GetRead-only
Read one contact by UUID with balances and subscriptions
contacts.get
- Get Credit BalanceRead-only
Read a contact credit balance
contacts.getCreditBalance
- Get Prepaid BalanceRead-only
Read a contact prepaid balance
contacts.getPrepaidBalance
- Get TierRead-only
Read the contact current loyalty tier
contacts.getTier
- ListRead-only
List contacts with paging, date and attribute filters
contacts.list
- MergeDestructive
Merge a source contact into a destination contact; cannot be undone
contacts.merge
- UpdateWrite
Update contact attributes keyed by attribute name
contacts.update
Vouchers
- CreateWrite
Create a voucher for a promotion
vouchers.create
- FindRead-only
Read one voucher by code
vouchers.find
- ListRead-only
List vouchers with promotion, contact and status filters
vouchers.list
- LockWrite
Lock a voucher and receive a release key
vouchers.lock
- RedeemWrite
Redeem a voucher by code at a business profile
vouchers.redeem
- ReleaseWrite
Release a locked voucher with its release key
vouchers.release
- Reverse RedemptionWrite
Reverse a voucher redemption
vouchers.reverseRedemption
- UpdateWrite
Update voucher status, attributes or expiration
vouchers.update
- ValidateRead-only
Check whether a voucher is redeemable at a business profile
vouchers.validate
Giftcards
- CreateDestructive
Issue a digital giftcard with a balance; it carries real value and uses Leat tokens
giftcards.create
- Find One By HashRead-only
Read one giftcard by hash or QR value
giftcards.findOneByHash
- GetRead-only
Read one giftcard by UUID
giftcards.get
- ListRead-only
List giftcards with program and paging filters
giftcards.list
- List ProgramsRead-only
List the giftcard programs
giftcards.listPrograms
- Send By EmailDestructive
Email a giftcard to a contact; the email cannot be recalled
giftcards.sendByEmail
Rewards
- GetRead-only
Read one reward by UUID
rewards.get
- ListRead-only
List rewards, optionally claimable by a contact
rewards.list
- RedeemWrite
Create a reward reception: claim a reward for a contact
rewards.redeem
- Reverse RedemptionWrite
Reverse a reward redemption, reissuing the credits
rewards.reverseRedemption
- UpdateWrite
Update a reward title, description or required credits
rewards.update
Webhooks
- CreateWrite
Create a webhook subscription for one event type
webhooks.create
- DeleteDestructive
Delete a webhook subscription; it cannot be restored
webhooks.delete
- GetRead-only
Read one webhook subscription by UUID
webhooks.get
- ListRead-only
List webhook subscriptions with event type and status filters
webhooks.list
- UpdateWrite
Update a subscription name, URL or status
webhooks.update
Points
- CreateWrite
Add or subtract points on a contact balance directly
points.create
- GetRead-only
Read one direct points transaction
points.get
- ReverseWrite
Reverse a direct points transaction (once per transaction)
points.reverse
Businesses
- Get ProfileRead-only
Read one business profile by UUID
businesses.getProfile
- List ProfilesRead-only
List the account business profiles
businesses.listProfiles
Loyalty
- Get ProgramRead-only
Read the account loyalty program settings
loyalty.getProgram
- List TransactionsRead-only
List loyalty transactions with type, shop and date filters
loyalty.listTransactions
Promotions
- GetRead-only
Read one promotion by UUID
promotions.get
- ListRead-only
List the account promotions
promotions.list
Connect Piggy to Claude, ChatGPT or Cursor
- 1
Connect Piggy in Corsair
Add your Piggy API key once in Corsair. Corsair stores the credential encrypted and makes the Piggy API calls for your agent, so it never goes into a prompt or a config file. Connect Piggy
If your link lets the agent add apps, you can skip this: it gives you a sign-in link the first time it needs Piggy. On a ChatGPT personal plan, connect Piggy here first.
- 2
Add Corsair's MCP server to your agent
Every client uses the same address:
https://mcp.corsair.dev/mcpOpen Customize → Connectors → Add custom connector, paste the address, then select Connect.Add a custom MCP server with the address and choose OAuth. Personal plans get read tools only.Add to CursorOr add this to~/.cursor/mcp.json. Cursor opens Corsair to sign in the first time it connects.{ "mcpServers": { "corsair": { "url": "https://mcp.corsair.dev/mcp" } } }Run this, then run/mcpin Claude Code to sign in.claude mcp add --transport http corsair https://mcp.corsair.dev/mcpCodex, Gemini CLI, VS Code, Zed and other clients with OAuth sign-in work the same way. Clients without it, such as GitHub Copilot's coding agent, use a link's own address and an API key. Setup for every client
- 3
Sign in and choose what needs your approval
Your client opens Corsair to sign in. Pick a link: the apps your agent can use and a mode that decides what it may do without asking. In the default Cautious mode, Piggy's read and write operations run right away and its 6 destructive operations wait for your approval. Strict mode asks before every write and refuses destructive operations, and Read mode allows reads only.
FAQ
Install corsair and @corsair-dev/piggy, add the Piggy plugin, and connect with an API key. Then call methods like corsair.piggy.api.businesses.getProfile() from your app. Corsair verifies webhooks, and keeps each tenant isolated.
Yes. Piggy requires an API key from your Piggy account or developer dashboard. Create credentials with access that matches what you automate, then paste them into Corsair or connect through managed auth in Hub.
Yes. One Corsair client can hit Piggy, GitHub, Notion, Stripe, and the rest. Trigger Piggy from a webhook, push updates to Slack, or chain actions across plugins. Same tenant context across integrations, plain TypeScript.
Teams use Corsair for piggy (rebranded Leat) is a loyalty platform. This plugin manages contacts and their credit, prepaid and tier state, records direct points and reward redemptions with their reversals, issues and redeems vouchers and giftcards, reads promotions, loyalty programs and business profiles, and manages webhook subscriptions with signature-verified deliveries. Common builds include sync jobs, admin tooling, and agents that call Piggy APIs from your backend. Webhook handlers react to Piggy events and fan out to Slack, email, or other plugins in the same tenant.
The SDK is open source. Self-host and you pay Corsair nothing for the integration layer. Hub bills for hosted auth and execution, not per Piggy API call. Hub has a generous free tier. For hobby projects you can probably run the whole thing on free. Paid plans start to matter with more tenants or heavier traffic.
We maintain @corsair-dev/piggy in the open repo. When Piggy ships API changes, upgrade the package. Your call sites stay typed. You should not need to rewrite the integration layer each time.
No. Corsair does not read your Piggy data or hold individual access credentials. Credentials stay in your database. API calls run on your instance. We do not store Piggy data on your behalf.
Yes. Add https://mcp.corsair.dev/mcp as a custom connector or MCP server in Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex or any client that supports remote MCP servers with OAuth sign-in, then sign in to Corsair. On ChatGPT personal plans, custom servers currently get read tools only.
Yes. Put Piggy on a link in Strict mode and every write waits for your approval, while destructive actions are refused. The default Cautious mode asks only before the 6 destructive Piggy operations. You can change a link's mode at hub.corsair.dev/me.