Lemon Squeezy MCP Server & CLI

A free, open source Lemon Squeezy MCP server and CLI that lets Claude Code, Codex, Cursor and other AI agents read and refund orders, manage subscriptions and check license keys.

Navid Moazzezby Navid Moazzez·Updated Oct 5, 2026·15 min read·
Your computer
  1. 1

    Add it with a single command in a terminal.

    Put your own API key in place of the example.

    claude mcp add lemonsqueezy \
    -e LEMONSQUEEZY_API_KEY=YOUR_TEST_MODE_API_KEY \
    -- npx -y @thenavidm/lemonsqueezy-mcp-cli@latest
  2. 2

    In Claude Code, type /mcp. Lemon Squeezy should show as connected.

    /mcp

Needs Node 22 or newer and a Lemon Squeezy API key, made in test mode to start. Get it in a minute.

It's free and open source. If it saves you time, star it on GitHub, so more people find it.

Rate this tool

This free Lemon Squeezy MCP server and CLI gives your AI real access to your Lemon Squeezy store: products, orders, subscriptions, discounts, checkouts and license keys. It reads your products, orders and subscriptions, refunds orders, changes or cancels subscriptions, makes discount codes and checkouts, and checks license keys.

It's one install with two ways in. Claude, Codex, Cursor or any other MCP app calls its 65 tools for you, and the same tools work as a CLI that agents like Claude Code, Codex and OpenCode run, or that you type yourself.

In this guide, I'll show you:

  • What the Lemon Squeezy MCP server & CLI is, and what you can ask it
  • How to install it and check that it works
  • When to use the MCP server, and when the CLI
  • Every tool, and how to keep your account safe

Every tool on this page comes from the server itself, and every cost was measured in Claude Code.

key_takeaways.mdTL;DR

Key takeaways

It gives Claude, Codex, Cursor and any other MCP app 65 tools for Lemon Squeezy: stores, products, orders, refunds, subscriptions, discounts, checkouts, license keys and webhooks.
It starts in test mode and checks your key's mode before the first request, so a live key never runs by accident.
Every refund, cancellation, subscription change, checkout and license activation waits for your approval.
The same tools run as a CLI, which costs your AI nothing until it runs.

What is the Lemon Squeezy MCP server & CLI?

The Lemon Squeezy MCP server & CLI is a free, open source program that lets AI agents run your Lemon Squeezy store for you, in two ways. The MCP server is what an AI app like Claude, Codex or Cursor connects to, through MCP (Model Context Protocol), the open standard AI apps use to call outside tools.

You ask in plain language. Your AI picks the right tool, and the server makes the call to Lemon Squeezy's own API.

The CLI is the same program as commands. lemonsqueezy-cli list-orders runs the same code your AI runs when you ask for your latest orders, whether an agent like Claude Code runs it or you do.

In an AI OS, the layer that connects your AI to your context, your data and your tools, a server like this is how your AI reaches Lemon Squeezy. I explain how the parts fit together in how to build an AI operating system, and here's how I use AI myself.

What can you ask it?

Once it's set up, you ask the way you'd ask an assistant. These are real prompts it handles:

Try asking
How many orders did I get this week, and what did they add up to?
Refund half of order 1234.
Which subscriptions are past due?
Make a 25% off code called LAUNCH for my course.
Pause Jane's subscription until next month.
Is this license key still valid, and how many activations has it used?

The fifth one shows why this is useful. Your AI finds the subscription and changes it in one step, after you approve, without a trip through the dashboard.

It works well next to my Kit MCP server and Dub MCP server, so your AI can email your buyers and see which links lead to sales in the same chat. Every server I've made is on my MCP servers page.

For your pricing, my free Lemon Squeezy fee calculator and digital product idea generator help too. Lemon Squeezy is one of the platforms I compare in the best place to sell digital products.

How to install the Lemon Squeezy MCP server

Pick your app in the box at the top of this page. Each one is a single command or a pasted block, and they all run through npx, so there's nothing to install first.

Windsurf, Zed and Cline take the same server, though they don't have a tab in the box yet. Follow the box's Cursor tab, and put its block here instead:

