{
  "markdown": "# Newsletter Commerce Intelligence MCP\n\n[![npm](https://img.shields.io/npm/v/newsletter-commerce-mcp)](https://www.npmjs.com/package/newsletter-commerce-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Stars](https://img.shields.io/github/stars/teamsincetoday/newsletter-commerce-mcp?style=social)](https://github.com/teamsincetoday/newsletter-commerce-mcp)\n\n**Turn newsletters into affiliate revenue.** Extract sponsored products, brand mentions, and affiliate signals from any Substack, Ghost, or Beehiiv issue. Then auto-generate a shoppable \"Products in this edition\" section ready to paste into your newsletter. F1=100% on eval suite. Free tier: 200 calls/day.\n\n⭐ **If this saves you time, please star the repo** — it helps other developers find it.\n\n> **Live endpoint**: `https://newsletter-commerce-mcp.sincetoday.workers.dev/mcp` · [See examples](https://newsletter-commerce-mcp.sincetoday.workers.dev/examples)\n\nExtract product mentions, score sponsors, and track affiliate trends from newsletters. Supports Substack, Ghost, Beehiiv, and plain text. Built on x402, the open payment standard backed by Shopify, Google, Microsoft, Visa, and the Linux Foundation.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `extract_newsletter_products` | Extract products, affiliate links, and sponsor mentions from a newsletter issue |\n| `analyze_newsletter_sponsors` | Score sponsor sections by CPM, read-through rate, and audience fit |\n| `track_product_trends` | Compare product mentions across multiple newsletter issues to surface trending products and brand patterns |\n| `generate_newsletter_products_section` | Format extracted products into a 'Products in This Edition' footer section (markdown or HTML) |\n\n## Quick Start\n\n```bash\n# Install\nnpm install newsletter-commerce-mcp\n\n# Configure\ncp .env.example .env\n# Edit .env: set OPENAI_API_KEY\n\n# Run (stdio MCP server)\nnpx newsletter-commerce-mcp\n```\n\n## MCP Client Config\n\n```json\n{\n  \"mcpServers\": {\n    \"newsletter-commerce\": {\n      \"command\": \"npx\",\n      \"args\": [\"newsletter-commerce-mcp\"],\n      \"env\": {\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n## Tool Reference\n\n### `extract_newsletter_products`\n\n```json\n{\n  \"content\": \"Newsletter HTML or plain text (max 200k chars)\",\n  \"newsletter_id\": \"optional-cache-key\",\n  \"format\": \"html\",\n  \"api_key\": \"optional-paid-key\"\n}\n```\n\nReturns:\n```json\n{\n  \"newsletter_id\": \"swipe-file-issue-47\",\n  \"products\": [\n    {\n      \"name\": \"Notion AI\",\n      \"category\": \"saas\",\n      \"mention_context\": \"running my entire writing workflow through Notion AI\",\n      \"recommendation_strength\": \"strong\",\n      \"affiliate_link\": null,\n      \"confidence\": 0.94,\n      \"is_sponsored\": false\n    }\n  ],\n  \"sponsor_sections\": [...],\n  \"_meta\": { \"processing_time_ms\": 1620, \"ai_cost_usd\": 0.0028, \"cache_hit\": false }\n}\n```\n\n### `analyze_newsletter_sponsors`\n\n```json\n{\n  \"content\": \"Newsletter HTML or plain text\",\n  \"newsletter_id\": \"optional\",\n  \"api_key\": \"optional\"\n}\n```\n\nReturns CPM estimate, read-through rate, and sponsor-reader fit score per sponsor section.\n\n### `track_product_trends`\n\n```json\n{\n  \"newsletter_ids\": [\"issue-45\", \"issue-46\", \"issue-47\"],\n  \"category_filter\": [\"saas\", \"books\"]\n}\n```\n\nRequires prior `extract_newsletter_products` calls for each newsletter_id. Returns trend data including `top_category`, `avg_recommendation_strength`, and `brand` per product trend.\n\n### `generate_newsletter_products_section`\n\n```json\n{\n  \"newsletter_id\": \"swipe-file-issue-47\",\n  \"format\": \"markdown\",\n  \"style\": \"full\",\n  \"api_key\": \"optional\"\n}\n```\n\nFormats extracted products into a ready-to-paste 'Products in This Edition' section. Pass `newsletter_id` (uses cached extraction) or `products[]` directly. `format`: `markdown` (default) or `html`. `style`: `full` (default, grouped by endorsement strength with context quotes) or `minimal` (compact list).\n\n## Example Output\n\nReal extraction from a TLDR Tech newsletter (live eval: **F1=88%**, 95/100 score, $0.00051/call, 7390ms):\n\n```json\n{\n  \"newsletter_id\": \"tldr-2024-03-07\",\n  \"products\": [\n    {\n      \"name\": \"Groq\",\n      \"category\": \"saas\",\n      \"mention_context\": \"Groq has launched public API access — runs Llama 2 at 300 tokens/second\",\n      \"confidence\": 0.94,\n      \"recommendation_strength\": \"neutral\"\n    },\n    {\n      \"name\": \"Devin (Cognition AI)\",\n      \"category\": \"saas\",\n      \"mention_context\": \"first AI software engineer — benchmarks show it can complete real GitHub issues end-to-end\",\n      \"confidence\": 0.91,\n      \"recommendation_strength\": \"strong\"\n    }\n  ]\n}\n```\n\nSee `/examples` endpoint for full output with value narrative: `https://newsletter-commerce-mcp.sincetoday.workers.dev/examples`\n\n## Pricing\n\n- Free tier: 200 calls/day per agent (no API key required)\n- Paid: $0.01/call — set `MCP_API_KEYS` with valid keys\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `OPENAI_API_KEY` | Yes | — | OpenAI API key |\n| `AGENT_ID` | No | `anonymous` | Agent identifier for rate limiting |\n| `MCP_API_KEYS` | No | — | Comma-separated paid API keys |\n| `CACHE_DIR` | No | `./data/cache.db` | SQLite cache path |\n| `PAYMENT_ENABLED` | No | `false` | Set `true` to enforce limits |\n\n## Development\n\n```bash\nnpm install\nnpm run typecheck   # Zero type errors\nnpm test            # All tests pass\nnpm run build       # Compile to dist/\n```\n\n## License\n\nMIT — Since Today Studio\n",
  "bytes": 5503,
  "sha": "7a63f03379ba2cb87156dfa644786363da89bfa731786215e8ba699ce8a5958d",
  "repo_slug": "teamsincetoday/newsletter-commerce-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_teamsincetoday_newsletter_comm_73b46323/readme"
}