How to integrate Wix MCP with LangChain

Connect LangChain to Wix MCP. List all orders placed this week, create a new product on wix store, and more using natural language, with authentication handled for you.

Wix logoWix
Oauth2Api Key

Wix is a cloud-based web development platform for building websites and stores. It's loved for its drag-and-drop tools and easy site management.

142 Tools

Introduction

This guide walks you through connecting Wix to LangChain using the Composio tool router. By the end, you'll have a working Wix agent that can query and update store orders, search products and inventory, manage contacts and labels, look up bookings, and review form submissions through natural language commands.

This guide will help you understand how to give your LangChain agent real control over a Wix account through Composio's Wix MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate Wix with

TL;DR

Here's what you'll learn:
  • Get and set up your OpenAI and Composio API keys
  • Connect your Wix project to Composio
  • Create a Tool Router MCP session for Wix
  • Initialize an MCP client and retrieve Wix tools
  • Build a LangChain agent that can interact with Wix
  • Set up an interactive chat interface for testing

What is LangChain?

LangChain is a framework for developing applications powered by language models. It provides tools and abstractions for building agents that can reason, use tools, and maintain conversation context.

Key features include:

  • Agent Framework: Build agents that can use tools and make decisions
  • MCP Integration: Connect to external services through Model Context Protocol adapters
  • Memory Management: Maintain conversation history across interactions
  • Multi-Provider Support: Works with OpenAI, Anthropic, and other LLM providers

What is the Wix MCP server, and what's possible with it?

The Wix MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Wix account. It provides structured and secure access to your store, contacts, members, forms, bookings, and site details, so your agent can search products, review orders, check inventory, retrieve contacts, and cancel orders on your behalf.

  • Product and inventory lookup: Have your agent search your Wix product catalog and check inventory items using text, filters, and sorting.
  • Order management: Direct your agent to find e-commerce orders that match your criteria or cancel an existing order.
  • Contact and member retrieval: Let the agent find Wix contacts, retrieve member details, and check member privacy settings.
  • Forms, bookings, and locations: Instruct your agent to retrieve form submissions, browse booking categories, and find business locations.
  • Store and site information: Have your agent review site properties, available coupons, loyalty discounts, tax groups, and manual tax mappings.

What is the Composio tool router, and how does it fit here?

What is Composio SDK?

Composio's Composio SDK helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Composio SDK

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Composio SDK works

The Composio SDK follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Step by step10 STEPS
1

Prerequisites

Before starting this tutorial, make sure you have:
  • Python 3.10 or higher installed on your system
  • A Composio account with an API key
  • An OpenAI API key
  • Basic familiarity with Python and async programming
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key. You'll need credits to use the models, or you can connect to another model provider.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install dependencies

npm install @composio/langchain @langchain/core @langchain/openai @langchain/mcp-adapters dotenv

Install the required packages for LangChain with MCP support.

What's happening:

  • @composio/langchain provides Composio integration for LangChain
  • @langchain/mcp-adapters enables MCP client connections
  • @langchain/core is the core agent framework
  • dotenv/config loads environment variables
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_composio_user_id_here
OPENAI_API_KEY=your_openai_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates your requests to Composio's API
  • COMPOSIO_USER_ID identifies the user for session management
  • OPENAI_API_KEY enables access to OpenAI's language models
5

Import dependencies

import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

dotenv.config();
What's happening:
  • We're importing LangChain's MCP adapter and Composio SDK
  • The dotenv/config import loads environment variables from your .env file
  • This setup prepares the foundation for connecting LangChain with Wix functionality through MCP
6

Initialize Composio client

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });
What's happening:
  • We're loading the COMPOSIO_API_KEY from environment variables and validating it exists
  • Creating a Composio instance that will manage our connection to Wix tools
  • Validating that COMPOSIO_USER_ID is also set before proceeding
7

Create a Tool Router session

const session = await composio.create(
    userId as string,
    {
        toolkits: ['wix']
    }
);

const url = session.mcp.url;
What's happening:
  • We're creating a Tool Router session that gives your agent access to Wix tools
  • The create method takes the user ID and specifies which toolkits should be available
  • The returned session.mcp.url is the MCP server URL that your agent will use
  • This approach allows the agent to dynamically load and use Wix tools as needed
