mcp

v1.5.0
@offerswap/mcp Checked 12 hours ago Published 1 day ago

MCP server for OfferSwap (offerswap.com, formerly buygolinks), the ad tracker and affiliate tracking software: build campaigns, flows, postbacks, split tests…

Model Context Protocol (MCP) server for offerswap.com: create and manage branded short links, campaigns, offers, and analytics from any MCP-compatible AI agent: Claude Desktop, Cursor, Cline, Continue, Hermes, and others. OfferSwap was called buygolinks until November 2026, and this package replaces @buygolinks/mcp. Configs that still set BUYGOLINKS_API_KEY or BUYGOLINKS_API_BASE keep working unchanged. 1. Sign in at app.offerswap.com 2. Go to Settings → API Keys → New Key 3. Copy the bgl_… token (shown once)

Summary extracted from the README.

@offerswap/mcp

Model Context Protocol (MCP) server for offerswap.com: create and manage branded short links, campaigns, offers, and analytics from any MCP-compatible AI agent: Claude Desktop, Cursor, Cline, Continue, Hermes, and others.

OfferSwap was called buygolinks until November 2026, and this package replaces @buygolinks/mcp. Configs that still set BUYGOLINKS_API_KEY or BUYGOLINKS_API_BASE keep working unchanged.

Install

No install needed. Use npx:

npx @offerswap/mcp

Get an API key

  1. Sign in at app.offerswap.com
  2. Go to Settings → API Keys → New Key
  3. Copy the bgl_… token (shown once)

Or skip the install: the hosted server

Agents that take a server URL instead of a command (anything on a phone or in the cloud) can use the hosted server, with the same tools:

  • URL: https://app.offerswap.com/mcp
  • Transport: remote, Streamable HTTP
  • Sign in: agents that use OAuth (ChatGPT, Claude.ai) need only the URL. They open the OfferSwap sign-in, you press Allow, and they get a key labelled with their name, which you can revoke under Account Settings, API keys.
  • Or a header, for agents that take one (Grok Bot): Authorization: Bearer bgl_your_key_here

The only difference: the hosted server can't read files on your computer, so upload_split_test_image takes image_url there, not file_path.

Configure your client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "offerswap": {
      "command": "npx",
      "args": ["-y", "@offerswap/mcp"],
      "env": {
        "OFFERSWAP_API_KEY": "bgl_your_key_here"
      }
    }
  }
}

Restart Claude Desktop. You'll see a 🔌 icon, and OfferSwap tools are now available.

Cursor

.cursor/mcp.json in your project, or ~/.cursor/mcp.json globally:

{
  "mcpServers": {
    "offerswap": {
      "command": "npx",
      "args": ["-y", "@offerswap/mcp"],
      "env": { "OFFERSWAP_API_KEY": "bgl_your_key_here" }
    }
  }
}

Cline / Continue / Hermes / others

Most MCP clients use the same shape. Point them at the npx -y @offerswap/mcp command with OFFERSWAP_API_KEY in the env.

Tools

