opedd-mcp 0.1.2 → 0.3.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.
@@ -0,0 +1,70 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ # Node 18 dropped 2026-05-24 — vitest 4.x (rolldown dep) requires
16
+ # `node:util.styleText` which is only available on Node 21.7+.
17
+ # Node 18 reaches active LTS end April 2025; engines.node in
18
+ # package.json bumped to ">=20" in the same commit. Re-add Node 18
19
+ # only if vitest downgrade ratified (which is the alternative;
20
+ # founder picked engines bump).
21
+ node-version: ["20", "22"]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - name: Set up Node.js ${{ matrix.node-version }}
26
+ uses: actions/setup-node@v4
27
+ with:
28
+ node-version: ${{ matrix.node-version }}
29
+ cache: npm
30
+
31
+ - name: Install dependencies
32
+ # Using `npm install` rather than `npm ci` because the lockfile
33
+ # generated on macOS doesn't include Linux-conditional optional
34
+ # native deps (e.g. @emnapi/* used by vitest 4.x via napi-rs).
35
+ # `npm install` resolves transitively at install time per-platform;
36
+ # `npm ci` strictly validates lockfile-against-package.json and
37
+ # rejects when platform-specific transitive deps are missing.
38
+ # Trade-off: install is slower + slightly looser; acceptable for
39
+ # this repo's CI scale.
40
+ run: npm install
41
+
42
+ - name: TypeScript compile
43
+ run: npm run build
44
+
45
+ - name: Unit tests (vitest)
46
+ run: npm test
47
+
48
+ - name: Verify dist/index.js produced
49
+ run: |
50
+ test -f dist/index.js || (echo "::error::dist/index.js not produced by tsc"; exit 1)
51
+ echo "dist/index.js bytes: $(wc -c < dist/index.js)"
52
+
53
+ - name: Smoke-boot the MCP server
54
+ run: |
55
+ # Send initialize + tools/list, confirm v0.2.0 boots and lists tools
56
+ printf '%s\n%s\n' \
57
+ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"ci","version":"1"}}}' \
58
+ '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
59
+ | timeout 10 node dist/index.js > /tmp/mcp-output.txt 2> /tmp/mcp-stderr.txt || true
60
+ if ! grep -q '"serverInfo":{"name":"opedd-mcp"' /tmp/mcp-output.txt; then
61
+ echo "::error::MCP server did not respond with expected serverInfo"
62
+ cat /tmp/mcp-output.txt
63
+ cat /tmp/mcp-stderr.txt
64
+ exit 1
65
+ fi
66
+ if ! grep -q '"name":"lookup_content"' /tmp/mcp-output.txt; then
67
+ echo "::error::MCP server did not list lookup_content tool"
68
+ exit 1
69
+ fi
70
+ echo "MCP smoke boot OK"
package/README.md CHANGED
@@ -1,18 +1,65 @@
1
1
  # opedd-mcp
2
2
 
