Back to Blog
10 min readApril 3, 2026Technical

AI Agents as Affiliate Marketers: How MCP Unlocks a New Commerce Distribution Channel

By Andrew Shaw

Affiliate marketing is a $17 billion industry, and its core mechanic has barely changed in two decades: a publisher sends traffic to a merchant, a cookie tracks the referral, and the publisher gets paid when the visitor buys something. The model works because incentives align perfectly. Bloggers, coupon sites, cashback apps, influencer networks — they all operate on performance. No sale, no payout. Merchants love it because it is zero-risk customer acquisition.

But the landscape of product recommendations is shifting beneath us. AI agents are now the fastest-growing source of purchase influence. When a shopper asks Claude for the best running shoe under $150, or when a Perplexity search surfaces a specific moisturizer for dry skin, or when a custom deal-finder bot scans a product catalog on the user's behalf — those are product recommendations. They drive purchase intent. In many cases, they drive actual purchases.

And right now, nobody gets credit. Nobody gets paid.

The attribution breaks completely. The brand has no visibility into which AI agent recommended their product. The agent has no financial incentive to recommend one brand's product over a competitor's. The entire distribution channel — potentially the most important new channel since social commerce — operates in a vacuum of incentives.

Agent Affiliate MCP changes that. It gives AI agents the same economic relationship with brands that human affiliates have had for years: recommend a product, drive a sale, earn a commission. Except it works over a standardized protocol, requires no manual onboarding, and an agent can go from discovery to first commission in under a minute.

What is Agent Affiliate MCP?

Agent Affiliate MCP is an extension of Anthropic's Model Context Protocol that layers affiliate commerce capabilities on top of a product catalog. It is not a separate system bolted on after the fact. The affiliate mechanics are exposed as tools within the same MCP server that serves product data, FAQs, brand information, and cart operations. This matters because it means an agent does not need to integrate with two systems — one for product discovery and another for affiliate tracking. It is a single connection.

Here is how it works at a high level. A brand installs chatcast.io on their Shopify store. This spins up an MCP server for that store, accessible at a public endpoint. The MCP server exposes tools across three categories: product discovery (search, details, FAQs, policies), commerce actions (cart management, checkout), and an affiliate layer (registration, commission rates, discount codes, earnings).

An AI agent connects to the MCP server and calls register_agent. The server returns a unique agent_id. From that point forward, every tool call the agent makes is attributed to that agent_id. When the agent searches for products, adds items to a cart, or generates a checkout URL, the attribution follows. If the shopper completes the purchase, the agent earns a commission.

The agent can also call get_my_discount_code to get a unique, trackable promo code tied to a specific campaign. This code serves double duty: it gives the shopper a real discount (increasing conversion), and it provides hard attribution back to the agent even if the shopper does not check out through the agent's generated cart URL.

The result is a three-sided value exchange. The brand gets a new distribution channel that is entirely pay-on-performance — no upfront cost, no contract negotiation, no tracking pixel setup. The agent gets a revenue stream that rewards it for making good recommendations. The shopper gets a relevant product recommendation and a discount code. Everyone's incentives point in the same direction.

The Technical Architecture

Discovery

Every chatcast.io-enabled store exposes a discovery endpoint at:

https://mcp.chatcast.io/{store_id}/.well-known/mcp.json

This follows the MCP specification's discovery mechanism. An agent that knows the store ID — or discovers it through a registry — can fetch this JSON document to find the MCP server endpoint, the transport protocol, and the list of available tool categories. There is no API key required for discovery. The MCP server itself is public, which is a deliberate design choice: brands want agents to find them.

Transport

The MCP server uses http+sse — Streamable HTTP with Server-Sent Events. This means the agent connects to the server endpoint at:

https://mcp.chatcast.io/mcp/public/{store_id}

The transport is plain HTTP. No proprietary SDK is required. Any HTTP client that supports SSE can connect. This is important for agent builders because it means you can integrate from Python, TypeScript, Rust, or any language with an HTTP library. If you are using Anthropic's MCP client SDK, it handles the transport natively. If you are rolling your own agent framework, you just need to POST JSON-RPC requests and read SSE responses.

Tool Categories

The tools exposed by the MCP server fall into three groups:

Product Discovery: search_products (semantic search across the catalog), get_product_details (full product info including variants, pricing, images), get_faqs (AI-generated frequently asked questions for a product), get_policies (shipping, returns, etc.), and get_brand_info (brand story, values, key details).

Commerce Actions: create_cart, add_to_cart, update_cart_item, remove_from_cart, get_cart, and get_checkout_url. These are the transactional tools that let an agent build a cart and generate a Shopify checkout link on behalf of the shopper.

