Swell MCP Server
A Model Context Protocol server that integrates AI assistants with Swell's e-commerce platform. Built on a production-ready TypeScript foundation, it provides comprehensive access to Swell stores for product management, order processing, and customer management through both CLI and MCP tool interfaces.
Built by - Official Swell Partners serving businesses globally with cutting-edge e-commerce solutions.
Features
Swell E-commerce Integration: Complete access to Swell's API for products, orders, and customers
Dual Transport Support: STDIO and HTTP transports for AI assistant and web integration
5-Layer Architecture: Clean separation between CLI, tools, controllers, services, and utilities
Type Safety: Full TypeScript implementation with Zod schema validation
Advanced HTTP Client: Built on swell-node SDK with connection pooling and retry logic
Comprehensive Testing: Unit and integration tests with Swell API mocking
Production Tooling: ESLint, Prettier, semantic-release, and MCP Inspector integration
Error Handling: Structured error handling with Swell-specific error contexts
Swell E-commerce Integration
This MCP server provides comprehensive integration with Swell's e-commerce platform:
Available Tools & Commands
MCP Tools:
swell_list_products- List products with filtering and paginationswell_get_product- Get detailed product informationswell_search_products- Search products with multiple criteriaswell_check_inventory- Check product inventory levelsswell_list_orders- List orders with filtering optionsswell_get_order- Get detailed order informationswell_update_order_status- Update order statusswell_list_customers- List customers with search capabilitiesswell_get_customer- Get detailed customer informationswell_search_customers- Search customers with multiple criteria
Features Demonstrated
Product Management: Complete product catalog access with inventory tracking
Order Processing: Order lifecycle management with status updates
Customer Management: Customer profiles with order history and analytics
Error Handling: Structured errors for API failures and validation issues
Response Formatting: Clean Markdown output with structured data tables
Configuration Requirements
Need Advanced Swell Checkout?
This MCP server demonstrates the kind of sophisticated Swell integrations that power CheckoutJet - an enterprise-grade checkout solution for Swell stores built by Devkind.
CheckoutJet transforms your Swell checkout with:
š¢ B2B Excellence - Professional invoicing, Net 30 payments, and wholesale pricing
š¦ Smart Shipping - Live rates from multiple locations with intelligent order routing
ā” Split Deliveries - Handle complex multi-vendor and multi-warehouse fulfillment
šØ Full Customization - Pixel-perfect, on-brand checkout experience
š¤ Automation - Automated invoicing, POs, and order management
š° Advanced Pricing - Dynamic discounts and tiered pricing logic
Proven Results: Over ā¬500,000 processed for Swell merchants with 23% conversion rate improvements.
Ready to upgrade your Swell checkout? Book a 15-minute demo
What is MCP?
Model Context Protocol (MCP) is an open standard for securely connecting AI systems to external tools and data sources. This server implements the MCP specification to provide AI assistants with comprehensive access to Swell's e-commerce platform, enabling intelligent store management and customer service automation.
Getting Started
First, install the Swell MCP server with your AI assistant or MCP client.
Requirements
Node.js 18 or newer
VS Code, Cursor, Windsurf, Claude Desktop, or any other MCP client
Swell store credentials (Store ID and Secret Key)
Standard config works in most MCP clients:
Follow the MCP install guide, use the standard config above.
Add to your claude_desktop_config.json:
Click the button to install:
Or install manually:
Go to Cursor Settings -> MCP -> Add new MCP Server. Name it "Swell MCP", use command type with the command npx swell-mcp. Add your Swell credentials in the environment variables section.
Follow the MCP install guide, use the standard config above. You can also install the Swell MCP server using the VS Code CLI:
After installation, the Swell MCP server will be available for use with your GitHub Copilot agent in VS Code.
Follow Windsurf MCP documentation. Use the standard config above.
Add to your MCP configuration:
Go to Advanced settings -> Extensions -> Add custom extension. Name it "Swell MCP", use type STDIO, and set the command to npx swell-mcp. Add your Swell credentials as environment variables. Click "Add Extension".
Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above with your Swell credentials.
Go to Settings -> AI -> Manage MCP Servers -> + Add to add an MCP Server. Use the standard config above.
Alternatively, use the slash command /add-mcp in the Warp prompt and paste the standard config from above.
Configuration
Getting Your Swell Credentials
Log into your Swell dashboard at login.swell.store
Navigate to Developer ā API Keys
Copy your Store ID (this is your
SWELL_STORE_ID)Copy your Secret Key (this is your
SWELL_SECRET_KEY- use the backend/admin key, not the public key)
Environment Variables
SWELL_STORE_ID: Your Swell store identifier (required)SWELL_SECRET_KEY: Your Swell secret/private key (required)DEBUG: Set to "true" to enable debug mode with raw JSON responses (optional)
Example Configuration
Usage
Once installed in your MCP client (see Getting Started above), you can use the Swell MCP tools directly through your AI assistant:
Example Interactions
Debug Mode
Enable debug mode to see raw JSON responses instead of formatted output:
Transport Modes
STDIO Transport
JSON-RPC communication via stdin/stdout
Used by Claude Desktop, Cursor AI, and other local AI assistants
Run with:
TRANSPORT_MODE=stdio node dist/index.js
Streamable HTTP Transport
HTTP-based transport with Server-Sent Events (SSE)
Supports multiple concurrent connections and web integrations
Runs on port 3000 by default (configurable via
PORTenv var)MCP Endpoint:
http://localhost:3000/mcpHealth Check:
http://localhost:3000/ā Returns server versionRun with:
TRANSPORT_MODE=http node dist/index.js
Architecture Overview
5-Layer Architecture
The server follows a clean, layered architecture that promotes maintainability and clear separation of concerns:
1. CLI Layer (src/cli/)
Purpose: Command-line interfaces for direct tool usage and testing
Implementation: Commander-based argument parsing with contextual error handling
Example:
list-products --active --category electronicsPattern: Register commands ā Parse arguments ā Call controllers ā Handle errors
2. Tools Layer (src/tools/)
Purpose: MCP tool definitions that AI assistants can invoke
Implementation: Zod schema validation with structured responses
Example:
swell_list_productstool with filtering and pagination optionsPattern: Define schema ā Validate args ā Call controller ā Format MCP response
3. Resources Layer (src/resources/)
Purpose: MCP resources providing contextual data accessible via URIs (planned feature)
Implementation: Resource handlers that respond to URI-based requests
Example:
swell://products/123resource providing product detailsPattern: Register URI patterns ā Parse requests ā Return formatted content
4. Controllers Layer (src/controllers/)
Purpose: Business logic orchestration with comprehensive error handling
Implementation: Options validation, fallback logic, response formatting
Example: Product management with inventory tracking, order processing with status updates
Pattern: Validate inputs ā Apply defaults ā Call services ā Format responses
5. Services Layer (src/services/)
Purpose: Direct external API interactions with minimal business logic
Implementation: HTTP transport utilities with structured error handling
Example: Swell API calls with authentication and data validation
Pattern: Build requests ā Make API calls ā Validate responses ā Return raw data
6. Utils Layer (src/utils/)
Purpose: Shared functionality across all layers
Key Components:
logger.util.ts: Contextual logging (file:method context)error.util.ts: MCP-specific error formattingtransport.util.ts: HTTP/API utilities with retry logicconfig.util.ts: Environment configuration management
Development Setup
For developers who want to contribute or modify the server:
Prerequisites
Node.js (>=18.x): Download
Git: For version control
Quick Start
Development Scripts
Environment Variables
Core Configuration
TRANSPORT_MODE: Transport mode (stdio|http, default:stdio)PORT: HTTP server port (default:3000)DEBUG: Enable debug logging (true|false, default:false)
Swell API Configuration
SWELL_STORE_ID: Your Swell store ID (required)SWELL_SECRET_KEY: Your Swell secret key (required)
Example .env File
Debugging Tools
MCP Inspector: Visual tool for testing your MCP tools
Run server with
npm run mcp:inspectOpen the URL shown in terminal
Test your tools interactively
Debug Logging: Enable with
DEBUG=trueenvironment variable
Create ~/.mcp/configs.json:
Available Tools
The Swell MCP server provides comprehensive e-commerce management tools for AI assistants. The list below matches the tool names and parameter schemas implemented under src/tools/.
swell_list_products
Description: List products with filtering and pagination
Parameters:
page,limit,active,category,tags,sort,expand
swell_get_product
Description: Get detailed product information
Parameters:
productId,expand
swell_search_products
Description: Search products with text queries and optional filters
Parameters:
query,page,limit,active,category,tags,sort,expand
swell_check_stock
Description: Check current stock levels and stock status for a product
Parameters:
productId,includeVariants(default: true)
swell_update_product
Description: Update product metadata and attributes (name, description, SEO, tags, categories, attributes, active, sku, etc.)
Parameters:
productIdplus any editable product fields
swell_update_product_stock
Description: Adjust stock levels or update stock tracking settings
Parameters:
productId,quantity,reason,reasonMessage,variantId,orderId
swell_update_product_pricing
Description: Update product pricing (regular price, sale price, currency)
Parameters:
productId,price,salePrice,currency
swell_list_orders
Description: List orders with filtering options
Parameters:
page,limit,status,customerId,dateFrom,dateTo,sort,expand
swell_get_order
Description: Get detailed order information
Parameters:
orderId,expand
swell_update_order_status
Description: Update the status of an order (with optional notes)
Parameters:
orderId,status,notes
swell_list_customers
Description: List customers with search and filtering options
Parameters:
page,limit,search,email,dateFrom,dateTo,sort,expand
swell_get_customer
Description: Get detailed customer information (profile + optional order history)
Parameters:
customerId,expand,includeOrderHistory
swell_search_customers
Description: Search customers using text queries (name, email, phone)
Parameters:
query,page,limit,dateFrom,dateTo,sort,expand
swell_update_customer
Description: Update customer records (name, email, phone, tags, groups, marketing opt-ins, notes)
Parameters:
customerIdplus editable customer fields
Extending the Server
This server is built with a modular architecture that makes it easy to add new Swell API integrations or custom business logic. The existing Swell tools (products, orders, customers) serve as examples for implementing additional functionality.
For detailed implementation patterns, see the existing controllers, services, and tools in the codebase.
Standalone Usage
If you want to run the server independently (not through an MCP client):
Global Installation
Direct Usage
HTTP Mode
š Take Your Swell Store Further
Impressed by this MCP server's capabilities? This is just a glimpse of what's possible with expert Swell development.
ļæ½ CheckoutJet - Enterprise Swell Checkout
Transform your Swell store with our battle-tested checkout solution:
B2B Powerhouse - Professional invoicing, Net 30 payments, wholesale pricing
Smart Shipping - Live rates from multiple locations with intelligent routing
Split Deliveries - Complex multi-vendor and multi-warehouse fulfillment
Full Customization - Pixel-perfect, on-brand checkout experience
Proven Results - ā¬500,000+ processed, 23% conversion improvements
š¤ AI & Custom Development
AI-powered integrations like this MCP server
Custom Swell applications and themes
Headless commerce implementations
Performance optimization and automation
Ready to transform your e-commerce business?
Testing Strategy
The server includes comprehensive testing infrastructure:
Test Structure
Testing Best Practices
Unit Tests: Test utilities and pure functions (
*.util.test.ts)Controller Tests: Test business logic with mocked service calls
Service Tests: Test API integration with real/mocked HTTP calls
CLI Tests: Test command parsing and execution
Test Environment Detection: Automatic test mode handling in controllers
Running Tests
Coverage Goals
Target: >80% test coverage
Focus on business logic (controllers) and utilities
Mock external services appropriately
License
Resources & Documentation
MCP Protocol Resources
MCP Inspector - Visual debugging tool
Implementation References
Awesome MCP Servers - Community examples
Swell Resources
Swell Documentation - Official API documentation
Swell Node SDK - The underlying SDK used by this server
Professional Swell Services
Looking for expert Swell development? Devkind is an official Swell partner serving businesses globally with our remote team, specializing in:
CheckoutJet - Enterprise checkout solution with B2B, shipping automation, and split deliveries
Swell Development Services - Custom apps, themes, and integrations
Headless E-commerce - API-driven storefronts and experiences
Get Started: See CheckoutJet Demo | Book FREE consultation | Email: hello@devkind.com.au | Global Remote Team
This server cannot be installed