@advertising-chat/mcp 0.2.1

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 ADDED
@@ -0,0 +1,43 @@
1
+ # @advertising-chat/mcp
2
+
3
+ MCP server for [Advertising.chat](https://advertising.chat) — give any
4
+ agent the ability to serve (clearly labeled) sponsored messages and earn
5
+ revenue from its conversations.
6
+
7
+ ```bash
8
+ ADCHAT_API_KEY=... npx @advertising-chat/mcp
9
+ ```
10
+
11
+ Agent host config:
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "adchat": {
17
+ "command": "npx",
18
+ "args": ["-y", "@advertising-chat/mcp"],
19
+ "env": {
20
+ "ADCHAT_API_KEY": "<your key from console.advertising.chat>",
21
+ "ADCHAT_AD_UNIT": "<optional default ad unit>"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ ## Tools
29
+
30
+ - **`fetch_ad`** — fetch one sponsored message for the current
31
+ conversation. Takes `conversation_context` (a short topic/intent
32
+ summary used only to select the ad), optional `subscriber` (anonymous
33
+ id for frequency capping), `ad_unit`, `format`. Returns the ad with a
34
+ mandatory sponsored-disclosure reminder and click-tracked URLs, or
35
+ `no_ad`.
36
+ - **`record_event`** — report engagement (`click`, `conversion` with
37
+ optional value/currency, or message lifecycle events) for a fetched ad.
38
+
39
+ Pair it with the [Ad Skill](https://github.com/advertising-chat/adkit/blob/main/skill/SKILL.md)
40
+ so your assistant knows *when* to fetch and how to present ads.
41
+
42
+ Env: `ADCHAT_API_KEY` (required), `ADCHAT_AD_UNIT`, `ADCHAT_BASE_URL`.
43
+ Quickstart: [docs.advertising.chat](https://docs.advertising.chat).
package/bin/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/bin/cli.js ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * AdKit MCP server (stdio).
6
+ *
7
+ * Usage: set ADCHAT_API_KEY (and optionally ADCHAT_AD_UNIT), then run
8
+ * `npx @advertising-chat/mcp` from any MCP-capable agent host.
9
+ */
10
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
11
+ const server_1 = require("./server");
12
+ async function main() {
13
+ const apiKey = process.env.ADCHAT_API_KEY;
14
+ if (!apiKey) {
15
+ console.error('ADCHAT_API_KEY is required. Get an API key from the ' +
16
+ 'Advertising.chat console (https://console.advertising.chat) and ' +
17
+ 'set it in the MCP server environment.');
18
+ process.exit(1);
19
+ }
20
+ const server = (0, server_1.createAdKitServer)({
21
+ apiKey,
22
+ adUnit: process.env.ADCHAT_AD_UNIT,
23
+ baseUrl: process.env.ADCHAT_BASE_URL,
24
+ });
25
+ await server.connect(new stdio_js_1.StdioServerTransport());
26
+ console.error('AdKit MCP server running (stdio)');
27
+ }
28
+ main().catch(err => {
29
+ console.error('AdKit MCP server failed to start:', err);
30
+ process.exit(1);
31
+ });
32
+ //# sourceMappingURL=cli.js.map
package/bin/cli.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA;;;;;GAKG;AACH,wEAAiF;AACjF,qCAA6C;AAE7C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CACX,sDAAsD;YACpD,kEAAkE;YAClE,uCAAuC,CAC1C,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,0BAAiB,EAAC;QAC/B,MAAM;QACN,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QAClC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;KACrC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,+BAAoB,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACpD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/bin/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { createAdKitServer, describeAd, AdKitServerOptions, SPONSORED_DISCLOSURE, } from './server';
package/bin/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPONSORED_DISCLOSURE = exports.describeAd = exports.createAdKitServer = void 0;
4
+ var server_1 = require("./server");
5
+ Object.defineProperty(exports, "createAdKitServer", { enumerable: true, get: function () { return server_1.createAdKitServer; } });
6
+ Object.defineProperty(exports, "describeAd", { enumerable: true, get: function () { return server_1.describeAd; } });
7
+ Object.defineProperty(exports, "SPONSORED_DISCLOSURE", { enumerable: true, get: function () { return server_1.SPONSORED_DISCLOSURE; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAKkB;AAJhB,2GAAA,iBAAiB,OAAA;AACjB,oGAAA,UAAU,OAAA;AAEV,8GAAA,oBAAoB,OAAA"}
@@ -0,0 +1,39 @@
1
+ import { Ad, AdChat, UniversalAdPayload } from '@advertising-chat/sdk';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ export interface AdKitServerOptions {
4
+ /** Org API key (ADCHAT_API_KEY). */
5
+ apiKey: string;
6
+ /** Default ad unit code (ADCHAT_AD_UNIT). Tools may override per call. */
7
+ adUnit?: string;
8
+ /** API base URL override (ADCHAT_BASE_URL); mainly for testing. */
9
+ baseUrl?: string;
10
+ /** Injected SDK client (tests). */
11
+ client?: AdChat;
12
+ }
13
+ export declare const SPONSORED_DISCLOSURE: string;
14
+ /**
15
+ * Create the AdKit MCP server: tools that let an LLM agent serve ads
16
+ * from the Advertising.chat network inside its conversations.
17
+ */
18
+ export declare function createAdKitServer(options: AdKitServerOptions): McpServer;
19
+ /**
20
+ * Convert a fetched ad into an LLM-friendly tool result: the essentials
21
+ * for presenting it, plus the disclosure duty and the raw payload.
22
+ */
23
+ export declare function describeAd(ad: Ad<UniversalAdPayload>): {
24
+ status: string;
25
+ message_id: string;
26
+ sponsored_disclosure: string;
27
+ ad: {
28
+ actions: {
29
+ phone_number?: string | undefined;
30
+ click_url?: string | undefined;
31
+ label: string;
32
+ }[];
33
+ alt_text?: string | undefined;
34
+ image_url?: string | undefined;
35
+ title: string;
36
+ subtitle: string;
37
+ };
38
+ suggested_text: string;
39
+ };
package/bin/server.js ADDED
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPONSORED_DISCLOSURE = void 0;
4
+ exports.createAdKitServer = createAdKitServer;
5
+ exports.describeAd = describeAd;
6
+ const sdk_1 = require("@advertising-chat/sdk");
7
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
8
+ const zod_1 = require("zod");
9
+ exports.SPONSORED_DISCLOSURE = 'This is a paid advertisement. When you present it, you MUST clearly ' +
10
+ "label it as sponsored (e.g. prefix with 'Sponsored:' or an equivalent " +
11
+ 'disclosure in the conversation language). Present the ad content ' +
12
+ 'faithfully — do not exaggerate, embellish, or add claims of your own. ' +
13
+ 'Use the provided click_url values verbatim for any links, so clicks ' +
14
+ 'are attributed.';
15
+ /**
16
+ * Create the AdKit MCP server: tools that let an LLM agent serve ads
17
+ * from the Advertising.chat network inside its conversations.
18
+ */
19
+ function createAdKitServer(options) {
20
+ const adchat = options.client ||
21
+ new sdk_1.AdChat({ apiKey: options.apiKey, baseUrl: options.baseUrl });
22
+ const server = new mcp_js_1.McpServer({
23
+ name: 'advertising-chat-adkit',
24
+ version: '0.1.0',
25
+ });
26
+ server.registerTool('fetch_ad', {
27
+ title: 'Fetch a sponsored message',
28
+ description: 'Fetch one sponsored message (an ad) from the Advertising.chat ' +
29
+ 'network to show in the current conversation. Call this at a ' +
30
+ 'natural pause point — after you have fully answered the user, at ' +
31
+ 'a task completion, or at a farewell — never in the middle of ' +
32
+ 'helping someone and never in sensitive moments (health crises, ' +
33
+ 'grief, distress, complaints). Pass conversation_context (a short ' +
34
+ 'summary of the topic and the user’s current intent) so the ' +
35
+ 'network can pick a relevant ad; the context is used only for ' +
36
+ 'selecting this ad and is not stored as user history. The response ' +
37
+ 'is either an ad to present — which you MUST clearly label as ' +
38
+ 'sponsored and render with its click-tracking links intact — or ' +
39
+ '"no_ad", in which case simply continue the conversation and do ' +
40
+ 'not mention ads at all. Show at most one ad every several turns; ' +
41
+ 'if you recently showed one, do not call this again yet.',
42
+ inputSchema: {
43
+ ad_unit: zod_1.z
44
+ .string()
45
+ .optional()
46
+ .describe('Ad unit (placement) code. Omit to use the configured default.'),
47
+ format: zod_1.z
48
+ .string()
49
+ .optional()
50
+ .describe("Render format. Leave unset (default 'direqt') for the " +
51
+ 'universal card payload; the tool result is already ' +
52
+ 'channel-agnostic.'),
53
+ subscriber: zod_1.z
54
+ .string()
55
+ .optional()
56
+ .describe('Stable, anonymous identifier for this end user (session or ' +
57
+ 'user id — never PII). Enables frequency capping so the same ' +
58
+ 'person is not over-exposed.'),
59
+ conversation_context: zod_1.z
60
+ .string()
61
+ .optional()
62
+ .describe('One to three sentences summarizing the conversation topic and ' +
63
+ 'what the user is trying to do right now, e.g. "User is ' +
64
+ 'planning a weekend trip to Rome and asked for hotel ' +
65
+ 'recommendations near the city center." Do not include names, ' +
66
+ 'contact details, or other personal identifiers.'),
67
+ },
68
+ }, async (args) => {
69
+ try {
70
+ const ad = await adchat.fetchAd({
71
+ adUnit: args.ad_unit || options.adUnit,
72
+ format: args.format || undefined,
73
+ subscriber: args.subscriber,
74
+ context: args.conversation_context,
75
+ });
76
+ if (!ad) {
77
+ return jsonResult({
78
+ status: 'no_ad',
79
+ note: 'No ad is available for this moment. Continue the ' +
80
+ 'conversation normally and do not mention ads or sponsorship.',
81
+ });
82
+ }
83
+ return jsonResult(describeAd(ad));
84
+ }
85
+ catch (e) {
86
+ return errorResult(e);
87
+ }
88
+ });
89
+ server.registerTool('record_event', {
90
+ title: 'Record an ad event',
91
+ description: 'Report an engagement event for an ad you previously fetched, ' +
92
+ 'using the message_id from that fetch_ad result. Use event_type ' +
93
+ '"click" when the user taps/follows an ad link that you rendered ' +
94
+ 'without its click-tracking URL, and "conversion" (optionally with ' +
95
+ 'a value and currency) when the user completes the advertised ' +
96
+ 'action. Links opened via the provided click_url values are ' +
97
+ 'tracked automatically and need no click event. Accurate events ' +
98
+ 'are how the publisher gets paid — record them when they happen, ' +
99
+ 'and never fabricate them.',
100
+ inputSchema: {
101
+ message_id: zod_1.z
102
+ .string()
103
+ .describe('The message_id returned by fetch_ad for this ad.'),
104
+ event_type: zod_1.z
105
+ .enum(['click', 'conversion', 'send', 'deliver', 'read'])
106
+ .describe('What happened: click (user followed the ad), conversion ' +
107
+ '(user completed the advertised action), or a message ' +
108
+ 'lifecycle event (send/deliver/read).'),
109
+ value: zod_1.z
110
+ .number()
111
+ .optional()
112
+ .describe('Monetary value of a conversion, if known.'),
113
+ currency: zod_1.z
114
+ .string()
115
+ .optional()
116
+ .describe("ISO currency code for value (e.g. 'USD')."),
117
+ },
118
+ }, async (args) => {
119
+ try {
120
+ if (args.event_type === 'conversion') {
121
+ await adchat.recordConversion({
122
+ messageId: args.message_id,
123
+ value: args.value,
124
+ currency: args.currency,
125
+ });
126
+ }
127
+ else {
128
+ await adchat.recordEvent({
129
+ messageId: args.message_id,
130
+ type: args.event_type,
131
+ });
132
+ }
133
+ return jsonResult({
134
+ status: 'recorded',
135
+ event_type: args.event_type,
136
+ message_id: args.message_id,
137
+ });
138
+ }
139
+ catch (e) {
140
+ return errorResult(e);
141
+ }
142
+ });
143
+ return server;
144
+ }
145
+ /**
146
+ * Convert a fetched ad into an LLM-friendly tool result: the essentials
147
+ * for presenting it, plus the disclosure duty and the raw payload.
148
+ */
149
+ function describeAd(ad) {
150
+ const p = ad.payload;
151
+ const actions = (p.actions || []).map(a => ({
152
+ label: a.text,
153
+ ...(a.navigate?.url ? { click_url: a.navigate.url } : {}),
154
+ ...(a.call?.phoneNumber ? { phone_number: a.call.phoneNumber } : {}),
155
+ }));
156
+ const firstUrl = actions.find(a => a.click_url)?.click_url;
157
+ return {
158
+ status: 'filled',
159
+ message_id: ad.messageId,
160
+ sponsored_disclosure: exports.SPONSORED_DISCLOSURE,
161
+ ad: {
162
+ title: p.title,
163
+ subtitle: p.subtitle,
164
+ ...(p.imageUrl ? { image_url: p.imageUrl } : {}),
165
+ ...(p.altText ? { alt_text: p.altText } : {}),
166
+ actions,
167
+ },
168
+ suggested_text: [
169
+ `Sponsored: ${[p.title, p.subtitle].filter(Boolean).join(' — ') || p.altText || ''}`,
170
+ ...(firstUrl ? [firstUrl] : []),
171
+ ].join('\n'),
172
+ };
173
+ }
174
+ function jsonResult(value) {
175
+ return {
176
+ content: [{ type: 'text', text: JSON.stringify(value, null, 2) }],
177
+ };
178
+ }
179
+ function errorResult(e) {
180
+ const message = e instanceof sdk_1.AdChatApiError
181
+ ? `${e.message}${e.reason ? ` (${e.reason})` : ''}`
182
+ : e instanceof Error
183
+ ? e.message
184
+ : String(e);
185
+ return {
186
+ content: [
187
+ {
188
+ type: 'text',
189
+ text: JSON.stringify({ status: 'error', error: message }),
190
+ },
191
+ ],
192
+ isError: true,
193
+ };
194
+ }
195
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;AAiCA,8CAo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,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC3E,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,CAAU;IAC7B,MAAM,OAAO,GACX,CAAC,YAAY,oBAAc;QACzB,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACnD,CAAC,CAAC,CAAC,YAAY,KAAK;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO;YACX,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAClB,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;aAC1D;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@advertising-chat/mcp",
3
+ "version": "0.2.1",
4
+ "description": "MCP server for Advertising.chat — give any agent the ability to serve ads (fetch_ad, record_event)",
5
+ "license": "MIT",
6
+ "author": "Advertising.chat",
7
+ "homepage": "https://docs.advertising.chat/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/advertising-chat/adkit.git",
11
+ "directory": "packages/mcp"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "advertising",
17
+ "ads",
18
+ "llm",
19
+ "monetization"
20
+ ],
21
+ "main": "bin/index.js",
22
+ "types": "bin/index.d.ts",
23
+ "bin": {
24
+ "adchat-mcp": "bin/cli.js"
25
+ },
26
+ "files": [
27
+ "bin",
28
+ "README.md"
29
+ ],
30
+ "scripts": {
31
+ "build": "tsc -p .",
32
+ "clean": "rm -rf ./bin",
33
+ "prepack": "npm run clean && npm run build",
34
+ "test": "mocha"
35
+ },
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "dependencies": {
40
+ "@advertising-chat/sdk": "^0.2.0",
41
+ "@modelcontextprotocol/sdk": "^1.29.0",
42
+ "zod": "^4.0.0"
43
+ }
44
+ }