8

Configure the agent with the MCP URL

const client = new MultiServerMCPClient({
    "wix-agent": {
        transport: "http",
        url: url,
        headers: {
            "x-api-key": process.env.COMPOSIO_API_KEY
        }
    }
});

const tools = await client.getTools();

const agent = createAgent({ model: "gpt-5", tools });
What's happening:
  • We're creating a MultiServerMCPClient that connects to our Wix MCP server via HTTP
  • The client is configured with a name and the URL from our Tool Router session
  • getTools() retrieves all available Wix tools that the agent can use
  • We're creating a LangChain agent using the GPT-5 model
9

Set up interactive chat interface

let conversationHistory: any[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log("Ask any Wix related question or task to the agent.\n");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
});

rl.prompt();

rl.on('line', async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
        console.log("\nGoodbye!");
        rl.close();
        process.exit(0);
    }

    if (!trimmedInput) {
        rl.prompt();
        return;
    }

    conversationHistory.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    const response = await agent.invoke({ messages: conversationHistory });
    conversationHistory = response.messages;

    const finalResponse = response.messages[response.messages.length - 1]?.content;
    console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\n👋 Session ended.');
        process.exit(0);
    });
What's happening:
  • We initialize an empty conversationHistory list to maintain context across interactions
  • A readline interface is used to continuously accept user input from the command line
  • When a user types a message, it's added to the conversation history and sent to the agent
  • The agent processes the request using the invoke() method with the full conversation history
  • Users can type 'exit', 'quit', or 'bye' to end the chat session gracefully
10

Run the application

main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});
What's happening:
  • We call the main() function to start the application

Complete Code

Here's the complete code to get you started with Wix and LangChain:

import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";  
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });

    const session = await composio.create(
        userId as string,
        {
            toolkits: ['wix']
        }
    );

    const url = session.mcp.url;
    
    const client = new MultiServerMCPClient({
        "wix-agent": {
            transport: "http",
            url: url,
            headers: {
                "x-api-key": process.env.COMPOSIO_API_KEY
            }
        }
    });
    
    const tools = await client.getTools();
  
    const agent = createAgent({ model: "gpt-5", tools });
    
    let conversationHistory: any[] = [];
    
    console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
    console.log("Ask any Wix related question or task to the agent.\n");
    
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
        prompt: 'You: '
    });

    rl.prompt();

    rl.on('line', async (userInput: string) => {
        const trimmedInput = userInput.trim();
        
        if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
            console.log("\nGoodbye!");
            rl.close();
            process.exit(0);
        }
        
        if (!trimmedInput) {
            rl.prompt();
            return;
        }
        
        conversationHistory.push({ role: "user", content: trimmedInput });
        console.log("\nAgent is thinking...\n");
        
        const response = await agent.invoke({ messages: conversationHistory });
        conversationHistory = response.messages;
        
        const finalResponse = response.messages[response.messages.length - 1]?.content;
        console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\nSession ended.');
        process.exit(0);
    });
}

main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});

Conclusion

You've successfully built a LangChain agent that can interact with Wix through Composio's Tool Router.

Key features of this implementation:

  • Dynamic tool loading through Composio's Tool Router
  • Conversation history maintenance for context-aware responses
  • Async Python provides clean, efficient execution of agent workflows
You can extend this further by adding error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.
TOOLS

Supported Tools

Every Wix action and event your agent gets out of the box.

Add Special Permissions

Tool to add special permissions to a Wix data collection for a specific user or role.

Calculate First Available Time Slots Per Menu

Calculate the first available time slots by fulfillment type per menu for a restaurant operation, identified by operation ID.

Cancel Automation Event

Tool to cancel any remaining automation actions for a trigger and external entity.

Cancel Order

Cancel an existing Wix e-commerce order by ID, optionally providing a message explaining the cancellation.

Cancel Background Task

Cancel a Wix CMS background task by ID to stop a running task that is no longer needed.

Check Content

Tool to check content text against Wix moderation rules.

Check Domain Availability

