@offerswap/mcp 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,133 @@
1
- # Temporary Holding Version
1
+ # @offerswap/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Model Context Protocol (MCP) server for [offerswap.com](https://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.
4
+
5
+ OfferSwap was called buygolinks until November 2026, and this package replaces `@buygolinks/mcp`.
6
+ Configs that still set `BUYGOLINKS_API_KEY` or `BUYGOLINKS_API_BASE` keep working unchanged.
7
+
8
+ ## Install
9
+
10
+ No install needed. Use `npx`:
11
+
12
+ ```bash
13
+ npx @offerswap/mcp
14
+ ```
15
+
16
+ ## Get an API key
17
+
18
+ 1. Sign in at [app.offerswap.com](https://app.offerswap.com)
19
+ 2. Go to **Settings** → **API Keys** → **New Key**
20
+ 3. Copy the `bgl_…` token (shown once)
21
+
22
+ ## Or skip the install: the hosted server
23
+
24
+ Agents that take a server URL and a header instead of a command (Grok Bot, for one, or anything on a phone or in the cloud) can use the hosted server, with the same tools:
25
+
26
+ - URL: `https://app.offerswap.com/mcp`
27
+ - Transport: remote, Streamable HTTP
28
+ - Header: `Authorization: Bearer bgl_your_key_here`
29
+
30
+ 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`.
31
+
32
+ ## Configure your client
33
+
34
+ ### Claude Desktop
35
+
36
+ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "offerswap": {
42
+ "command": "npx",
43
+ "args": ["-y", "@offerswap/mcp"],
44
+ "env": {
45
+ "OFFERSWAP_API_KEY": "bgl_your_key_here"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ Restart Claude Desktop. You'll see a 🔌 icon, and OfferSwap tools are now available.
53
+
54
+ ### Cursor
55
+
56
+ `.cursor/mcp.json` in your project, or `~/.cursor/mcp.json` globally:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "offerswap": {
62
+ "command": "npx",
63
+ "args": ["-y", "@offerswap/mcp"],
64
+ "env": { "OFFERSWAP_API_KEY": "bgl_your_key_here" }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Cline / Continue / Hermes / others
71
+
72
+ Most MCP clients use the same shape. Point them at the `npx -y @offerswap/mcp` command with `OFFERSWAP_API_KEY` in the env.
73
+
74
+ ## Tools
75
+
76
+ | Tool | Description |
77
+ |---|---|
78
+ | `create_link` | Create a short link. The destination URL is passed through untouched (include your own affiliate tag). |
79
+ | `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. |
80
+ | `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. |
81
+ | `list_links` | List your links with click counts (`include_archived` for archived ones). |
82
+ | `delete_link` | Permanently delete a link and its click history. Archive with `update_link` to keep the stats. |
83
+ | `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. |
84
+ | `set_link_collection` | Put a link in a collection, or `null` to take it out. |
85
+ | `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. |
86
+ | `get_account` | Plan, billing dates, monthly usage, report time zone and the universal postback URL. |
87
+ | `list_api_keys` / `create_api_key` / `delete_api_key` | Manage API keys. A new key's token is shown once. |
88
+ | `get_link_stats` | Per-link analytics (by day, country, device, browser, hour, weekday). |
89
+ | `get_links_report` | Every link's clicks in a window, with unique clicks, top country and device. |
90
+ | `convert_link_to_campaign` | Turn a link into a campaign on the same URL (`preview: true` first). |
91
+ | `get_overview_stats` | Account-wide analytics. |
92
+ | `list_domains` | List your branded custom short-link domains with provisioning + SSL status. |
93
+ | `create_domain` | Register a new branded domain (e.g. `go.acme.com`). Returns the CNAME target. |
94
+ | `verify_domain` | Force a fresh Cloudflare status check after DNS is added. |
95
+ | `check_domain_dns` | Detect where a domain's DNS is hosted and the easiest way to connect it. |
96
+ | `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. |
97
+ | `delete_domain` | Remove a branded domain. |
98
+ | `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. |
99
+ | `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. |
100
+ | `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 (every line of text, buttons and images, and later steps reached by tapping through it), 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, add or retire variants. |
101
+ | `write_split_test_copy` / `upload_split_test_image` | Write variants with AI (one AI credit each: Small 20, Medium 50, Large 150 a month), and upload a picture for an image variant. |
102
+ | `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. |
103
+ | `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`. |
104
+ | `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. |
105
+ | `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. |
106
+ | `list_offers` / `create_offer` / `update_offer` / `archive_offer` | 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 campaign links. Offers are archived, never deleted (`archive_offer`; `update_offer` `archived=false` restores; `list_offers` `include_archived`). |
107
+ | `create_offer_link` | Get a shareable link for an offer: makes the simplest campaign, every click to the offer. |
108
+ | `list_landers` / `create_lander` / `update_lander` / `delete_lander` | Manage landing pages. Lander URLs may contain `{clickid}` tokens which the resolver expands. |
109
+ | `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`. |
110
+ | `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). |
111
+ | `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. |
112
+ | `set_campaign_offers` / `set_campaign_landers` | Replace the campaign's offer/lander split. Items are `{ offer_id, weight }` / `{ lander_id, weight }`. |
113
+ | `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. |
114
+ | `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. |
115
+ | `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`. |
116
+ | `set_property_campaigns` | Link/unlink campaigns to a property (many-to-many, for the source split in reports). Items are `{ campaign_id }`. |
117
+ | `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. |
118
+ | `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`. |
119
+ | `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. |
120
+ | `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`. Bots are left out. |
121
+ | `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`. |
122
+
123
+ ## Example prompts
124
+
125
+ > "Create a short link for `https://www.amazon.com/dp/B0CFG6RB6T?tag=mytag-20` with the title 'Anker GaN charger'."
126
+
127
+ > "How many clicks did I get last week? Which country drove the most?"
128
+
129
+ > "Show me the top 5 most-clicked links and their countries."
130
+
131
+ ## License
132
+
133
+ MIT
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@offerswap/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "MCP server for OfferSwap (offerswap.com, formerly buygolinks): branded short links, campaign tracking, postbacks and reports from any MCP-compatible AI agent (Claude Desktop, Cursor, Cline, Continue, Hermes).",
5
+ "type": "module",
6
+ "bin": {
7
+ "offerswap-mcp": "src/index.js"
8
+ },
9
+ "files": [
10
+ "src",
11
+ "README.md"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.0.4"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "model-context-protocol",
22
+ "offerswap",
23
+ "short-links",
24
+ "link-tracking",
25
+ "affiliate-tracker",
26
+ "postback",
27
+ "claude",
28
+ "cursor",
29
+ "buygolinks"
30
+ ],
31
+ "homepage": "https://offerswap.com",
32
+ "license": "MIT",
33
+ "scripts": {
34
+ "prepublishOnly": "node -e \"import('./src/version.js').then(m=>{const v=require('./package.json').version;if(m.VERSION!==v){console.error('src/version.js says '+m.VERSION+' but package.json says '+v+'. Make them match.');process.exit(1)}})\""
35
+ }
36
+ }
package/src/index.js ADDED
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * OfferSwap MCP server (stdio).
4
+ *
5
+ * Exposes the offerswap.com API as MCP tools so any MCP-compatible agent
6
+ * (Claude Desktop, Cursor, Cline, Continue, Hermes, etc.) can create and
7
+ * manage branded short links on the user's behalf.
8
+ *
9
+ * The tools themselves live in tools.js, shared with the hosted endpoint at
10
+ * https://app.offerswap.com/mcp (no install, for agents that take a URL).
11
+ *
12
+ * Auth: OFFERSWAP_API_KEY env var (personal access token, format bgl_…).
13
+ * Create one at https://app.offerswap.com/settings/account.
14
+ */
15
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
16
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
17
+ import {
18
+ CallToolRequestSchema,
19
+ ListToolsRequestSchema,
20
+ } from '@modelcontextprotocol/sdk/types.js';
21
+ import { TOOLS, callTool } from './tools.js';
22
+ import { VERSION as PKG_VERSION } from './version.js';
23
+
24
+ // OfferSwap was buygolinks until 2026-11-20. Configs written then still set the
25
+ // BUYGOLINKS_* names, so both are read. app.buygolinks.com/api still answers too.
26
+ const API_BASE = process.env.OFFERSWAP_API_BASE || process.env.BUYGOLINKS_API_BASE || 'https://app.offerswap.com';
27
+ const API_KEY = process.env.OFFERSWAP_API_KEY || process.env.BUYGOLINKS_API_KEY;
28
+
29
+ if (!API_KEY) {
30
+ console.error('[offerswap-mcp] OFFERSWAP_API_KEY env var is required.');
31
+ console.error(' Create one at https://app.offerswap.com/settings/account');
32
+ process.exit(1);
33
+ }
34
+
35
+ async function api(path, init = {}) {
36
+ const r = await fetch(`${API_BASE}${path}`, {
37
+ ...init,
38
+ headers: {
39
+ 'Authorization': `Bearer ${API_KEY}`,
40
+ 'Content-Type': 'application/json',
41
+ ...(init.headers || {}),
42
+ },
43
+ });
44
+ const text = await r.text();
45
+ let body;
46
+ try { body = text ? JSON.parse(text) : null; } catch { body = text; }
47
+ if (!r.ok) {
48
+ const code = body?.error || r.statusText || `http_${r.status}`;
49
+ const detail = body?.message ? ` (${body.message})` : '';
50
+ throw new Error(`OfferSwap API ${r.status}: ${code}${detail}`);
51
+ }
52
+ return body;
53
+ }
54
+
55
+
56
+ const server = new Server(
57
+ { name: 'OfferSwap', version: PKG_VERSION },
58
+ { capabilities: { tools: {} } },
59
+ );
60
+
61
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
62
+
63
+ server.setRequestHandler(CallToolRequestSchema, async (req) => {
64
+ const { name, arguments: args } = req.params;
65
+ try {
66
+ const result = await callTool(name, args, {
67
+ api,
68
+ readLocalFile: async (p) => (await import('node:fs/promises')).readFile(p),
69
+ });
70
+ return {
71
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
72
+ };
73
+ } catch (err) {
74
+ return {
75
+ isError: true,
76
+ content: [{ type: 'text', text: String(err.message || err) }],
77
+ };
78
+ }
79
+ });
80
+
81
+ const transport = new StdioServerTransport();
82
+ await server.connect(transport);
83
+ console.error('[offerswap-mcp] ready');