AppWhere the block goes
WindsurfIn the Cascade panel, open the Actions menu (…) and choose Open MCP config file, then paste the block.
ClineClick the MCP Servers icon in the Cline panel, open the Configure tab, click Configure MCP Servers, and paste the block.
ZedGo to Settings, then AI, then MCP Servers, and choose Add Server, then Add Local Server. Enter the block's command, arguments and variables, and Zed saves them under context_servers.
Before you start0/3

Watch out: API keys belong to test mode or live mode. The server expects a test key unless you set LEMONSQUEEZY_MODE=live, and it stops if the key doesn't match.

Set up your Lemon Squeezy account

It takes a minute.

Get your API key0/4

A test key works only with test data, so nothing real happens while you try it. When you're ready, create a key with test mode off, and set LEMONSQUEEZY_MODE to live. Keys last a year, so make a new one before yours runs out.

To check customers' license keys, put a license key into LEMONSQUEEZY_LICENSE_KEY instead of the chat. The license tools use it on its own, with no API key needed.

To keep the API key out of your app's config, save it alone in a file only you can read, and point LEMONSQUEEZY_TOKEN_FILE at that file's full path instead.

Check that it works

Run the doctor with --network. It checks your settings, then reads your Lemon Squeezy user to prove the key works and that its mode matches. It doesn't change anything.

npx -y @thenavidm/lemonsqueezy-mcp-cli doctor --network

When every line has a check mark, restart your app and ask it for your latest orders. A mode mismatch means a live key with test mode set, or the other way round.

In Claude Code, /mcp also shows whether the Lemon Squeezy server is connected. It's one of the Claude Code commands worth knowing.

Use the Lemon Squeezy CLI

The CLI is the same 65 tools as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal or a script.

Every tool name becomes a command with dashes, so list_orders runs as lemonsqueezy-cli list-orders.

npm install -g @thenavidm/lemonsqueezy-mcp-cli
lemonsqueezy-cli
lemonsqueezy-cli list-stores
lemonsqueezy-cli list-orders --per-page 10
lemonsqueezy-cli list-subscriptions --status past_due
lemonsqueezy-cli validate-license

The bare lemonsqueezy-cli lists every command, lemonsqueezy-cli which <words> finds the command for a task, and lemonsqueezy-cli <command> --help shows what a command takes. Refunds, subscription changes, checkouts, invoices, discounts, license changes and webhooks need --confirm, the terminal's version of your approval.

lemonsqueezy-cli install <app> adds the server to Claude Code, Codex, Claude Desktop, Cursor, VS Code or Gemini CLI, in each app's own format.

These are the flags you'll use most:

FlagWhat it does
--jsonPrints JSON
--compactPrints the JSON on one line
--select a,b.cKeeps only those fields, and a dotted path goes deeper
--agentMachine mode: compact JSON, no prompts, and it never confirms anything
--confirmLets a write that asks first go ahead
--dry-runShows what a write would do, without doing it

A script can branch on the exit code:

Exit codeWhat it means
0It worked
1Something unexpected went wrong
2The command was typed wrong, or a write needed --confirm
3It wasn't found
4Lemon Squeezy rejected the credentials
5Lemon Squeezy failed or couldn't be reached
7You hit a rate limit, so wait and try again
10Nothing is set up yet

MCP server or CLI: which one?

Both are the same program with the same 65 tools. The difference is when your AI pays for them, in the tokens it reads.

Every message, in an app that loads every tool
MCP server
31,400 tokens
CLI
Nothing
Every message, in Claude Code
MCP server
1,300 tokens
CLI
Nothing
When Lemon Squeezy comes up
MCP server
Nothing more, or in Claude Code the tools it picks
CLI
3,900 tokens, once
20 messages with Lemon Squeezy in one, every tool loaded
MCP server
627,000 tokens
CLI
3,900 tokens
Works in Claude Desktop's chat
MCP server
Yes
CLI
No, there's no terminal there
Works in a script, a cron job or CI
MCP server
No
CLI
Yes