Tool to check if a domain name is available for purchase.

Count Extended Bookings

Tool to count extended bookings matching specified filter criteria.

Add Labels to Contact

Tool to add labels to a Wix contact using the Labels API.

Enable Points Expiration

Tool to enable points expiration for a Wix loyalty program.

Bulk Create Products With Inventory

Tool to bulk create products with inventory in Wix.

Create Tax Region

Tool to create a tax region in Wix using the Tax Regions API.

Bulk Delete Abandoned Checkouts

Tool to bulk delete abandoned checkouts from Wix e-commerce.

Delete Add-On Group

Tool to delete an add-on group from a Wix Bookings service.

Delete Back In Stock Notification

Tool to delete a back in stock notification request from Wix e-commerce.

Bulk Delete Benefit Items

Tool to bulk delete benefit items from Wix Benefit Programs.

Bulk Delete Billable Items

Tool to bulk delete billable items in Wix.

Delete Schedule Bookmark

Tool to remove a bookmark from a schedule item in Wix Events.

Bulk Delete Brands

Tool to delete multiple brands from the Wix Stores catalog.

Bulk Delete Translation Content

Tool to bulk delete translation content by IDs.

Bulk Delete Variants

Tool to bulk delete item variants from Wix Restaurants menus.

Delete FAQ Category

Tool to delete an FAQ category from the Wix site.

Unlabel Contact

Remove specified label keys from a Wix CRM contact by contact ID.

Delete Customization

Delete a customization from the Wix Stores catalog by its ID.

Delete Data Collection Field

Delete a field from a Wix CMS data collection by collection ID and field key.

Bulk Delete Form Schemas

Tool to bulk delete form schemas from Wix Forms.

Delete Info Section

Delete an info section from the Wix Stores catalog by its ID.

Bulk Delete Inventory Items

Tool to bulk delete inventory items from the Wix Stores catalog.

Bulk Delete Benefit Items By Filter

Tool to bulk delete benefit program items by filter criteria.

Delete Loyalty Coupon

Delete a loyalty coupon from the Wix Loyalty Program by its ID.

Delete Menu

Delete a Wix Restaurants menu by its ID.

Bulk Delete Modifiers

Tool to bulk delete item modifiers from Wix Restaurants Menus.

Bulk Delete Pool Definitions

Tool to bulk delete pool definitions from Wix Benefit Programs.

Delete Product Options

Delete all options from a Wix product, such as color and size, and reset it to a single default variant.

Bulk Delete Products

Tool to bulk delete products from the Wix Stores catalog.

Delete Program Definition

Delete a program definition from Wix Benefit Programs by its ID.

Delete Project

Delete a specific project from Wix Portfolio by its project ID.

Delete Project Item

Delete a specific project item from Wix Portfolio by its item ID.

Delete Question Entry

Delete a question entry from the Wix FAQ app by its ID.

Delete Receipt Preset

Tool to permanently delete a receipt preset from Wix.

Bulk Delete Notification Recipients

Tool to bulk delete notification recipients for Wix Restaurants online orders.

Bulk Delete Reports By Filter

Tool to bulk delete reports from the dashboard by filter criteria.

Bulk Delete RSVPs By Filter

Tool to bulk delete event RSVPs by filter criteria.

Delete Service Fee Rule

Tool to delete a service fee rule from Wix Restaurants Online Orders.

Delete Schedule Item

Tool to delete schedule items from a Wix event.

Delete Secret

Tool to delete a secret from Wix Secrets Vault.

Delete Sender Details

Tool to delete sender details from Wix email marketing.

Delete Sender Email

Tool to delete a sender email from Wix Marketing.

Delete Service

Tool to delete a service from Wix Bookings.

Bulk Delete Services By Filter

Bulk deletes Wix Bookings services matching filter criteria.

Bulk Delete Services

Tool to bulk delete services from Wix Bookings.

Delete Ticket Check-In

Tool to delete ticket check-in records for Wix Events.

Bulk Delete Ticket Definitions

Tool to bulk delete ticket definitions by filter criteria for Wix Events.

Delete Ticket Reservation

Tool to delete a ticket reservation from Wix Events.