Affiliate Layer: register_agent, get_commission_rates, get_active_campaigns, get_my_discount_code, get_agent_offers, get_my_earnings, and capture_lead. These are the tools that turn a product catalog into a distribution channel.

Attribution

Attribution is the critical piece. When an agent calls register_agent, it receives an agent_id. This ID is implicitly associated with the agent's session. Every subsequent tool call — every product search, every cart addition, every checkout URL generation — is tagged with that agent_id on the server side. The checkout URL includes attribution parameters. The discount code, if used, maps back to the agent. This means attribution survives even if the shopper copies the checkout URL into a different browser, or comes back to the store a day later and uses the discount code directly. The agent does not need to manage cookies, tracking pixels, or UTM parameters. The MCP server handles it.

The Affiliate Lifecycle: A Code Walkthrough

Let's walk through the full lifecycle of an AI agent acting as an affiliate, from connection to commission. The following Python code uses the MCP client pattern.

Step 1: Connect to the MCP Server

from mcp.client import MCPClient

# Connect to a chatcast.io-enabled store
store_id = "acme-skincare"
server_url = f"https://mcp.chatcast.io/mcp/public/{store_id}"

client = MCPClient(transport="http+sse")
session = await client.connect(server_url)

The agent establishes a connection to the store's MCP server. No authentication is required — the server is public by design. The http+sse transport means this is a standard HTTP connection with SSE for streaming responses.

Step 2: Register as an Affiliate

# Register this agent as an affiliate partner
registration = await session.call_tool("register_agent", {
    "agent_name": "DealFinder Bot",
    "agent_description": "AI shopping assistant specializing in skincare recommendations",
    "website_url": "https://dealfinder.example.com"
})

agent_id = registration["agent_id"]
# agent_id: "agt_7kx9m2p4"

The agent calls register_agent with basic metadata about itself. The server returns a unique agent_id. This registration is persistent — the agent only needs to register once per store. From this point, every tool call in this session is attributed to agt_7kx9m2p4.

Step 3: Search for Products

# A shopper asks: "What's a good vitamin C serum under $50?"
results = await session.call_tool("search_products", {
    "query": "vitamin C serum under $50",
    "limit": 5
})

# Returns ranked product results with IDs, titles, prices, and relevance scores
for product in results["products"]:
    print(f"{product['title']} — ${product['price']}")

The search is semantic, not keyword-based. The MCP server understands "under $50" as a price constraint and "vitamin C serum" as a product category. Results come back ranked by relevance.

Step 4: Get Full Product Details

# Get detailed info on the top result
top_product_id = results["products"][0]["id"]

details = await session.call_tool("get_product_details", {
    "product_id": top_product_id
})

# Returns: title, description, ingredients, variants, images, pricing, availability

The agent now has everything it needs to make an informed recommendation: full ingredient list, variant options (sizes, bundles), high-resolution images, and current stock status.

Step 5: Check Commission Rates

# What does the agent earn on a sale?
rates = await session.call_tool("get_commission_rates", {})

# {
#   "default_rate": 0.08,
#   "currency": "USD",
#   "commission_type": "percentage",
#   "note": "8% commission on net sale price"
# }

The default commission rate is 8%. On a $45 serum, that is $3.60 per sale. The agent can also check for active campaigns that might offer a higher rate.

Step 6: Get a Trackable Discount Code

# Check for active campaigns with bonus rates
campaigns = await session.call_tool("get_active_campaigns", {})

# Get a unique discount code for this agent
discount = await session.call_tool("get_my_discount_code", {
    "campaign_id": campaigns["campaigns"][0]["id"]
})

# {
#   "code": "DEALFINDER-ACME-15",
#   "discount_percent": 15,
#   "campaign_name": "Spring Skincare Launch",
#   "commission_rate": 0.12,
#   "expires_at": "2026-05-01T00:00:00Z"
# }

The agent now has a unique promo code: DEALFINDER-ACME-15. This code gives the shopper 15% off and earns the agent a boosted 12% commission (up from the default 8%) because this campaign incentivizes agent-driven distribution during a product launch.

Step 7: Recommend the Product

At this point, the agent has everything it needs to make a recommendation to the shopper. The agent composes a message with the product details, the discount code, and a reason to buy:

# The agent constructs its recommendation to the shopper
recommendation = f"""
I found a great option for you: {details['title']} at ${details['price']}.

{details['description']}

I have a 15% discount code for you: DEALFINDER-ACME-15
That brings the price down to ${details['price'] * 0.85:.2f}.

Want me to add it to your cart?
"""

Step 8: Build the Cart and Generate Checkout

# Shopper says yes — build the cart
cart = await session.call_tool("create_cart", {})

await session.call_tool("add_to_cart", {
    "cart_id": cart["cart_id"],
    "product_id": top_product_id,
    "variant_id": details["variants"][0]["id"],
    "quantity": 1
})

