{
  "markdown": "# Recapfy MCP\n\nAn [MCP](https://modelcontextprotocol.io) server that exposes Recapfy's paid\nendpoints as tools — ask anything about a YouTube video and fetch a video's full\ntranscript — straight from an MCP-capable agent like Claude\nDesktop, Cursor, or Cline.\nIt runs locally — there's no hosted Recapfy MCP endpoint; you launch your own copy.\n\nEach call is paid in **USDC on Solana** (dynamic price, scales with\n`maxOutputTokens`), settled automatically via the [x402](https://x402.org)\nprotocol. You bring your own wallet; you pay only for what you call.\n\n📦 npm: [`recapfy-mcp`](https://www.npmjs.com/package/recapfy-mcp)\n\n## Prerequisites\n\n- **Node.js ≥ 20.**\n- A **Solana wallet funded with USDC on mainnet.** You do *not* need SOL for fees\n  — the API's facilitator sponsors the network fee.\n- That wallet's **secret key, base58-encoded** (the 64-byte form that Phantom's\n  \"Export Private Key\" gives you, or `solana-keygen`).\n\n> ⚠️ The key signs real payments. Use a dedicated low-balance wallet, never share\n> it, and never commit it.\n\n## Install\n\nNo clone or build needed. Add this to your MCP client config (Claude Desktop:\n`claude_desktop_config.json`) and restart the client:\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"recapfy\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"recapfy-mcp@latest\"],\n      \"env\": {\n        \"SVM_PRIVATE_KEY\": \"<your base58 Solana secret key>\"\n      }\n    }\n  }\n}\n```\n\n> **Always use `recapfy-mcp@latest`.** A bare `npx -y recapfy-mcp` reuses\n> whatever is in npx's cache and never re-checks the registry, so you can stay\n> pinned to an old build (and miss new tools) indefinitely. The `@latest` tag\n> forces npx to resolve the newest published version on every launch.\n\n## Updating\n\nNew versions (including new tools/endpoints) are picked up automatically **when\ntwo things happen**, because of two independent caches:\n\n1. **npx package cache** — using `recapfy-mcp@latest` (as above) makes npx fetch\n   the newest published version each launch. Without `@latest`, npx serves the\n   cached copy and you stay on an old build.\n2. **MCP client tool list** — clients read the server's tool list **once per\n   session**. New tools only appear after you **fully restart the MCP client**\n   (Claude Desktop, Cursor, Cline, …) so it relaunches the server and re-reads\n   the tools.\n\nSo after a release: keep `@latest` and **restart your client**. If a brand-new\ntool still doesn't show up, force a clean fetch:\n\n```bash\nnpx clear-npx-cache    # or: rm -rf \"$(npm config get cache)/_npx\"\n```\n\nthen restart the client again.\n\n## Configuration\n\n| Variable                     | Required | Description                                                                          |\n| ---------------------------- | -------- | ----------------------------------------------------------------------------------- |\n| `SVM_PRIVATE_KEY`            | yes      | Base58-encoded Solana secret key. Pays per call. Keep it funded.                    |\n| `RECAPFY_API_BASE_URL`       | no       | Override the API base URL (defaults to `https://api.recapfy.ai`). For local dev.    |\n| `RECAPFY_ALLOW_INSECURE_TLS` | no       | Set to `1` to accept self-signed TLS (local dev over https only).                   |\n\n## Tool: `ask`\n\n| Input             | Type    | Required | Description                                                                 |\n| ----------------- | ------- | -------- | --------------------------------------------------------------------------- |\n| `videoUrl`        | string  | yes      | Absolute http(s) URL of the YouTube video.                                  |\n| `prompt`          | string  | yes      | What to ask about the video.                                                |\n| `maxOutputTokens` | integer | no       | Max tokens in the answer (default 1024). **Drives the dynamic price.**       |\n\nReturns the agent's answer as text. Payment is settled before the answer returns.\nThe per-call price is **dynamic**: the API quotes the USDC amount in the `402`\nchallenge based on `maxOutputTokens`, and your wallet pays whatever is quoted — so\nkeep `maxOutputTokens` sensible.\n\n## Tool: `get_transcript`\n\n| Input      | Type   | Required | Description                                |\n| ---------- | ------ | -------- | ------------------------------------------ |\n| `videoUrl` | string | yes      | Absolute http(s) URL of the YouTube video. |\n\nReturns the video's full transcript as timestamped segments, plus its `title`,\n`channelName`, and `durationSeconds`. The text content is a readable, timestamped\ntranscript; the structured content carries the raw `transcript` array (each\nsegment is `{ timestampInSeconds, text }`). The per-call price is **flat** USDC,\nquoted in the `402` challenge and paid automatically.\n\n## How payment works\n\nBuilt on the official Coinbase x402 **v2** client packages (`@x402/fetch`,\n`@x402/svm`, `@x402/core`) plus `@solana/kit` for signing:\n\n1. The tool POSTs to the matching endpoint under `${RECAPFY_API_BASE_URL}`\n   (`/api/v1/agents/ask` or `/api/v1/agents/get-transcript`).\n2. The API replies `402` with requirements in the `PAYMENT-REQUIRED` header\n   (`exact` SVM scheme, USDC, dynamic amount, and a facilitator `feePayer` that\n   sponsors the network fee).\n3. The wrapped fetch signs a gasless SPL-token transfer with your wallet and\n   retries with the `PAYMENT-SIGNATURE` header.\n4. The API verifies, settles, and returns the answer plus a `PAYMENT-RESPONSE`\n   settlement header.\n\n## Verify it works\n\nInspect the tools without spending anything using the MCP Inspector (it only signs\na payment when you actually invoke a tool, so any key is fine just to browse):\n\n```bash\nSVM_PRIVATE_KEY=<key> npx @modelcontextprotocol/inspector npx -y recapfy-mcp@latest\n```\n\nOpen the printed URL → **Tools → ask / get_transcript**. Invoking a tool with a\nfunded wallet performs a real paid call; verify the spend on a Solana explorer.\n\n## Troubleshooting\n\n| Symptom                                          | Cause / fix                                                          |\n| ------------------------------------------------ | ------------------------------------------------------------------- |\n| `Missing required environment variable ...`      | `SVM_PRIVATE_KEY` not set.                                          |\n| `SVM_PRIVATE_KEY is not valid base58`            | Needs base58 of the 64-byte secret key.                             |\n| `400 ... maxOutputTokens must be greater than 0` | Pass a positive `maxOutputTokens` (the tool defaults to 1024).      |\n| `400 ... prompt`                                 | `prompt` is required and non-empty.                                 |\n| New tool/endpoint missing after an update        | Pin `recapfy-mcp@latest`, **restart the client**, then clear the npx cache (see [Updating](#updating)). |\n| 402 loop / \"Failed to create payment payload\"    | Wallet has no USDC on mainnet, or wrong network. Fund it.           |\n| TLS error against a local API over https         | Set `RECAPFY_ALLOW_INSECURE_TLS=1` (localhost dev only).            |\n\n## License\n\nMIT\n",
  "bytes": 7093,
  "sha": "74d915744a65eb24556ca02a1367da281ca820a6546b7d1b54ffa3fe3ffcac43",
  "repo_slug": "pedrot95dev/recapfy.mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_pedrot95dev_recapfy_6358c330/readme"
}