An app that loads every tool up front sends the full list with every message, whether you mention Lemon Squeezy or not. Claude Code doesn't by default: its tool search sends only the tool names and the server's instructions, and loads a tool's full definition when your AI reaches for it.

The CLI costs nothing until Lemon Squeezy comes up. Then your agent reads its skill file once and runs the commands it needs. With the skill added, Claude Code also lists its one-line description with every message, about 70 tokens.

When the whole conversation is about Lemon Squeezy, the gap closes. Then the MCP server is the better experience, because you ask in plain language and your AI never has to look up a command.

How to spend less

In Claude Code, leave tool search on, which it is unless you've set ENABLE_TOOL_SEARCH=false.

Turn the server off when you aren't working on your store. In Claude Code that's the /mcp panel, and every AI app has its own switch. LEMONSQUEEZY_READ_ONLY=1 cuts it to the 44 reading tools.

Or install the CLI and connect the server later, on the days it earns its place. Every tool stays in reach, and the standing cost drops to nothing.

Every number here was measured on October 5, 2026 in Claude Code 2.1.286 with Claude Opus 5.5. It's the same one-line prompt with and without the server connected, once with tool search off so every tool loads, and once with Claude Code's default. The skill was measured the same way, and other apps and models count tokens a little differently.

Test mode, refunds and licenses

The server starts in test mode, where a test key sees only test data and nothing real is charged. Test purchases still send receipts, though only to you and your team. Set LEMONSQUEEZY_MODE to live, with a live key, when you're ready.

A partial refund is a whole number in the currency's smallest unit, like cents, and a full refund has to be asked for by name, so a missing amount never turns into a full refund. Changing a subscription can bill or prorate right away, so your AI reads it first.

create_checkout, generate_order_invoice and generate_subscription_invoice save their links to a new private file instead of the chat, because a checkout or invoice link works for anyone who has it.

License checks use the license key itself, not your API key. validate_license reads a key's status, and activating it or freeing up an activation asks first.

export_resources saves any list, like orders or subscriptions, to a new private file, 1,000 items unless you ask for more and 10,000 at most.

Watch out: Lemon Squeezy allows 300 requests a minute, and 60 a minute for license checks. The server spaces its requests a second apart, and it never retries one on its own.

Every Lemon Squeezy tool

The tables below list all 65 tools, grouped by what they're for. Of these, 44 only read, and 21 change something in your Lemon Squeezy store or on your computer.

Orders and refunds

list_order_items
What it does
Lists the items in your orders.
Kind
Reads
get_order_item
What it does
Reads one order item.
Kind
Reads
generate_order_invoice
What it does
Makes an invoice for an order, with its link saved to a private file.
Kind
Asks first
refund_order
What it does
Refunds an order, in full or in part.
Kind
Asks first
list_orders
What it does
Lists your orders, filtered by email, order number or store.
Kind
Reads
get_order
What it does
Reads one order.
Kind
Reads

Subscriptions, invoices and usage

generate_subscription_invoice
What it does
Makes an invoice for a subscription payment, with its link saved to a private file.
Kind
Asks first
refund_subscription_invoice
What it does
Refunds a subscription payment, in full or in part.
Kind
Asks first
list_subscription_invoices
What it does
Lists subscription invoices.
Kind
Reads
get_subscription_invoice
What it does
Reads one subscription invoice.
Kind
Reads
list_subscription_items
What it does
Lists subscription items.
Kind
Reads
get_subscription_item_current_usage
What it does
Shows a subscription item's usage this billing period.
Kind
Reads
get_subscription_item
What it does
Reads one subscription item.
Kind
Reads
update_subscription_item
What it does
Changes a subscription item's quantity.
Kind
Asks first
cancel_subscription
What it does
Cancels an active subscription.
Kind
Asks first
list_subscriptions
What it does
Lists your subscriptions, filtered by status, product or email.
Kind
Reads
get_subscription
What it does
Reads one subscription.
Kind
Reads
update_subscription
What it does
Changes a subscription's plan, billing, pause or proration.
Kind
Asks first
create_usage_record
What it does
Records usage for a usage-based subscription.
Kind
Asks first
list_usage_records
What it does
Lists usage records.
Kind
Reads
get_usage_record
What it does
Reads one usage record.
Kind
Reads

