Skip to main content

Add your description here

Project description

Lemon Squeezy Server

smithery badge

A Model Context Protocol (MCP) server implementation that integrates with Lemon Squeezy for handling subscriptions, checkouts, products, and more. This server provides a structured interface to programmatically manage your Lemon Squeezy store with audit logging and tool-based control.

Demo

lemonsqueezy_demo

Requirements

  • Python 3.8+
  • MCP SDK 0.1.0+
  • aiohttp
  • python-dotenv

Components

Resources

The server provides an MCP-compatible resource for operation auditing:

  • Stores logs of all tool-based Lemon Squeezy operations
  • Exposes audit log via read_resource endpoint
  • Helpful for debugging and audit traceability

Tools

Implements a full set of Lemon Squeezy operations via MCP tools:

🔍 Store & Product Tools

  • get_user: Get current Lemon Squeezy user info
  • list_stores: List all stores
  • get_store: Fetch a specific store
  • list_products: List products
  • get_product: Get product details
  • get_product_variants: List variants for a product

📦 Order & Customer Tools

  • list_orders: List all orders
  • get_order: Get details of an order
  • list_customers: List all customers
  • get_customer: Fetch customer details

💳 Subscription & License Tools

  • list_subscriptions: List subscriptions
  • get_subscription: Get a subscription
  • list_license_keys: List license keys
  • get_license_key: Fetch license key info

🛒 Checkout & Webhook Tools

  • create_checkout: Create a fully customized checkout session
  • create_webhook: Register a new webhook
  • list_webhooks: List all webhooks (filterable by store)

Features

  • Subscription & Checkout Management
  • Webhook Creation & Listing
  • Audit Logging of All Actions
  • MCP-Compatible Tool & Resource Integration
  • Error Feedback and Logging

Installation

Installing via Smithery

To install LemonSqueezy Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @atharvagupta2003/mcp-lemonsqueezy --client claude

Install dependencies

python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate    # On Windows
pip install -e .

Configuration

Set up the environment variables in a .env file:

LEMON_SQUEEZY_API_KEY=your_lemonsqueezy_api_key

Claude Desktop

Add the server configuration to your Claude Desktop config:

Windows: C:\Users<username>\AppData\Roaming\Claude\claude_desktop_config.json

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "lemonsqueezy": {
      "command": "/Users/hp/.local/bin/uv",
      "description": "Operations with lemonsqueezy payment platform",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/src/mcp_lemonsqueezy",
        "run",
        "--with",
        "fastmcp",
        "server.py"
      ],
      "env": {
         "LEMONSQUEEZY_API_KEY": "<YOUR-API-KEY>"
       }
    }
  }
}

Usage

Start the server

uv run src/mcp_lemonsqueezy/server.py

Example MCP Commands

Get Current User

{
  "tool": "get_user",
  "arguments": {}
}

List All Stores

{
  "tool": "list_stores",
  "arguments": {}
}

Get a Store by ID

{
  "tool": "get_store",
  "arguments": {
    "store_id": "164870"
  }
}

Error Handling

The server provides clear error messages for common scenarios:

  • 401 Unauthorized: Missing or invalid API key
  • 422 Unprocessable Entity: Invalid fields like missing variant/store ID
  • 400 Bad Request: Invalid JSON API structure

Development

Testing

Run the MCP Inspector for interactive testing:

npx @modelcontextprotocol/inspector uv run --with fastmcp /ABSOLUTE/PATH/TO/PARENT/FOLDER/src/mcp_lemonsqueezy/server.py

Building

  1. Update dependencies:
uv compile pyproject.toml
  1. Build package:
uv build

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb39af9dc26df24f46987ce0f8d26d18077f3d633ecd8e3da745eafed643febf
MD5 6509762f2219be1887cd507198053f16
BLAKE2b-256 7e41bac8708bd11b46a98f969a7b941fd9175247302f25f6985e279a5dac83dc

See more details on using hashes here.

File details

Details for the file iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_atharvagupta2003_mcp_lemonsqueezy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0ca9b844748e42fe3da93ce235e88b43ad0313288b4dcac0cf3238b64825194
MD5 db5a2afd4ce3b31b8fed8fdf867b7283
BLAKE2b-256 9719630cf8a331583a686ea3e886a7b9bd1f23c39c84833887725d66897bd810

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page