Tool Description
create_link Create a short link. The destination URL is passed through untouched (include your own affiliate tag).
update_link Edit a link's destination URL, title, source label, custom domain, password, archive state, or custom alias (e.g. summer-sale → https://click.example.com/summer-sale). Repointing the destination preserves the short code, alias, and click history.
refresh_link_image Get or refresh a link's thumbnail: the Amazon product photo for /dp/ links, a screenshot of the page for anything else (og:image as the fallback). Use when a link has no thumbnail or a stale one. Returns { found: false } if nothing could be fetched this time.
list_links List your links with click counts (include_archived for archived ones).
delete_link Permanently delete a link and its click history. Archive with update_link to keep the stats.
get_link_pixels / set_link_pixels Which tracking pixels fire on a link's clicks, and as what event. A link fires only the pixels picked for it, and none without a pick.
set_link_collection Put a link in a collection, or null to take it out.
list_collections / get_collection / create_collection / update_collection / delete_collection Folders of links with their own click analytics. A collection can be a rotator: https://offerswap.com/c/{rotator_alias} sends each visitor to a random link in it.
get_account Plan, billing dates, monthly usage, report time zone and the universal postback URL.
list_api_keys / create_api_key / delete_api_key Manage API keys. A new key's token is shown once.
get_link_stats Per-link analytics (by day, country, device, browser, hour, weekday).
get_links_report Every link's clicks in a window, with unique clicks, top country and device.
convert_link_to_campaign Turn a link into a campaign on the same URL (preview: true first).
get_overview_stats Account-wide analytics.
list_domains List your branded custom short-link domains with provisioning + SSL status.
create_domain Register a new branded domain (e.g. go.acme.com). Returns the CNAME target.
verify_domain Force a fresh Cloudflare status check after DNS is added.
check_domain_dns Detect where a domain's DNS is hosted and the easiest way to connect it.
connect_domain_cloudflare Add the CNAME to the user's own Cloudflare zone with a one-time API token (never stored). For agents with no browser. In the app, the Connect Cloudflare button needs no token.
delete_domain Remove a branded domain.
get_universal_postback_url Get the account's universal postback URL (Voluum-style, /postback/u/{token}): ONE URL that works for every campaign and every network. It matches the click by clickid (alias cid) and credits whichever campaign the click belongs to. Paste it once into any network's S2S settings or your own webhook (n8n, Zapier, store order webhooks) and never update it again. Optional payout, currency, txid params. It is the account's only postback URL: campaigns and networks have none of their own. Conversions are deduped by txid: at most one conversion per (account, txid). A re-fired postback with the same txid is ignored, and a re-fire with a different payout updates the stored conversion's revenue instead of stacking a second one. No event param records a sale. event=refund or event=chargeback subtracts from revenue, and event={slug} records a custom event. A blank or unknown event gets a 400.
list_custom_events / create_custom_event / update_custom_event / delete_custom_event Manage the account's custom postback events. Sale, refund and chargeback are built in; anything else (add to cart, upsell, lead, registration) is user defined. event={slug} on any postback URL records one, and it gets its own column in campaign reports. counts_revenue adds the payout to revenue and dedupes by txid; otherwise it is counted once per click.
list_webhooks / create_webhook / update_webhook / delete_webhook / test_webhook / list_webhook_deliveries / resend_webhook_delivery Outbound webhooks: OfferSwap POSTs a new sale, refund, chargeback or custom event as signed JSON to a URL you pick (GoHighLevel, Zapier, n8n, an agent). Pick events (or * for all) and optionally campaigns, add headers, send a test, read the delivery log. Retries 5xx and timeouts for about 3 hours.
get_affiliate_program / set_affiliate_program / list_affiliates / create_affiliate / update_affiliate / add_affiliate_code / archive_affiliate / create_affiliate_invite / test_affiliate_postback / list_affiliate_offers / create_affiliate_offer / update_affiliate_offer / archive_affiliate_offer / get_affiliate_report / list_affiliate_commissions / list_affiliate_payouts / mark_affiliate_paid / review_affiliate_commission / resend_affiliate_postback Your own affiliate program (Large plan): unlimited affiliates with permanent ?aff_id= codes and aliases, public or private offers, custom-domain white-label partner portal, OfferSwap-compatible S2S postbacks with manual resend, a report by affiliate, offer, day or sub id, held tag commission review, and payouts you mark paid.
scan_page_for_split_test / click_split_test_scan / close_split_test_scan / create_split_test / update_split_test / list_split_tests / get_split_test / archive_split_test On-page split tests: scan a landing page (24h cache on tagged pages unless force: true; optional 2-minute live browse session to tap through later steps), test its copy, button colors or images, and let the property tag swap them per visitor while a revenue bandit moves traffic to the variant making the most money per visitor. Start, pause, end with a winner, and add or retire variants (Original a eligible).
upload_split_test_image Upload a picture for an image variant.
list_report_views / create_report_view / update_report_view / delete_report_view / set_active_report_view Saved report views: a name plus the report columns in the user's order, kept on the account. active is the view reports open on: fewer, all, or a view id. Views change which columns show, never the numbers.
set_account_timezone Set the IANA time zone (e.g. America/New_York) the account's reports count days, weekdays and hours in, or null to clear it. get_campaign_stats, get_tracker_overview and get_property_stats also take tz to override it for one call, and echo the zone they used as timezone.
set_sale_alerts Turn the "New sale" card on the Dashboard's Realtime map on or off (enabled). On by default. Saved on the account.
list_affiliate_networks / create_affiliate_network / update_affiliate_network / delete_affiliate_network Manage affiliate networks. Their sales come back on the account's one postback URL (get_universal_postback_url); networks have no postback URL of their own. conversion_param is the click id name appended to the network's offer URLs. Set amazon_tag (e.g. yourtagid-20) on an Amazon network to auto-tag every Amazon link with ?tag=… at click time.
list_offers / create_offer / update_offer / archive_offer / refresh_offer_image Manage destination URLs ("offers"). Optionally tied to an affiliate network so the right conversion-param name is propagated on outbound clicks. An offer has no short link of its own; the link for an ad comes from a campaign. list_offers shows each offer's product_image_url and campaign links, and refresh_offer_image captures or refreshes an offer's thumbnail (Amazon product photo or page screenshot). Offers are archived, never deleted (archive_offer; update_offer archived=false restores; list_offers include_archived).
create_offer_link Get a shareable link for an offer: makes the simplest campaign, every click to the offer.
list_landers / create_lander / update_lander / delete_lander Manage landing pages. Lander URLs may contain {clickid} tokens which the resolver expands.
list_traffic_sources / create_traffic_source / update_traffic_source / delete_traffic_source Manage traffic sources: the platforms you buy traffic from (Facebook, TikTok, Google, …). Each has a name, optional platform, and token_params mapping the source's click macros onto the UTM params (e.g. Facebook utm_content = Ad ID {{ad.id}}). list_traffic_sources returns a presets catalog. Campaigns reference one via traffic_source_id.
list_tracking_pixels / create_tracking_pixel / update_tracking_pixel / delete_tracking_pixel / test_tracking_pixel Manage ad-platform pixels (Facebook, Google, TikTok, …). Each pixel has a default_event (e.g. Purchase, Lead, CompletePayment) and, for Facebook/TikTok, an optional server-side Conversions API capi_token and a Meta test_event_code (test mode: events land in Test events and never count). Pixels report last_sent_at / last_error for their last server send, and test_tracking_pixel sends one test event (it needs a test event code). list_tracking_pixels also returns a platforms catalog with each platform's valid events, defaultEvent, and capi support. A pixel never fires on its own: a short link fires it only when picked for that link, and a campaign sends only the events it picked. As of 0.38.0 the token is shown only as capi_token_tail (its last four), and saving a Facebook pixel's id or token returns meta_check, whether the token can send to that dataset (an empty event batch, nothing recorded).
list_campaigns (include_archived) / create_campaign / get_campaign / update_campaign / archive_campaign / duplicate_campaign Manage campaigns. Campaigns are archived, never deleted (archive_campaign, 0.39.0; the delete_* names still work and archive). duplicate_campaign deep-copies a campaign (settings + full routing flow + offer/lander pools) into a fresh short link named COPY - {name} (COPY (1) - … when copying a copy); stats and the unique direct-link tags are not carried over. One campaign = one tracked short link + N offers (weighted) + N optional landers + a pixel snippet. Sales come back on the account's one postback URL. A campaign references one saved traffic source via traffic_source_id and an optional conversion_pixel_id that receives the campaign's events server-side via the pixel's CAPI token (a pixel with no CAPI token can't fire back). pixel_events says which events reach it and as what, keyed by conversion (a sale), a traffic event (lander_view, visit, offer_click, as of 0.38.0) or a custom event slug, e.g. {"conversion":{"event":"Purchase","first_only":true},"upsell":{"event":"Purchase"},"initiate_checkout":{"event":"InitiateCheckout"}}; with none set, only sales are sent, as conversion_event. Add &email= to the postback URL so the platform can match buyers (hashed, never stored). report_value_mode controls the value reported back: payout (real), fixed (a set number), or adjusted (payout − report_value_adjust_pct% − report_value_adjust_flat) so you can withhold your margin. Each campaign also returns a click_url (…/click): the single, campaign-agnostic lander CTA link (same on every campaign, so one lander serves many) that always resolves to an offer (never a dead page); the campaign is read from the visitor's cookie or the ad's ?utm_campaign={slug} (matched against any of the campaign's direct-link tags) forwarded onto the CTA. direct_slugs lets a campaign can claim MULTIPLE direct-link tags (an array of strings or { slug, label } objects, each routing through the campaign's flow) so you run traffic straight to a lander with no tracker hop (?utm_campaign={slug} resolves the campaign at /click and stitches via the property tag); handy for migrating an older campaign or turning a lander already getting direct traffic into a campaign. The legacy single direct_slug is deprecated but still accepted (responses mirror it to the oldest slug). fallback_url is the never-dead-end guarantee. As of 0.33.0 each lander and offer node in set_campaign_flow takes phone_open (app, browser, stay, or null): what a phone tap to that step does, so a campaign can leave Facebook's browser for Safari or Chrome at the landing page, at the offer, at both or at neither. create_link/update_link take it too. The campaign-wide open_in_browser is an older default that per-node picks override.
set_campaign_offers / set_campaign_landers Replace the campaign's offer/lander split. Items are { offer_id, weight } / { lander_id, weight }.
get_campaign_flow / set_campaign_flow Read/replace the campaign's routing flow graph (n8n-style). Nodes are source (one entry) / lander / offer; weighted edges go source→lander, source→offer, or lander→offer. The resolver walks this graph per click so a specific lander routes to its own specific offers. Use it to split-test offers, divert a lander to a different offer, or insert a landing page before an offer. Set direct: true on a lander the ad links straight to, so the campaign link goes on to its offers instead of back to the page. As of 0.42.0 a rule node (name, conditions, priority) sends the visitors it matches (country, region, city, device, OS, browser, in-app browser, language, IP range, ISP, referrer, URL parameter, time of day, weekday) down its own branches, Voluum style; it hangs off the source or a lander and everyone else keeps to the plain edges. Saving also re-derives the flat offer/lander pools.
get_campaign_stats Full campaign report: visits, lander views, offer clicks, conversions (sales), refunds, chargebacks, custom events, net revenue, gross_revenue, reversed_revenue, cost, profit, CTR/CR/EPC/AOV/ROI (aov is net revenue per sale, after refunds and chargebacks; gross_aov is gross revenue per sale, before them; epc is gross revenue per offer click, before them), recent events, plus Voluum-style breakdowns: grouped rows ({key, visits, clicks, conversions, refunds, chargebacks, revenue, gross_revenue, reversed_revenue, cost, custom, ctr, cr, epc}; cost is ad spend only (CPC today), refunds and chargebacks are reversed_revenue) for 10 dimensions: utm_campaign / utm_source / utm_content / utm_term / lander / offer / country / device / day. Downstream events attribute to the utm values of the visit that minted their click_id; the offer dimension attributes each visit to the offer its click routed to (keyed by offer name); the lander dimension is the page the click came from (host+path; full paths for pages running the property tag, ad-platform hosts for straight-from-ad clicks); empty values group as (none). Drill-down: pass any dimension as a filter (e.g. utm_campaign + read breakdowns.offer to see which split-test offer converts for that ad), and the whole report narrows to that slice; filters combine. Window: rolling days or an explicit from/to range. Pass group (up to 3 dimensions, custom tokens as param:<name>) for a stacked report.rows tree, which defaults to offer. passed_dims lists the tokens the URLs really carried, and dim_labels the names the user gave them, set with update_campaign. breakdowns: false skips the ten fixed breakdowns for a faster call.
list_event_rules / create_event_rule / update_event_rule / delete_event_rule Event rules on a property: what its tag fires with no code on the page. A visit to a matching page (a thank-you page sale, with a fixed amount or one read from a URL parameter, and an order id parameter so one order counts once) or a click on a button (by CSS selector or its words), reported as a sale or a custom event. With an OfferSwap click on the visitor the event is booked on it like a postback; without one it stays on the property and still reaches the campaign when the page is one of its landers.
list_properties / create_property / get_property / update_property / archive_property Manage properties (archived, never deleted, as of 0.39.0): GTM/GA-style site containers. One property = one universal tag (/t.js?p={key}) the user installs on every page of their site. Every page auto-reports pageviews, time-on-page, scroll, outbound clicks, and conversions; campaign traffic auto-attributes by click. create_property requires an active custom domain (the tag is served first-party from the user's own domain so it tracks on iOS/Safari) and returns the bound tracking_domain + install snippet.
set_property_campaigns Link/unlink campaigns to a property (many-to-many, for the source split in reports). Items are { campaign_id }.
get_property_stats Full property report: page views, unique visitors, outbound, conversions, revenue, avg time/scroll, top pages, source split (organic vs campaign), country/device/browser/referrer breakdowns, recent events.
list_property_pages Distinct pages seen across all the user's properties (most-viewed first): { url, path, title, property_name, views }. Any page here can be used as a campaign lander: pass its url to create_lander, then wire that lander into a campaign flow with set_campaign_flow.
get_tracker_overview Unified Tracker dashboard across both streams (sites + campaigns) in one call: totals (page views / visitors / visits / offer clicks / conversions / revenue), daily activity, country/device/browser breakdowns, per-property + per-campaign rollups (each campaign with lander_views and direct_lander), a per-UTM-campaign rollup (auto-detected Google utm_* tags), a per-utm_source rollup with sales credited to the visit's UTMs, and the 50 most recent events. Window: days or from/to; scope with offer_id or property_id. The "is everything running and getting traffic?" view.
get_realtime The last 30 minutes across every campaign and property, Google Analytics Realtime style: active people in the last 30 and 5 minutes, a count per minute, active people by campaign, page views by page, the funnel in order (page views, visits, offer clicks, custom events, sales, upsells) with events and people, and people per city with coordinates, plus gross revenue since midnight (revenue_today, before refunds and chargebacks) and net (net_revenue_today), and the newest sales of the last 30 minutes with offer and city (recent_sales), optional tz, and sales_only for just the newest sales. Bots are left out.
get_tracker_events Unified event log across both streams with full search / filter / sort over auto-detected UTM tags. q free-text, stream, event, exact utm_* filters, scope by campaign_id / offer_id / property_id / link_id, days or from/to, sort/dir on any column, pagination. Campaign rows carry the location, IP and UTMs of the visit on their click. Returns events + facets (distinct UTM values) + total.

Example prompts

"Create a short link for https://www.amazon.com/dp/B0CFG6RB6T?tag=mytag-20 with the title 'Anker GaN charger'."

"How many clicks did I get last week? Which country drove the most?"

"Show me the top 5 most-clicked links and their countries."

License

MIT