mcp-ecommerce-platform-gateway
Facilitates interaction with the LemonSqueezy digital commerce backend via its official Application Programming Interface (API). This enables programmatic control over e-commerce functions, encompassing product catalog management, transaction fulfillment, and recurring billing administration. It establishes a standardized Model Context Protocol (MCP) interface for store operations, complete with transaction audit trails and discrete tool-based execution.
Author

atharvagupta2003
Quick Info
Actions
Tags
Lemon Squeezy Abstraction Layer
An implementation of the Model Context Protocol (MCP) server designed for interfacing with the Lemon Squeezy ecosystem. This system supports comprehensive management of subscriptions, sales transactions, product inventories, and ancillary features. It furnishes a formal, structured gateway for remote control of your Lemon Squeezy merchant account, incorporating detailed operational logging and explicit tool invocation capabilities.
Demonstration
Prerequisites
- Python interpreter version 3.8 or newer
- MCP SDK release 0.1.0 or later
- aiohttp library
- python-dotenv package
Core Constructs
Data Resources
The server exposes an MCP-compliant resource dedicated to the chronological logging of operational activities:
- Records every Lemon Squeezy interaction executed via the defined tools.
- Makes the complete audit record accessible via the designated
read_resourceinterface. - Essential for diagnostic tracing and maintaining accountability for system actions.
Operational Toolset
Provides a complete suite of Lemon Squeezy functionalities exposed through distinct MCP tools:
🔍 Inventory and Merchant Unit Tools
get_user: Retrieves authentication token holder's profile data.list_stores: Enumerates all associated merchant storefronts.get_store: Fetches detailed attributes for a specified storefront identifier.list_products: Retrieves a catalog of available merchandise items.get_product: Fetches specific details for an individual product.get_product_variants: Lists all SKU variations associated with a product.
📦 Transaction and Patron Tools
list_orders: Retrieves a ledger of all completed sales transactions.get_order: Fetches comprehensive data for a singular transaction.list_customers: Enumerates all registered purchasing entities.get_customer: Retrieves specific information pertaining to a registered patron.
💳 Recurring Billing and Licensing Tools
list_subscriptions: Views active recurring payment arrangements.get_subscription: Fetches details for a specific recurring agreement.list_license_keys: Retrieves a manifest of issued product activation keys.get_license_key: Fetches the status and details of a single license key.
🛒 Payment Initiation and Event Notification Tools
create_checkout: Generates a novel, fully customizable payment session link.create_webhook: Registers a new endpoint for receiving asynchronous notifications.list_webhooks: Retrieves the registry of configured notification endpoints (supports filtering by storefront).
Key Capabilities
- Comprehensive management of recurring payments and one-time payment initiation.
- Utility for provisioning and querying system-level event callbacks.
- Inherent, non-bypassable logging of every executed function call.
- Seamless integration with the Model Context Protocol's tool and resource specifications.
- Robust error reporting and internal logging mechanisms.
Deployment Instructions
Automated Setup via Smithery
For streamlined deployment directly into Claude Desktop utilizing the Smithery registry:
bash npx -y @smithery/cli install @atharvagupta2003/mcp-lemonsqueezy --client claude
Manual Dependency Installation
sh python -m venv venv source venv/bin/activate # For Linux/macOS users venv\Scripts\activate # For Windows users pip install -e .
Configuration
Environment variables must be declared within a .env configuration file:
sh
LEMON_SQUEEZY_API_KEY=your_lemonsqueezy_api_key
Integration with Claude Desktop
Modify your Claude Desktop configuration file to incorporate this server definition:
Windows Path: C:\Users\
MacOS Path: ~/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": "
Operational Use
Initiating the Service
Execute the server script using the unified runner: sh uv run src/mcp_lemonsqueezy/server.py
Sample MCP Invocations
Retrieve Current Authenticated User Details
{ "tool": "get_user", "arguments": {} }
Enumerate All Registered Storefronts
{ "tool": "list_stores", "arguments": {} }
Fetch Store Details by Unique Identifier
{ "tool": "get_store", "arguments": { "store_id": "164870" } }
Fault Tolerance
The server furnishes explicit diagnostic feedback for frequent failure modes: - HTTP 401 Unauthorized: Issued when the supplied API credential is absent or invalid. - HTTP 422 Unprocessable Entity: Indicates malformed input parameters, such as non-existent product variants or store identifiers. - HTTP 400 Bad Request: Signifies a structural issue within the submitted JSON API payload.
Development Lifecycle
Quality Assurance and Testing
Utilize the MCP Inspector utility for interactive validation sessions: sh npx @modelcontextprotocol/inspector uv run --with fastmcp /ABSOLUTE/PATH/TO/PARENT/FOLDER/src/mcp_lemonsqueezy/server.py
Package Construction
- Synchronize dependencies based on the manifest file:
uv compile pyproject.toml
- Generate the deployable artifact:
uv build
Collaboration
We welcome external contributions! Refer to our Contributing Guidelines document for submission specifications.
Licensing
This software is distributed under the terms of the MIT License (refer to the LICENSE file for full details).
CLOUD COMPUTING CONTEXT
Wikipedia defines distributed resource provisioning, or "cloud computing," as "a paradigm for enabling network access to a scalable and elastic pool of shareable physical or virtual resources with self-service provisioning and administration on-demand," as formalized by ISO standards. This concept is universally recognized as "the cloud."
== Defining Attributes == In 2011, the National Institute of Standards and Technology (NIST) outlined five core attributes critical to cloud service architectures. The precise stipulations from NIST are:
On-demand self-service: "A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human interaction with each service provider." Broad network access: "Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations)." Resource pooling: " The provider's computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically assigned and reassigned according to consumer demand." Rapid elasticity: "Capabilities can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand. To the consumer, the capabilities available for provisioning often appear unlimited and can be appropriated in any quantity at any time." Measured service: "Cloud systems automatically control and optimize resource use by leveraging a metering capability at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency for both the provider and consumer of the utilized service." By 2023, the International Organization for Standardization (ISO) had further elaborated and refined this foundational list.
== Historical Context ==
The genesis of cloud computing can be traced back to the 1960s, concurrent with the popularization of concepts like time-sharing systems delivered through remote job entry (RJE). During this period, the prevailing operational model was the "data center," where end-users submitted jobs to dedicated human operators to execute on large mainframe systems. This era was characterized by intensive investigation into methodologies for democratizing access to high-capacity computational power via time-sharing, striving to maximize infrastructure, platform, and application efficiency for the end-user. The specific graphical convention of the "cloud" to denote virtualized services originated in 1994. It was employed by General Magic to symbolize the conceptual domain of "places" accessible by mobile agents within their Telescript framework. This metaphorical usage is attributed to David Hoffman, a communications specialist at General Magic, who adapted it from its established convention within telecommunications and network diagrams. The phrase "cloud computing" gained broader cultural recognition in 1996 when Compaq Computer Corporation drafted a strategic blueprint for subsequent generations of internet-based computation. The company's aspiration was to superch