Delete User Defined Fields

Delete specified user-defined fields from a Wix data extension schema using the schema ID and field keys.

Delete User Favorite

Tool to remove a dashboard page from the current user's list of favorite pages.

Discard Draft Schedule

Discard all changes to a Wix event's draft schedule, restoring it to its published state.

Generate Files Download URL

Tool to generate download URLs for files in Wix Media Manager.

Generate File Upload URL

Tool to generate an upload URL for uploading files to Wix Media Manager.

Get App Instance

Retrieve the current Wix app instance and associated site information.

Get Collection By Slug

Tool to retrieve a Wix Stores collection by its slug.

Get Current Member Coupons

Retrieve loyalty program coupons for the currently authenticated Wix member.

Get Folder By Site

Tool to retrieve folder information for a specific site by site ID.

Get Member

Tool to retrieve a member by ID from Wix Members.

Get Member Privacy Settings

Tool to retrieve member privacy settings for a Wix site.

Get Members Custom Field Applications

Tool to retrieve custom field applications for specified members.

Bulk Get Or Create Brands

Tool to bulk retrieve or create brands in Wix Stores catalog.

Get Purchase History

Tool to retrieve purchase history for your app on a site.

Get Roles Custom Field Applications

Tool to retrieve custom field applications for specified roles.

Get Roles Info

Tool to retrieve all available roles in the requesting Wix account, including predefined and custom roles.

Get Site Plugins Placement Status

Tool to get the placement status of your app's site plugins on the user's site.

Get Site Properties

Tool to retrieve current snapshot of a site's properties including business profile, contact information, and business schedule.

Import File to Media Manager

Tool to import a file to Wix Media Manager using an external URL.

List App Permissions

Retrieve permissions requested by a specified Wix app when users install it on a site.

List App Plans By App ID

Tool to retrieve app plans by application ID, including pricing, tax settings, and currency details.

List Email Marketing Campaigns

Tool to retrieve a list of email marketing campaigns, ordered by date_updated in descending order.

List Contacts Facets

Tool to list facets from the site's Contact List.

List Currencies

Tool to retrieve the list of available currencies from Wix Currency Converter.

List Custom Fields

Tool to retrieve a list of custom fields and fields provided by the Members Area.

List Default Tax Groups

List the default tax groups for a Wix site that are inherited by apps installed on the site.

List Default Tax Groups By App IDs

Retrieve default tax groups for specified Wix app IDs.

List Group Requests

Tool to list group requests across a Wix site.

List Invoices by Order IDs

Tool to retrieve invoice IDs and external app IDs for multiple orders.

List Manual Tax Mappings

List Wix manual tax mappings for custom tax configurations by tax group and region.

List Member Following

List the IDs of members followed by a specified Wix member.

List My Member Followers

List the IDs of members following the current authenticated Wix member, with limit and offset pagination.

List V4 Contacts

Tool to retrieve a list of up to 1,000 contacts per request from Wix.

Logout

Tool to terminate a member's session and clear authentication cookies.

Publish Draft Schedule

Publish the draft schedule for a Wix event, making its draft changes live and visible to site visitors.

Query Bookings Categories

Tool to retrieve bookings service categories with optional filtering, sorting, and pagination.

Query Contacts

Tool to retrieve up to 1,000 Wix contacts with advanced filtering, sorting, and pagination.

Query Coupons

Tool to retrieve a list of up to 100 coupons with optional paging, filtering, and sorting.

Query Deleted Forms

Tool to retrieve deleted form schemas from the trash bin for a specified namespace.

Query E-Commerce Orders

Tool to retrieve e-commerce orders with advanced filtering, sorting, and pagination.

Query Extended Bookings

Tool to retrieve up to 100 extended bookings with advanced filtering, sorting, and pagination.

Query Contact Facets

Tool to retrieve facets from the site's contact list by filter.

Query Site Folders

Tool to retrieve a list of site folders with optional paging, filtering, and sorting.

Query Form Submissions by Namespace

Tool to retrieve form submissions from a specified namespace with optional pagination.

Query Group Requests

Tool to query group creation requests with filtering, sorting, and pagination.