Stores, products and files

list_files
What it does
Lists the files attached to your products.
Kind
Reads
get_file
What it does
Reads one file's details.
Kind
Reads
list_prices
What it does
Lists your prices.
Kind
Reads
get_price
What it does
Reads one price.
Kind
Reads
list_products
What it does
Lists your products.
Kind
Reads
get_product
What it does
Reads one product.
Kind
Reads
list_stores
What it does
Lists your stores.
Kind
Reads
get_store
What it does
Reads one store.
Kind
Reads
list_variants
What it does
Lists your product variants.
Kind
Reads
get_variant
What it does
Reads one variant.
Kind
Reads

Customers

create_customer
What it does
Adds a customer.
Kind
Asks first
list_customers
What it does
Lists your customers.
Kind
Reads
get_customer
What it does
Reads one customer.
Kind
Reads
update_customer
What it does
Changes a customer's details.
Kind
Asks first

Discount codes

list_discount_redemptions
What it does
Lists when your discount codes were used.
Kind
Reads
get_discount_redemption
What it does
Reads one discount redemption.
Kind
Reads
create_discount
What it does
Creates a discount code.
Kind
Asks first
delete_discount
What it does
Deletes a discount code.
Kind
Asks first
list_discounts
What it does
Lists your discount codes.
Kind
Reads
get_discount
What it does
Reads one discount code.
Kind
Reads

Checkouts

create_checkout
What it does
Makes a checkout link for a product, saved to a private file.
Kind
Asks first
list_checkouts
What it does
Lists the checkouts you've made.
Kind
Reads
get_checkout
What it does
Reads one checkout.
Kind
Reads

License keys

activate_license
What it does
Activates a license key on one device or site.
Kind
Asks first
deactivate_license
What it does
Frees up one of a license key's activations.
Kind
Asks first
validate_license
What it does
Checks a license key and says whether it's valid.
Kind
Reads
list_license_key_instances
What it does
Lists where your license keys are activated.
Kind
Reads
get_license_key_instance
What it does
Reads one license activation.
Kind
Reads
list_license_keys
What it does
Lists your license keys.
Kind
Reads
get_license_key
What it does
Reads one license key's details.
Kind
Reads
update_license_key
What it does
Changes a license key's activation limit, expiry date or status.
Kind
Asks first

Affiliates

list_affiliates
What it does
Lists your affiliates.
Kind
Reads
get_affiliate
What it does
Reads one affiliate.
Kind
Reads

Webhooks

create_webhook
What it does
Adds a webhook that sends store events to your own URL.
Kind
Asks first
delete_webhook
What it does
Deletes a webhook.
Kind
Asks first
list_webhooks
What it does
Lists your webhooks.
Kind
Reads
get_webhook
What it does
Reads one webhook.
Kind
Reads
update_webhook
What it does
Changes a webhook's URL, events or secret.
Kind
Asks first

Your account, batches and exports

get_user
What it does
Reads the Lemon Squeezy user your key belongs to.
Kind
Reads
list_accounts
What it does
Lists the accounts you've set up, without their keys.
Kind
Reads
get_operation_schema
What it does
Shows every field one of these requests takes.
Kind
Reads
preview_commerce_batch
What it does
Checks up to 20 changes on your computer and gives the batch a fingerprint.
Kind
Reads
submit_commerce_batch
What it does
Runs a checked batch in order, only with the fingerprint from its preview.
Kind
Asks first
export_resources
What it does
Saves any list, like orders or subscriptions, to a new private JSON file.
Kind
Asks first

Is the Lemon Squeezy MCP server safe?

Money and customer access are on the line. So 21 tools ask first: every refund, subscription change or cancellation, checkout, invoice, discount, customer change, license change and webhook. They're the ones marked "Asks first" in the tool tables above.

Reading your store never asks, because it changes nothing, and test mode keeps practice runs away from real money.

