@adport/mcp 0.5.1 → 0.5.2

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/dist/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  assembleRuntime,
4
4
  runStdioServer
5
- } from "./chunk-M4VFJ5GU.js";
5
+ } from "./chunk-6RBLUIBN.js";
6
6
 
7
7
  // src/bin.ts
8
8
  var runtime = await assembleRuntime(process.argv.includes("--demo") ? { includeMock: true } : {});
@@ -12,7 +12,7 @@ import { createRedditModule } from "@adport/provider-reddit";
12
12
  // package.json
13
13
  var package_default = {
14
14
  name: "@adport/mcp",
15
- version: "0.5.1",
15
+ version: "0.5.2",
16
16
  description: "adport MCP server \u2014 the open control plane for paid media",
17
17
  license: "Apache-2.0",
18
18
  type: "module",
@@ -111,4 +111,4 @@ export {
111
111
  createMcpServer,
112
112
  runStdioServer
113
113
  };
114
- //# sourceMappingURL=chunk-M4VFJ5GU.js.map
114
+ //# sourceMappingURL=chunk-6RBLUIBN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { AdportError, CredentialStore, createContext, type AdportRuntime, type ProviderModule } from '@adport/core';\nimport { createGoogleModule } from '@adport/provider-google';\nimport { createMetaModule } from '@adport/provider-meta';\nimport { createTikTokModule } from '@adport/provider-tiktok';\nimport { createAppleModule } from '@adport/provider-apple';\nimport { createMicrosoftModule } from '@adport/provider-microsoft';\nimport { createRedditModule } from '@adport/provider-reddit';\nimport packageJson from '../package.json';\n\nexport const PROVIDER_IDS = ['google', 'meta', 'tiktok', 'apple', 'microsoft', 'reddit'] as const;\n\n/**\n * Standard runtime assembly: real providers whose credentials exist. Mock data\n * is opt-in so a live runtime never silently substitutes synthetic accounts.\n */\nexport interface AssembleRuntimeOptions {\n includeMock?: boolean;\n}\n\nexport async function assembleRuntime(options: AssembleRuntimeOptions = {}): Promise<AdportRuntime> {\n const store = new CredentialStore();\n const modules: ProviderModule[] = [];\n const includeMock = options.includeMock ?? process.env.ADPORT_DEMO === 'true';\n if (!includeMock) {\n for (const factory of [createGoogleModule, createMetaModule, createTikTokModule, createAppleModule, createMicrosoftModule, createRedditModule]) {\n const module = await factory(store);\n if (module) modules.push(module);\n }\n }\n return createContext({ providerModules: modules, includeMock });\n}\n\nexport interface CreateServerOptions {\n runtime: AdportRuntime;\n name?: string;\n version?: string;\n}\n\n/**\n * Thin adapter: every tool in the shared registry becomes an MCP tool.\n * No tool logic lives here — see the \"one tool-definition layer\" principle.\n */\nexport function createMcpServer({ runtime, name = 'adport', version = packageJson.version }: CreateServerOptions): McpServer {\n const server = new McpServer({ name, version });\n for (const tool of runtime.registry.list()) {\n server.registerTool(\n tool.name,\n {\n description: tool.description,\n inputSchema: tool.input.shape,\n annotations: {\n readOnlyHint: tool.annotations.readOnly ?? false,\n destructiveHint: tool.annotations.destructive ?? false,\n },\n },\n async (args: Record<string, unknown>) => {\n try {\n const result = await runtime.registry.call(tool.name, args, runtime.ctx);\n return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };\n } catch (err) {\n const payload =\n err instanceof AdportError\n ? err.toJSON()\n : { error: 'INTERNAL', message: err instanceof Error ? err.message : String(err) };\n return {\n content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }],\n isError: true,\n };\n }\n },\n );\n }\n return server;\n}\n\nexport async function runStdioServer(runtime: AdportRuntime, version?: string): Promise<void> {\n const server = createMcpServer({ runtime, version });\n await server.connect(new StdioServerTransport());\n // stdout is the protocol channel; stderr is for humans.\n console.error(`adport MCP server on stdio (${runtime.registry.list().length} tools, policy: ${runtime.policySource})`);\n if (runtime.ctx.providers.list().length === 0) {\n console.error('No ad providers connected. Run `adport connect <provider>` or restart with `--demo` for synthetic mock data.');\n }\n}\n","{\n \"name\": \"@adport/mcp\",\n \"version\": \"0.5.1\",\n \"description\": \"adport MCP server — the open control plane for paid media\",\n \"license\": \"Apache-2.0\",\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n }\n },\n \"bin\": {\n \"adport-mcp\": \"./dist/bin.js\"\n },\n \"files\": [\"dist\"],\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --sourcemap --clean\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@adport/core\": \"workspace:*\",\n \"@adport/provider-apple\": \"workspace:*\",\n \"@adport/provider-google\": \"workspace:*\",\n \"@adport/provider-meta\": \"workspace:*\",\n \"@adport/provider-microsoft\": \"workspace:*\",\n \"@adport/provider-reddit\": \"workspace:*\",\n \"@adport/provider-tiktok\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.12.0\",\n \"zod\": \"^4.4.3\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^26.1.2\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.8.0\",\n \"vitest\": \"^4.1.10\"\n }\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,aAAa,iBAAiB,qBAA8D;AACrG,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;;;ACRnC;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,SAAW;AAAA,IACT,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,EACF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,KAAK,MAAM;AAAA,QACxB,aAAa;AAAA,UACX,cAAc,KAAK,YAAY,YAAY;AAAA,UAC3C,iBAAiB,KAAK,YAAY,eAAe;AAAA,QACnD;AAAA,MACF;AAAA,MACA,OAAO,SAAkC;AACvC,YAAI;AACF,gBAAM,SAAS,MAAM,QAAQ,SAAS,KAAK,KAAK,MAAM,MAAM,QAAQ,GAAG;AACvE,iBAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,CAAC,EAAE;AAAA,QACvF,SAAS,KAAK;AACZ,gBAAM,UACJ,eAAe,cACX,IAAI,OAAO,IACX,EAAE,OAAO,YAAY,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE;AACrF,iBAAO;AAAA,YACL,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,KAAK,UAAU,SAAS,MAAM,CAAC,EAAE,CAAC;AAAA,YAC3E,SAAS;AAAA,UACX;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,eAAsB,eAAe,SAAwB,SAAiC;AAC5F,QAAM,SAAS,gBAAgB,EAAE,SAAS,QAAQ,CAAC;AACnD,QAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;AAE/C,UAAQ,MAAM,+BAA+B,QAAQ,SAAS,KAAK,EAAE,MAAM,mBAAmB,QAAQ,YAAY,GAAG;AACrH,MAAI,QAAQ,IAAI,UAAU,KAAK,EAAE,WAAW,GAAG;AAC7C,YAAQ,MAAM,8GAA8G;AAAA,EAC9H;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { AdportError, CredentialStore, createContext, type AdportRuntime, type ProviderModule } from '@adport/core';\nimport { createGoogleModule } from '@adport/provider-google';\nimport { createMetaModule } from '@adport/provider-meta';\nimport { createTikTokModule } from '@adport/provider-tiktok';\nimport { createAppleModule } from '@adport/provider-apple';\nimport { createMicrosoftModule } from '@adport/provider-microsoft';\nimport { createRedditModule } from '@adport/provider-reddit';\nimport packageJson from '../package.json';\n\nexport const PROVIDER_IDS = ['google', 'meta', 'tiktok', 'apple', 'microsoft', 'reddit'] as const;\n\n/**\n * Standard runtime assembly: real providers whose credentials exist. Mock data\n * is opt-in so a live runtime never silently substitutes synthetic accounts.\n */\nexport interface AssembleRuntimeOptions {\n includeMock?: boolean;\n}\n\nexport async function assembleRuntime(options: AssembleRuntimeOptions = {}): Promise<AdportRuntime> {\n const store = new CredentialStore();\n const modules: ProviderModule[] = [];\n const includeMock = options.includeMock ?? process.env.ADPORT_DEMO === 'true';\n if (!includeMock) {\n for (const factory of [createGoogleModule, createMetaModule, createTikTokModule, createAppleModule, createMicrosoftModule, createRedditModule]) {\n const module = await factory(store);\n if (module) modules.push(module);\n }\n }\n return createContext({ providerModules: modules, includeMock });\n}\n\nexport interface CreateServerOptions {\n runtime: AdportRuntime;\n name?: string;\n version?: string;\n}\n\n/**\n * Thin adapter: every tool in the shared registry becomes an MCP tool.\n * No tool logic lives here — see the \"one tool-definition layer\" principle.\n */\nexport function createMcpServer({ runtime, name = 'adport', version = packageJson.version }: CreateServerOptions): McpServer {\n const server = new McpServer({ name, version });\n for (const tool of runtime.registry.list()) {\n server.registerTool(\n tool.name,\n {\n description: tool.description,\n inputSchema: tool.input.shape,\n annotations: {\n readOnlyHint: tool.annotations.readOnly ?? false,\n destructiveHint: tool.annotations.destructive ?? false,\n },\n },\n async (args: Record<string, unknown>) => {\n try {\n const result = await runtime.registry.call(tool.name, args, runtime.ctx);\n return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };\n } catch (err) {\n const payload =\n err instanceof AdportError\n ? err.toJSON()\n : { error: 'INTERNAL', message: err instanceof Error ? err.message : String(err) };\n return {\n content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }],\n isError: true,\n };\n }\n },\n );\n }\n return server;\n}\n\nexport async function runStdioServer(runtime: AdportRuntime, version?: string): Promise<void> {\n const server = createMcpServer({ runtime, version });\n await server.connect(new StdioServerTransport());\n // stdout is the protocol channel; stderr is for humans.\n console.error(`adport MCP server on stdio (${runtime.registry.list().length} tools, policy: ${runtime.policySource})`);\n if (runtime.ctx.providers.list().length === 0) {\n console.error('No ad providers connected. Run `adport connect <provider>` or restart with `--demo` for synthetic mock data.');\n }\n}\n","{\n \"name\": \"@adport/mcp\",\n \"version\": \"0.5.2\",\n \"description\": \"adport MCP server — the open control plane for paid media\",\n \"license\": \"Apache-2.0\",\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n }\n },\n \"bin\": {\n \"adport-mcp\": \"./dist/bin.js\"\n },\n \"files\": [\"dist\"],\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --sourcemap --clean\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@adport/core\": \"workspace:*\",\n \"@adport/provider-apple\": \"workspace:*\",\n \"@adport/provider-google\": \"workspace:*\",\n \"@adport/provider-meta\": \"workspace:*\",\n \"@adport/provider-microsoft\": \"workspace:*\",\n \"@adport/provider-reddit\": \"workspace:*\",\n \"@adport/provider-tiktok\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.12.0\",\n \"zod\": \"^4.4.3\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^26.1.2\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.8.0\",\n \"vitest\": \"^4.1.10\"\n }\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,aAAa,iBAAiB,qBAA8D;AACrG,S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AACrH,MAAI,QAAQ,IAAI,UAAU,KAAK,EAAE,WAAW,GAAG;AAC7C,YAAQ,MAAM,8GAA8G;AAAA,EAC9H;AACF;","names":[]}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  assembleRuntime,
4
4
  createMcpServer,
5
5
  runStdioServer
6
- } from "./chunk-M4VFJ5GU.js";
6
+ } from "./chunk-6RBLUIBN.js";
7
7
  export {
8
8
  PROVIDER_IDS,
9
9
  assembleRuntime,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adport/mcp",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "adport MCP server — the open control plane for paid media",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@modelcontextprotocol/sdk": "^1.12.0",
23
23
  "zod": "^4.4.3",
24
- "@adport/provider-apple": "0.5.1",
25
- "@adport/core": "0.5.1",
26
- "@adport/provider-meta": "0.5.1",
27
- "@adport/provider-google": "0.5.1",
28
- "@adport/provider-microsoft": "0.5.1",
29
- "@adport/provider-tiktok": "0.5.1",
30
- "@adport/provider-reddit": "0.5.1"
24
+ "@adport/provider-google": "0.5.2",
25
+ "@adport/provider-microsoft": "0.5.2",
26
+ "@adport/provider-meta": "0.5.2",
27
+ "@adport/core": "0.5.2",
28
+ "@adport/provider-tiktok": "0.5.2",
29
+ "@adport/provider-reddit": "0.5.2",
30
+ "@adport/provider-apple": "0.5.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^26.1.2",