# Generate an attributed checkout URL
checkout = await session.call_tool("get_checkout_url", {
    "cart_id": cart["cart_id"],
    "discount_code": "DEALFINDER-ACME-15"
})

# checkout["url"]: "https://acme-skincare.myshopify.com/checkout/..."
# The URL includes agent attribution parameters

The checkout URL is a standard Shopify checkout link with the discount pre-applied and the agent attribution baked in. The shopper clicks the link, completes the purchase on Shopify's checkout, and the agent gets credited.

Step 9: Check Your Earnings

# Later — check how the agent is performing
earnings = await session.call_tool("get_my_earnings", {})

# {
#   "total_earned": 84.60,
#   "total_sales": 12,
#   "pending_commission": 23.40,
#   "paid_commission": 61.20,
#   "currency": "USD"
# }

The agent can query its own earnings at any time. This enables agent builders to track ROI across stores, optimize which products they recommend, and build dashboards for their own agent fleet's performance.

The Incentive Alignment

Traditional affiliate marketing has friction everywhere. A brand wants to add a new affiliate partner? That means a contract, an onboarding call, integration of tracking pixels or a postback URL, approval workflows, and a 30-day review period before the first commission check. For a large publisher, that overhead is worth it. For the long tail of small affiliates, it is prohibitive. Most brands reject 80% of affiliate applications because the overhead of managing them exceeds the expected revenue.

Agent Affiliate MCP eliminates that friction. An agent goes from zero to earning commissions in three API calls: discover the MCP server, register as an affiliate, get a discount code. There is no application to fill out. No contract to sign. No pixel to install. The brand sets a commission rate once, and every agent that connects gets access to it.

But the more interesting shift is in recommendation quality. Traditional affiliates are incentivized to drive clicks, not sales. A coupon site gets credit whether the shopper buys a product that fits their needs or returns it a week later. Agent Affiliate MCP ties commission to completed sales, net of returns. This means the agent is financially incentivized to recommend the right product — the one the shopper will actually keep. An agent that recommends poorly will see low conversion rates and high return rates, which directly hits its earnings. An agent that recommends well builds a track record of high conversion and earns more over time.

This is the alignment that was missing. Agents were already recommending products. Now they have a reason to recommend yours — and to recommend well.

What Brands Need to Do

Enabling your Shopify store for Agent Affiliate MCP through chatcast.io is straightforward. The setup has four steps and takes under 15 minutes.

First, install the chatcast.io app on your Shopify store. This syncs your product catalog, generates AI-powered FAQs for your products, and spins up your MCP server.

Second, set your default commission rate. The platform default is 8%, which is competitive with standard affiliate networks. You can adjust this up or down based on your margins.

Third, optionally create campaigns. A campaign is a time-bound promotion with a bonus commission rate and a shopper-facing discount. For example, a "Summer Launch" campaign might offer agents 12% commission (up from 8%) and give shoppers 15% off for the month of June. Campaigns are how you signal to agents that your store is worth prioritizing.

Fourth, that is it. Your store is now discoverable at https://mcp.chatcast.io/{your_store_id}/.well-known/mcp.json. Any MCP-compatible AI agent can find your store, browse your products, register as an affiliate, and start driving sales. The chatcast.io platform handles discount code generation, attribution tracking, commission calculation, and payout reporting. You monitor performance from the chatcast.io dashboard, the same way you would monitor any other sales channel.

There are no integration fees, no per-agent costs, and no minimum commitments. You pay commission only when an agent drives an actual sale.

Early Access

chatcast.io is currently in early access for Agent Affiliate MCP. The platform is live and connected to Shopify stores today.

If you are building an AI agent that touches product recommendations — a shopping assistant, a deal finder, a comparison bot, a vertical-specific advisor — you can connect to any chatcast.io-enabled store right now. The MCP server is public. The protocol is Anthropic's open MCP standard. You do not need a proprietary SDK, and you do not need permission from the brand to connect and browse their catalog. Registration as an affiliate is instant.

If you are a Shopify brand and want to open your store to AI agent distribution, the setup takes under 15 minutes and requires no engineering work on your side. You get a new distribution channel that is entirely pay-on-performance, with full visibility into which agents are driving sales and at what conversion rate.

We are working with early partners across skincare, supplements, home goods, and apparel. Agents in the network are already driving attributed sales.

Apply for early access at chatcast.io/agent-affiliate or reach out directly at partnerships@chatcast.io.

Andrew Shaw

Founder at ChatCast

Founder of ChatCast and Comet Rocks. Building the AI sales channel for Shopify merchants — from dynamic FAQs to agent-attributed commerce via MCP.

LinkedIn