opedd-mcp 0.5.0 → 0.6.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
@@ -8,7 +8,7 @@ Lets AI assistants (Claude Desktop, Cursor, Windsurf, or any MCP-compatible host
8
8
 
9
9
  ## What it does
10
10
 
11
- Exposes up to 16 tools to any AI assistant (some are conditional on env vars):
11
+ Exposes up to 17 tools to any AI assistant (some are conditional on env vars):
12
12
 
13
13
  **Always available — discovery + per-article purchase + onboarding + rights signaling**
14
14
 
@@ -50,6 +50,7 @@ Exposes up to 16 tools to any AI assistant (some are conditional on env vars):
50
50
  | Tool | Description |
51
51
  |------|-------------|
52
52
  | `list_publisher_content` | List your own articles with pricing and stats |
53
+ | `push_content` | Push your articles to Opedd so AI buyers can license them — 1–100 per call (`title`/`url`/`html_body` required, everything else optional). Onboard your back-catalogue or new posts with no code, straight from your AI assistant. |
53
54
 
54
55
  ### Regulatory framing (CDSM Article 4 vs EU AI Act Article 53 — never conflated)
55
56
 
@@ -84,7 +85,7 @@ Set environment variables to pre-configure the server:
84
85
  | `OPEDD_BUYER_TOKEN` | Optional | Buyer API token (`opedd_buyer_live_*` canonical; `opedd_buyer_test_*` for sandbox) — enables `get_content` |
85
86
  | `OPEDD_ACCESS_KEY` | Optional | Enterprise access key (`ent_*`) — enables `list_feed` + `stream_feed_ndjson` |
86
87
  | `OPEDD_BUYER_JWT` | Optional | Supabase session JWT from the buyer portal — enables `get_audit_events` + `get_compliance_dossier` |
87
- | `OPEDD_PUB_BEARER` | Optional | Canonical Publisher API Bearer key (`opedd_pub_<env>_<32-hex>`; issued via `POST /publishers-api-keys action=create_api_key`) — enables `list_publisher_content`. **v0.4.0 canonical.** |
88
+ | `OPEDD_PUB_BEARER` | Optional | Canonical Publisher API Bearer key (`opedd_pub_<env>_<32-hex>`; issued via `POST /publishers-api-keys action=create_api_key`) — enables `list_publisher_content` + `push_content`. **v0.4.0 canonical.** |
88
89
  | `OPEDD_API_KEY` | Deprecated | Legacy Publisher API key (`op_...`) — fallback during the transition window; will stop working when opedd-backend Phase C deploys. Migrate to `OPEDD_PUB_BEARER`. |
89
90
  | `OPEDD_API_URL` | Optional | Override the API base URL (default: Opedd production) |
90
91
  | `OPEDD_MCP_TELEMETRY` | Optional | Set to `0` to disable anonymous usage telemetry (see below) |
package/dist/index.js CHANGED
@@ -565,9 +565,49 @@ if (PUB_BEARER || API_KEY) {
565
565
  },
566
566
  },
567
567
  });
568
+ // Supply-side push: onboard a back-catalogue or send new posts directly from
569
+ // the AI assistant — the native companion to the /publishers-content API.
570
+ TOOLS.push({
571
+ name: "push_content",
572
+ description: "Push your published articles to Opedd so they can be licensed to AI buyers (requires OPEDD_PUB_BEARER — your opedd_pub_ publisher key). " +
573
+ "Send 1–100 articles per call; batch larger back-catalogues into multiple calls. Each article needs title, url, and html_body — everything else is optional (published_at defaults to now). " +
574
+ "This is the supply-side companion to list_publisher_content: use it to onboard your archive or push new content with no code, straight from your AI assistant.",
575
+ inputSchema: {
576
+ type: "object",
577
+ required: ["articles"],
578
+ properties: {
579
+ articles: {
580
+ type: "array",
581
+ minItems: 1,
582
+ maxItems: 100,
583
+ description: "1–100 articles to push in this call.",
584
+ items: {
585
+ type: "object",
586
+ required: ["title", "url", "html_body"],
587
+ properties: {
588
+ title: { type: "string", description: "Article title (required, ≤500 chars)." },
589
+ url: { type: "string", description: "The article's canonical web address (required)." },
590
+ html_body: { type: "string", description: "Full article content, HTML or plain text (required, ≤200,000 chars)." },
591
+ published_at: { type: "string", description: "ISO-8601 datetime (e.g. 2026-01-15T09:30:00Z). Defaults to now if omitted." },
592
+ description: { type: "string", description: "Short summary (≤500 chars)." },
593
+ author: { type: "string", description: "Author name (≤200 chars)." },
594
+ language: { type: "string", description: "Language code, e.g. \"en\"." },
595
+ tags: { type: "array", items: { type: "string" }, description: "Up to 20 tags." },
596
+ image_urls: { type: "array", items: { type: "string" }, description: "Up to 10 body-image URLs." },
597
+ thumbnail_url: { type: "string", description: "https cover-image URL for the catalog." },
598
+ canonical_url: { type: "string", description: "Canonical URL if different from url." },
599
+ category: { type: "string", description: "Content category." },
600
+ is_paid: { type: "boolean", description: "Whether the article is behind a paywall." },
601
+ audience: { type: "string", enum: ["everyone", "only_free", "only_paid"], description: "Intended audience." },
602
+ },
603
+ },
604
+ },
605
+ },
606
+ },
607
+ });
568
608
  }