When your AI calls one of them, the call needs a yes first. Where you use it decides who gives it:

  • Claude Code (2.1.246 and later) asks you before every call, in every one of its permission modes.
  • An app that can show forms asks you in a form.
  • Any other app takes your AI's confirm: true as the yes, so tell your AI to check with you first.
  • An agent with no person to ask needs LEMONSQUEEZY_CONFIRM=model, so its confirm: true counts in every app.
  • In a terminal, you add --confirm to the command.

If the answer is no, nothing reaches Lemon Squeezy.

Make it read-only

Set LEMONSQUEEZY_READ_ONLY=1 and every tool that asks first disappears from the tool list, leaving 44 reading tools.

Keep a log of every write

Set LEMONSQUEEZY_AUDIT_LOG to a file path. The server writes one line per attempted write, allowed or blocked, with what it was about to do and who approved it.

Watch out: Product descriptions and customer details can be written by other people, and one can try to give your AI orders. Treat them as data, and use LEMONSQUEEZY_READ_ONLY=1 for an agent working on its own.

Your data

Your requests go straight to Lemon Squeezy, with no server of ours in between and no tracking. Your key stays in your app's config, your shell or your token file.

Orders, customers and subscriptions are personal and financial data, so keep any export private and delete it when you're done.

To cut access, delete the key in Settings, then API, and remove the server from your app's config.

Connect more than one Lemon Squeezy account

Set LEMONSQUEEZY_ACCOUNTS to a JSON list with a name, a key or a token file, a license key where you need one, and the mode for each account. LEMONSQUEEZY_DEFAULT_ACCOUNT picks the one that acts when a tool names none, and every tool takes an optional account.

That's also how to keep a test key and a live key side by side. An account never borrows another one's key, so a missing key stops the call instead of using the other mode.

Lemon Squeezy MCP server settings

Every setting is an environment variable, in your app's config or your shell.

LEMONSQUEEZY_API_KEY
Default
none
What it does
Holds your API key
LEMONSQUEEZY_TOKEN_FILE
Default
none
What it does
Points at a private file holding the key, instead
LEMONSQUEEZY_LICENSE_KEY
Default
none
What it does
Holds a license key, for the license tools
LEMONSQUEEZY_LICENSE_FILE
Default
none
What it does
Points at a private file holding the license key, instead
LEMONSQUEEZY_MODE
Default
test
What it does
live for a live key, and the server checks the key's mode against it
LEMONSQUEEZY_ACCOUNTS
Default
none
What it does
Lists several accounts, each with its own mode, as JSON
LEMONSQUEEZY_DEFAULT_ACCOUNT
Default
the first one
What it does
Picks the account that acts when a tool names none
LEMONSQUEEZY_REQUEST_TIMEOUT_MS
Default
30000
What it does
Gives up on a Lemon Squeezy request after this many milliseconds
LEMONSQUEEZY_MIN_REQUEST_INTERVAL_MS
Default
1000
What it does
Waits this many milliseconds between requests
LEMONSQUEEZY_READ_ONLY
Default
off
What it does
1 hides every tool that changes something
LEMONSQUEEZY_ALLOW_DESTRUCTIVE
Default
on
What it does
0 refuses the tools that ask first
LEMONSQUEEZY_AUDIT_LOG
Default
none
What it does
Names a file that gets one line per attempted write
LEMONSQUEEZY_SURFACE
Default
full
What it does
search lists three tools that find, describe and run the rest
LEMONSQUEEZY_TOOL_TIMEOUT_MS
Default
none
What it does
Gives up on any tool after this many milliseconds
LEMONSQUEEZY_CONFIRM
Default
human
What it does
model lets your AI's confirm: true approve on its own, for an agent with no person to ask
LEMONSQUEEZY_HTTP_PORT
Default
8787
What it does
Sets the port for --http
LEMONSQUEEZY_HTTP_HOST
Default
127.0.0.1
What it does
Sets the address for --http, and any other needs a token
LEMONSQUEEZY_HTTP_TOKEN
Default
none
What it does
Sets the bearer token every --http request needs
LEMONSQUEEZY_HTTP_ALLOWED_ORIGINS
Default
none
What it does
Lists other websites allowed to call --http, comma separated
LEMONSQUEEZY_DEBUG
Default
off
What it does
1 prints debug lines

