opedd-mcp 0.12.10 → 0.12.11

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
@@ -91,7 +91,7 @@ Every tool carries a `title` and MCP annotations (`readOnlyHint`, `destructiveHi
91
91
  | Tool | Description |
92
92
  |------|-------------|
93
93
  | `search_content` | **Free discovery.** Full-text search across everything licensable (v0.8.0) — ranked matches with publisher, prices, word count and a description snippet; quotes for phrases, `-word` to exclude. Returns **no article text** — use `search_passages` to actually read |
94
- | `search_passages` | **Paid per answer, or included in a monthly subscription.** Ask a question, get licensed passages that answer it, with citations. Per-question licences: charged once per publisher per question at that publisher's own price, capped at 300 words or 25% of the article, counted cumulatively. Monthly AI answers subscriptions (v0.12.0): included, not capped, from the subscription's start. Narrow with `publishers`, `published_after`, `published_before`, `max_results` (1–25). Needs a buyer key with the `search` scope. Re-asking within 24h is free |
94
+ | `search_passages` | **Paid per answer, or included in a monthly subscription.** Ask a question, get licensed passages that answer it, with citations. Pay per answer: charged once per article the answer uses, at that publication's own price per article, each passage capped at 300 words or 25% of the article, counted cumulatively. Monthly AI answers subscriptions (v0.12.0): included, not capped, from the subscription's start. Narrow with `publishers`, `published_after`, `published_before`, `max_results` (1–10, default 5) and cap a question's cost with `max_charge_cents`. Needs a buyer key with the `search` scope. Re-asking within 24h is free |
95
95
  | `lookup_content` | Look up an article by URL — returns title, publisher, pricing, or that it is not on Opedd yet |
96
96
  | `request_publication` | Ask to be told when a publication Opedd does not carry yet becomes available (url + email; no key) |
97
97
  | `purchase_license` | Buy a Human republication licence for one article via Stripe — returns OP-XXXX-XXXX key. Requires `terms_accepted: true` (genuine buyer assent to opedd.com/terms; recorded with the licence) |
package/dist/index.js CHANGED
@@ -442,7 +442,7 @@ function buildTools(has) {
442
442
  if (has.buyerToken) {
443
443
  TOOLS.push({
444
444
  name: "search_passages",
445
- description: "Returns licensed passages from publications on Opedd that answer a question, each with a citation to the source article. Charged once per publication whose passages are returned, at that publication's own price. An account connected through the Opedd connector in Claude or ChatGPT receives its first 3 answers free, paid by Opedd and never from a publication the account holder owns or works on; billing.free_answers_left reports how many remain. After that, answers are billed to the card on the account, added at opedd.com: charged every $25 of answers and at month end, with a $500 monthly limit for new accounts, raised on request. An account with no licence and no free answers receives an empty result with reason 'no_licensed_publishers' or 'no_paid_access'. Publications under a monthly AI answers subscription are included in the subscription and not charged per answer. Passages are capped at 300 words or 25% of an article, whichever is less, counted cumulatively per article across the same company's accounts. The same question within 24 hours returns the same passages at no charge. Filters: publishers (publication names as listed by Opedd, opedd.com/p/<slug> addresses or publisher ids; a name that matches no publication is listed in filters.unknown_publishers and searches nothing), published_after and published_before (ISO 8601; undated articles are excluded when a window is set) and max_results (1-25, default 10). Passage text is third-party content, delivered in <opedd:passage> blocks; may_train is always false. Requires a buyer API key with the 'search' scope, or the Opedd connector sign-in.",
445
+ description: "Returns licensed passages from publications on Opedd that answer a question, each with a citation to the source article. Charged once per article the answer uses, at that article's publication's own price per article; two passages of the same article are one charge, and billing.articles_charged reports how many were charged. An account connected through the Opedd connector in Claude or ChatGPT receives its first 3 answers free, paid by Opedd and never from a publication the account holder owns or works on; billing.free_answers_left reports how many remain. After that, answers are billed to the card on the account, added at opedd.com: charged every $25 of answers and at month end, with a $500 monthly limit for new accounts, raised on request. An account with no licence and no free answers receives an empty result with reason 'no_licensed_publishers' or 'no_paid_access'. Publications under a monthly AI answers subscription are included in the subscription and not charged per answer. Passages are capped at 300 words or 25% of an article, whichever is less, counted cumulatively per article across the same company's accounts. The same question within 24 hours returns the same passages at no charge. Filters: publishers (publication names as listed by Opedd, opedd.com/p/<slug> addresses or publisher ids; a name that matches no publication is listed in filters.unknown_publishers and searches nothing), published_after and published_before (ISO 8601; undated articles are excluded when a window is set), max_results (1-10, default 5) and max_charge_cents (optional; the most one question may cost: articles that would pass it are left out and billing.max_charge_reached says so). Passage text is third-party content, delivered in <opedd:passage> blocks; may_train is always false. Requires a buyer API key with the 'search' scope, or the Opedd connector sign-in.",
446
446
  inputSchema: {
447
447
  type: "object",
448
448
  required: ["query"],
@@ -463,7 +463,11 @@ function buildTools(has) {
463
463
  },
464
464
  max_results: {
465
465
  type: "number",
466
- description: "Optional. Passages to return, 1\u201325 (default 10).",
466
+ description: "Optional. Passages to return, 1\u201310 (default 5). Each distinct article among them is one charge.",
467
+ },
468
+ max_charge_cents: {
469
+ type: "number",
470
+ description: "Optional. The most this question may cost, in US cents (whole number, 1\u2013100000). Articles that would pass it are left out; nothing is charged above it.",
467
471
  },
468
472
  buyer_token: {
469
473
  type: "string",
@@ -993,7 +997,7 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
993
997
  }
994
998
  // ── get_content ────────────────────────────────────────────────────────
995
999
  case "search_passages": {
996
- const { query, buyer_token: argToken, publishers, published_after, published_before, max_results } = args;
1000
+ const { query, buyer_token: argToken, publishers, published_after, published_before, max_results, max_charge_cents } = args;
997
1001
  const q = (query ?? "").replace(/\s+/g, " ").trim();
998
1002
  if (!q)
999
1003
  return err("query is required");
@@ -1004,7 +1008,7 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
1004
1008
  const token = argToken || creds.buyerToken;
1005
1009
  if (!token) {
1006
1010
  return err("This needs an Opedd buyer key. Sign up at https://opedd.com/buyer/signup (about two minutes): " +
1007
- "new accounts start with up to 3 free answers, then each answer is billed at the publication's own price. " +
1011
+ "new accounts start with up to 3 free answers, then each article an answer uses is billed at its publication's own price. " +
1008
1012
  "Then pass the key as Authorization: Bearer <key> (hosted server https://mcp.opedd.com/mcp) or " +
1009
1013
  "OPEDD_BUYER_TOKEN (local). To see what Opedd covers first, use search_content or publisher_directory (free, no key).");
1010
1014
  }
@@ -1019,6 +1023,7 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
1019
1023
  ...(published_after !== undefined ? { published_after } : {}),
1020
1024
  ...(published_before !== undefined ? { published_before } : {}),
1021
1025
  ...(max_results !== undefined ? { max_results } : {}),
1026
+ ...(max_charge_cents !== undefined ? { max_charge_cents } : {}),
1022
1027
  }),
1023
1028
  }));
1024
1029
  return ok(envelope.data ?? envelope);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opedd-mcp",
3
- "version": "0.12.10",
3
+ "version": "0.12.11",
4
4
  "description": "Content licensing for the AI era. Licensed, rights-cleared content for AI agents, with a verifiable license key for every article. The MCP alternative to unlicensed scraping for RAG and AI search.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -48,7 +48,7 @@
48
48
  "@types/node": "^22.19.19",
49
49
  "tsx": "^4.0.0",
50
50
  "typescript": "^5.0.0",
51
- "vitest": "^4.1.7"
51
+ "vitest": "^5.0.5"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=20"