569
609
  // ─── MCP Server ───────────────────────────────────────────────────────────────
570
- const server = new Server({ name: "opedd-mcp", version: "0.3.0" }, { capabilities: { tools: {} } });
610
+ const server = new Server({ name: "opedd-mcp", version: "0.6.0" }, { capabilities: { tools: {} } });
571
611
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
572
612
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
573
613
  // Anonymous usage telemetry — captures only the tool name, duration, and
@@ -848,6 +888,26 @@ export async function dispatchTool(name, args) {
848
888
  const data = await opeddFetch(`/api?${params.toString()}`);
849
889
  return ok(data);
850
890
  }
891
+ // ── push_content ───────────────────────────────────────────────────────
892
+ case "push_content": {
893
+ if (!PUB_BEARER && !API_KEY) {
894
+ return err("OPEDD_PUB_BEARER env var is required for this tool (your opedd_pub_ publisher key).");
895
+ }
896
+ const { articles } = args;
897
+ if (!Array.isArray(articles) || articles.length === 0) {
898
+ return err("`articles` must be a non-empty array (1–100 items).");
899
+ }
900
+ if (articles.length > 100) {
901
+ return err(`Too many articles in one call (${articles.length}). Send at most 100 per call and batch the rest.`);
902
+ }
903
+ // Backend /publishers-content enforces the full strict schema + returns
904
+ // clear per-article errors; we pass through so the assistant can relay them.
905
+ const data = await opeddFetch("/publishers-content", {
906
+ method: "POST",
907
+ body: JSON.stringify({ articles }),
908
+ });
909
+ return ok(data);
910
+ }
851
911
  default:
852
912
  return err(`Unknown tool: ${name}`);
853
913
  }
package/dist/telemetry.js CHANGED
@@ -16,9 +16,9 @@ import { PostHog } from "posthog-node";
16
16
  import { randomUUID } from "node:crypto";
17
17
  // Public, write-only PostHog project key (EU cloud, project 218295). Safe to
18
18
  // embed — it can only send events, not read data.
19
- const POSTHOG_KEY = "phc_zrKQzZLUZikynMWJWMHUiQBgRsJa2fLzDFMdh6HxGU6c";
19
+ const POSTHOG_KEY = "phc_yfyXBNsf5nZncZBiZNQBBs5RWC3mtWNWpUJv5EfzfBir";
20
20
  const POSTHOG_HOST = "https://eu.i.posthog.com";
21
- const SERVER_VERSION = "0.5.0";
21
+ const SERVER_VERSION = "0.5.1";
22
22
  /** Whether telemetry is allowed (respects OPEDD_MCP_TELEMETRY + DO_NOT_TRACK). Pure — exported for tests. */
23
23
  export function isTelemetryEnabled() {
24
24
  const t = process.env.OPEDD_MCP_TELEMETRY?.toLowerCase();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opedd-mcp",
3
- "version": "0.5.0",
4
- "description": "MCP server for Opedd discover, purchase, verify, and audit content licenses from AI assistants. Covers Phase 11 buyer-side surfaces + Phase 12 Wave 1 + 3 regulatory surfaces (CDSM Article 4(3) RSL + EU AI Act Article 53 attestation + platform onboarding helper).",
3
+ "version": "0.6.0",
4
+ "description": "MCP server for Opedd \u2014 discover, purchase, verify, and audit content licenses from AI assistants. Covers Phase 11 buyer-side surfaces + Phase 12 Wave 1 + 3 regulatory surfaces (CDSM Article 4(3) RSL + EU AI Act Article 53 attestation + platform onboarding helper).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -41,4 +41,4 @@
41
41
  "files": [
42
42
  "dist"
43
43
  ]
44
- }
44
+ }