3
- An [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server for the [Opedd](https://opedd.com) licensing protocol. Lets AI assistants (Claude Desktop, Cursor, Windsurf, or any MCP-compatible host) discover, purchase, and verify content licenses autonomously — mid-conversation, without opening a browser.
3
+ Licensed content retrieval for AI agents via [MCP (Model Context Protocol)](https://modelcontextprotocol.io). The alternative to unlicensed web scraping for RAG pipelines, AI search, and LLM grounding.
4
+
5
+ Lets AI assistants (Claude Desktop, Cursor, Windsurf, or any MCP-compatible host) discover, purchase, and verify content licenses autonomously — mid-conversation, without opening a browser. Every license is registered on-chain (Tempo blockchain) with cryptographic proof.
6
+
7
+ **Unlike generic search APIs**, Opedd returns content with a verifiable license key — defensible under the EU AI Act and any copyright jurisdiction.
4
8
 
5
9
  ## What it does
6
10
 
7
- Exposes 4–5 tools to any AI assistant:
11
+ Exposes up to 16 tools to any AI assistant (some are conditional on env vars):
12
+
13
+ **Always available — discovery + per-article purchase + onboarding + rights signaling**
8
14
 
9
15
  | Tool | Description |
10
16
  |------|-------------|
11
17
  | `lookup_content` | Look up an article by URL — returns title, publisher, pricing |
12
- | `purchase_license` | Buy a license with a Stripe payment method — returns license key |
18
+ | `purchase_license` | Buy a single-article license via Stripe — returns OP-XXXX-XXXX key |
13
19
  | `verify_license` | Verify a license key — returns validity, article, publisher, blockchain proof |
14
- | `browse_registry` | Browse the public Opedd registry (global or by publisher) |
15
- | `list_publisher_content` | *(requires API key)* List your own articles with pricing and stats |
20
+ | `browse_registry` | Browse the public Opedd registry — lists issued LICENSES (use `publisher_directory` to browse publishers themselves) |
21
+ | `publisher_directory` | Browse the public Opedd publisher catalog paginated publishers with article counts + pricing + sample articles (primary buyer-discovery surface for AI labs) |
22
+ | `purchase_enterprise_license` | Buy a bulk enterprise license covering multiple publishers (Phase 10) — returns Stripe `client_secret` |
23
+ | `rsl_get` | Fetch a publisher's RSL Standard manifest — public discovery surface; `jsonld: true` returns CDSM Article 4(3) signed receipt (Phase 12 W1.1) |
24
+ | `detect_platform` | Detect the content platform behind a URL — returns suggested onboarding workflow for Substack / Beehiiv / Ghost / Medium / Brevo / custom (Phase 12 W3.1) |
25
+
26
+ **Requires `OPEDD_BUYER_TOKEN` (opedd_buyer_live_*)**
27
+
28
+ | Tool | Description |
29
+ |------|-------------|
30
+ | `get_content` | Retrieve a licensed article — includes 7 Phase 11 M2 RAG metadata fields (author, language, word_count, content_hash, image_urls, canonical_url, tags) |
31
+
32
+ **Requires `OPEDD_ACCESS_KEY` (ent_*) — buyer-side feed surfaces**
33
+
34
+ | Tool | Description |
35
+ |------|-------------|
36
+ | `list_feed` | List articles from a buyer's licensed catalog with `since` delta-feed support (Phase 11 M5) |
37
+ | `stream_feed_ndjson` | Bulk-export up to 1000 articles per call via NDJSON wire format (Phase 11 M3) |
38
+
39
+ **Requires `OPEDD_BUYER_JWT` (Supabase JWT) — buyer account + audit + compliance + EU AI Act surfaces**
40
+
41
+ | Tool | Description |
42
+ |------|-------------|
43
+ | `get_buyer_account` | Fetch buyer profile + masked API key list — buyer-dashboard mental model |
44
+ | `get_audit_events` | Per-event audit ledger with Tempo on-chain attestation inclusion proofs inline (Phase 9.x + 10 M5) |
45
+ | `get_compliance_dossier` | Procurement-defense compliance dossier mapping retrievals to license terms (Phase 11 M4) |
46
+ | `article_53_attestation` | Signed JWT attesting EU AI Act Article 53(1)(d) compliance for a license — the artifact AI labs hand to legal/procurement (Phase 12 W1.4) |
47
+
48
+ **Requires `OPEDD_API_KEY` (op_*) — publisher-side**
49
+
50
+ | Tool | Description |
51
+ |------|-------------|
52
+ | `list_publisher_content` | List your own articles with pricing and stats |
53
+
54
+ ### Regulatory framing (CDSM Article 4 vs EU AI Act Article 53 — never conflated)
55
+
56
+ Per the [opedd-backend INVARIANTS.md W1.6 amendment](https://github.com/Opedd/opedd-backend/blob/main/INVARIANTS.md):
57
+
58
+ - **`rsl_get(publisher_id, jsonld=true)`** → publisher-side **CDSM Article 4(3)** opt-out declaration (signed JSON-LD receipt over the reservation state).
59
+ - **`article_53_attestation(license_id)`** → buyer-side **EU AI Act Article 53** attestation (signed HS256 JWT scoped to one license).
60
+ - **`get_compliance_dossier(from, to)`** → comprehensive procurement-defense dossier covering BOTH frameworks (publisher CDSM reservation honored + buyer Article 53 evidence chain).
61
+
62
+ These serve different audit-defensibility modes and never share wire format. Tool descriptions cite the W1.6 invariant inline.
16
63
 
17
64
  ## Install
18
65
 
@@ -33,7 +80,10 @@ Set environment variables to pre-configure the server:
33
80
  | Variable | Required | Description |
34
81
  |----------|----------|-------------|
35
82
  | `OPEDD_BUYER_EMAIL` | Recommended | Your email — used as default for all purchases |
36
- | `OPEDD_PAYMENT_METHOD_ID` | Recommended | Stripe `pm_...` ID — used for autonomous purchasing |
83
+ | `OPEDD_PAYMENT_METHOD_ID` | Recommended | Stripe `pm_...` ID — used for autonomous per-article purchasing |
84
+ | `OPEDD_BUYER_TOKEN` | Optional | Buyer API token (`opedd_buyer_live_*` canonical; `opedd_buyer_test_*` for sandbox) — enables `get_content` |
85
+ | `OPEDD_ACCESS_KEY` | Optional | Enterprise access key (`ent_*`) — enables `list_feed` + `stream_feed_ndjson` |
86
+ | `OPEDD_BUYER_JWT` | Optional | Supabase session JWT from the buyer portal — enables `get_audit_events` + `get_compliance_dossier` |
37
87
  | `OPEDD_API_KEY` | Optional | Publisher API key (`op_...`) — enables `list_publisher_content` |
38
88
  | `OPEDD_API_URL` | Optional | Override the API base URL (default: Opedd production) |
39
89
 
@@ -86,6 +136,20 @@ Once configured, you can ask your AI assistant:
86
136
 
87
137
  > "Browse the latest licenses from The Information publisher."
88
138
 
139
+ ### Phase 12 Wave 1 + 3 surfaces (v0.3.0)
140
+
141
+ > "What does publisher 8268c353-ffa3-4db3-bbb2-90ddbbb43e41 license? Pull the RSL manifest." — uses `rsl_get`
142
+
143
+ > "Get me a CDSM Article 4(3) signed receipt for that publisher's reservation state — set `jsonld: true`." — uses `rsl_get` with content negotiation
144
+
145
+ > "Generate an EU AI Act Article 53 attestation JWT for our license `11111111-...` covering the last 90 days. I need the artifact for our procurement audit committee." — uses `article_53_attestation` (requires `OPEDD_BUYER_JWT`)
146
+
147
+ > "This publisher just signed up: `https://noahpinion.substack.com`. Which onboarding workflow should we use?" — uses `detect_platform`
148
+
149
+ > "Browse the finance category in the Opedd catalog — show me publishers with at least 50 articles." — uses `publisher_directory`
150
+
151
+ > "What's in my buyer account? Show me my active API keys." — uses `get_buyer_account` (requires `OPEDD_BUYER_JWT`)
152
+
89
153
  The assistant will call the appropriate Opedd tools, show you the results, and—if you've pre-configured a payment method—can complete a purchase autonomously.
90
154
 
91
155
  ## Payment methods
@@ -102,6 +166,28 @@ npm run dev # runs with tsx (no build step)
102
166
  npm run build # compiles to dist/
103
167
  ```
104
168
 
169
+ ## How Opedd compares to search APIs
170
+
171
+ | | Opedd | Generic search APIs |
172
+ |---|---|---|
173
+ | **What you get** | Licensed content + license key + on-chain proof — all in one API call | Scraped web content, no rights |
174
+ | **Content delivery** | Full article text delivered via API (JSON), real-time feed via webhooks | Scraped snippets or full-page dumps |
175
+ | **Content quality** | Curated publisher content (niche B2B newsletters, expert analysis) | Whatever's on the open web |
176
+ | **Rights** | Verifiable license key per article, publisher-authorized | No rights clearance |
177
+ | **Proof** | On-chain (Tempo blockchain) — independently verifiable | None |
178
+ | **EU AI Act** | Compliant — full training data provenance chain | No provenance |
179
+ | **Pricing** | Publisher sets their own price per article | Platform decides |
180
+ | **Delivery modes** | Per-article API, bulk feed (JSON firehose), buyer webhooks (push) | Query-response only |
181
+ | **Protocol** | REST + MCP native | REST only |
182
+
183
+ Opedd is the **licensed content delivery layer** for AI — not just a licensing wrapper. Publishers upload content, you retrieve it via API with a license attached. One integration gives your pipeline both the content and the legal right to use it.
184
+
185
+ ## Learn more
186
+
187
+ - [Opedd for AI Agents](https://opedd.com/for-ai-agents) — full documentation, code examples, endpoint reference
188
+ - [API Docs](https://docs.opedd.com) — OpenAPI spec with agent endpoints
189
+ - [Opedd Registry](https://opedd.com/registry) — browse on-chain license proofs
190
+
105
191
  ## License
106
192
 
107
193
  MIT