Query Inventory Items

Query Wix Stores Catalog V3 inventory items with optional paging, filtering, and sorting.

Query Locations

Tool to retrieve business locations with filtering, sorting, and pagination.

Query Loyalty Checkout Discounts

Query Wix loyalty checkout discounts applied using loyalty points.

Query Manual Tax Mappings

Query manual tax mappings with optional paging, filtering, and sorting.

Query Members

Retrieve Wix site members using optional filters, sorting, paging, and search.

Query Moderation Rules

Tool to retrieve moderation rules with optional filtering, sorting, and pagination.

Query Payment Links

Retrieve Wix payment links using optional filters, sorting, and cursor paging.

Query Sites

Return account sites; use a namespace filter to include headless sites.

Query Form Submissions by Namespace

Tool to retrieve form submissions from a specified namespace with advanced filtering, sorting, and pagination.

Query Tax Groups

Query a Wix site's custom tax groups with optional filtering, sorting, and pagination.

Register V2

Registers a new Wix site member with email and password authentication.

Remove Deleted Fields

Tool to permanently remove deleted fields from a Wix form schema.

Bulk Remove Info Sections By Filter

Tool to bulk remove info sections from products matching a filter expression.

Remove Tip From Order

Tool to remove a tip from an existing eCommerce order.

Reschedule Draft Schedule Items

Tool to reschedule all draft schedule items for an event at once.

Search Products

Tool to search products in the Wix store catalog using text search, filters, and sorting.

Send Recovery Email

Tool to send a password recovery email to a Wix member with a link to reset their password.

Set Customization Choices

Tool to set choices for a customization in Wix stores catalog.

Set Default Receipt Preset

Set a Wix receipt preset by ID as the default preset for receipt generation.

Bulk Unassign Events from Categories

Tool to unassign an event from multiple categories in Wix Events.

Bulk Update Billable Items

Tool to bulk update billable items in Wix.

Bulk Update Customizations

Bulk update Wix Stores Catalog V3 customizations, including names, types, choices and settings.

Bulk Update Storage Item Tags By Filter

Tool to bulk update tags on storage items matching filter criteria.

Update Business Contact

Tool to update a site's business contact information including email, phone, fax, and address.

Update Business Profile

Tool to update a site's business profile including display name, description, logo, and business name.

Update Business Schedule

Tool to update a site's business schedule including regular operating hours and special exceptions.

Bulk Update Contacts

Bulk update the same contact fields across Wix contacts selected by an optional filter or exact-match search.

Bulk Update Translation Content By Key

Tool to bulk update translation content by composite key (schemaId, entityId, locale).

Bulk Update Inventory Items By Filter

Tool to bulk update inventory items by filter criteria.

Update inventory variants

Tool to update product inventory including quantity, stock status, and tracking settings per variant.

Update Question Entry Labels

Tool to set labels for a Wix FAQ question entry.

Update Locale Settings

Tool to update a Wix site's locale configuration settings including auto-redirect behavior.

Update Operation Group Tags By Filter

Tool to bulk update tags on operation groups using filter criteria.

Bulk Update Orders

Tool to bulk update properties of up to 100 e-commerce orders.

Bulk Update Order Tags

Tool to synchronously update tags on multiple orders by list of order IDs.

Bulk Update Products By Filter

Tool to bulk update multiple products matching filter criteria in Wix Stores.

Update Receipt Preset

Tool to update a receipt preset in Wix.

Update Referral Program

Tool to update a site's referral program configuration including name, rewards, and email settings.

Update Review Moderation Status

Tool to update the moderation status of a review.

Bulk Update Review Moderation Status

Submit a bulk job to update the moderation status of reviews matching an optional filter to the same status.

Update Moderation Rule

Update a Wix Community Feedback Moderation rule's settings using its current revision.

Bulk Update Staff Member Tags By Filter

Tool to bulk update tags on Wix Bookings staff members by filter criteria.

Bulk Update Storage Item Tags

Tool to bulk update tags on multiple storage items in Wix automations.

FAQ

Frequently asked questions

Start with Wix.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Wix tool your agent needs.Free to start.

Start building