opedd-mcp 0.7.0 → 0.8.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
@@ -88,6 +88,7 @@ Exposes up to 17 tools to any AI assistant (some are conditional on env vars):
88
88
 
89
89
  | Tool | Description |
90
90
  |------|-------------|
91
+ | `search_content` | 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 |
91
92
  | `lookup_content` | Look up an article by URL — returns title, publisher, pricing |
92
93
  | `purchase_license` | Buy a single-article license via Stripe — returns OP-XXXX-XXXX key. Requires `terms_accepted: true` (genuine buyer assent to opedd.com/terms; recorded with the licence) |
93
94
  | `verify_license` | Verify a license key — returns validity, article, publisher, blockchain proof |
package/dist/index.js CHANGED
@@ -170,6 +170,22 @@ function buildTools(has) {
170
170
  },
171
171
  },
172
172
  },
173
+ {
174
+ name: "search_content",
175
+ description: "Full-text search across everything licensable on Opedd (public, no key needed). " +
176
+ "Ask in plain words or use quotes for phrases and -word to exclude. Returns ranked matches with the publisher, " +
177
+ "prices, word count and a short description snippet (never the body). Use it to answer 'does Opedd have coverage on X', " +
178
+ "then lookup_content or get_content for a specific article.",
179
+ inputSchema: {
180
+ type: "object",
181
+ required: ["query"],
182
+ properties: {
183
+ query: { type: "string", description: "Search words (max 200 characters)." },
184
+ limit: { type: "number", description: "Max results (default 20, max 50)." },
185
+ publisher: { type: "string", description: "Optional publisher slug to search within." },
186
+ },
187
+ },
188
+ },
173
189
  {
174
190
  name: "purchase_license",
175
191
  description: "Purchase a content license from the Opedd protocol using a Stripe payment method. " +
@@ -768,6 +784,22 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
768
784
  const data = await opeddFetch(creds, `/lookup-article?url=${encodeURIComponent(url)}`);
769
785
  return ok(data);
770
786
  }
787
+ // ── search_content ─────────────────────────────────────────────────────
788
+ case "search_content": {
789
+ const { query, limit, publisher } = args;
790
+ const q = (query ?? "").replace(/\s+/g, " ").trim();
791
+ if (!q)
792
+ return err("query is required");
793
+ if (q.length > 200)
794
+ return err("query must be at most 200 characters");
795
+ const params = new URLSearchParams({ action: "search", q });
796
+ if (typeof limit === "number" && Number.isFinite(limit))
797
+ params.set("limit", String(Math.min(Math.max(Math.trunc(limit), 1), 50)));
798
+ if (typeof publisher === "string" && publisher.trim())
799
+ params.set("publisher", publisher.trim());
800
+ const envelope = (await opeddFetch(creds, `/api?${params.toString()}`));
801
+ return ok(envelope.data ?? envelope);
802
+ }
771
803
  // ── purchase_license ───────────────────────────────────────────────────
772
804
  case "purchase_license": {
773
805
  const { article_url, article_id, license_type, buyer_email: argEmail, buyer_name, buyer_organization, intended_use, payment_method_id: argPm, } = args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opedd-mcp",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Licensed, rights-cleared content for AI agents \u2014 verifiable license keys, on-chain proof, and EU AI Act attestation. The MCP alternative to unlicensed scraping for RAG and AI search.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",