Troubleshooting

Run the doctor first. It names the step that failed and the fix.

What you seeWhat to do
The doctor says the mode doesn't matchYour key is live and LEMONSQUEEZY_MODE is test, or the other way round. Set it to match the key
The key check failsThe key expired, since keys last a year, or it was deleted. Make a new one in Settings, then API
A license check says valid is falseThat's Lemon Squeezy's answer about the key. Check its product, its activations and whether it expired
A refund is refusedAsk for a full refund by name, or give a whole amount in the smallest currency unit, never both
A checkout link isn't in the chatIt's in the private file you named, because a checkout link works for anyone who has it
An export stopped at its limitIt tells you where to pick up. Run it again from there, into a new file
"…so it will not run without confirm: true"That's the safety check working. Approve it when your app asks

If the server doesn't show up in your app at all, run the command your app runs, in a terminal, and read the error.

More free tools for selling online

Sell on Gumroad or with ThriveCart checkouts too, with the same kind of tools.

FAQs about the Lemon Squeezy MCP server & CLI

Here are the questions people ask most about the Lemon Squeezy MCP server and CLI.

The Lemon Squeezy MCP server & CLI is a free, open source program that lets an AI app like Claude, Codex or Cursor run your Lemon Squeezy store.

It has 65 tools for products, orders, subscriptions, discounts, checkouts, license keys and webhooks, and the same tools run as a CLI that agents like Claude Code and Codex use, or that you type yourself.

An MCP server is a standard way to give an AI app real access to a tool, so it can act instead of guessing.

MCP stands for Model Context Protocol, and Claude, Codex, Cursor and many other AI apps speak it.

Every server I've made is on my MCP servers page.

The Lemon Squeezy CLI is the same program as the Lemon Squeezy MCP server, run as commands.

AI agents like Claude Code, Codex and OpenCode run them for you, and you can type them in a terminal or a script.

One npm package installs both.

Use the Lemon Squeezy MCP server in an AI app with no terminal, like Claude Desktop's chat, and the CLI in a terminal, a script or a cron job.

In an AI app that can run commands, like Claude Code, Codex or Cursor, the CLI is the lighter choice, because it costs nothing until it runs.

Yes, the Lemon Squeezy MCP server is free and open source under the AGPL-3.0 license.

Lemon Squeezy's API comes with every store, so the only thing you pay for is your own AI app.

Yes, the server expects a test-mode key unless you set LEMONSQUEEZY_MODE to live.

It checks the key's mode before the first request, and stops if they don't match.

Yes, in full or in part, after you approve that exact refund.

A partial refund is a whole number in the currency's smallest unit, like cents.

A checkout or invoice link works for anyone who has it, so the server saves it to a new private file instead of the chat.

You share it from there.

Yes, the Lemon Squeezy MCP server connects as many accounts as you set up in LEMONSQUEEZY_ACCOUNTS, each with its own key and mode.

That's also how to keep a test key and a live key side by side.

To disconnect the Lemon Squeezy MCP server, delete its key in Settings, then API, which cuts access right away.

Then remove the server from your AI app's config.

The Lemon Squeezy MCP server works with any app that speaks MCP.

That includes Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Cline, GitHub Copilot CLI, Gemini CLI, OpenCode, OpenClaw, Antigravity and Hermes.

I did.

I'm Navid Moazzez, and I made the Lemon Squeezy MCP server & CLI as one of my free tools on navid.me.

You can read more about me.

The code is on GitHub under the AGPL-3.0 license, and the package is on npm.

More MCP servers & CLIs

Related free tools

Navid Moazzez

AI business strategist

Navid Moazzez helps creators and founders master AI and build their own AI Operating System (AI OS) to automate their business and life.

Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.

Free AI newsletter

The most actionable AI newsletter for founders

Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.

No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.

P.S. Sign up now to get free access to my ultimate AI tools guide for creators.

Loved by 10,000+ readers
Loved by 10,000+ readers