Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(mcp): free crypto-news tool trio — live feed, clustered digest, 660k archive
fudjia2d4847ba43c3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6fcb4deef..6591a94f7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,7 +13,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Docs · What Agents Can Do — The Complete Dossier** (`/docs/agent-abilities`) — The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.- **Markets Hub** (`/markets`) — The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 192 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.- **A leftover test file stops loading on every visit** — A one-off test page and the 1.5 MB script it loaded were committed by mistake and had been sitting in the public folder ever since — downloadable by anyone and adding dead weight to the site for no reason. Both are gone, and the project now refuses to accept that kind of leftover again. `[fix, infra]`-- **Agents can now read the news: three free MCP tools for headlines, digests, and the 660k archive** — The three.ws MCP server grew a crypto-news trio, all free — no payment, wallet, or API key. crypto_news streams live headlines from 192 publisher feeds with category, source, language, and search filters. crypto_news_digest hands an agent the last day (or up to three) clustered into distinct stories with stance, tickers, and every covering outlet — the right first call for "what happened in crypto today". crypto_news_archive searches 660,000+ articles back to September 2017 by keyword, ticker, date, sentiment, or language, with corpus stats and trending modes. Any MCP client — Claude Desktop, Cursor, or another agent — can now cite a decade of crypto coverage. (`/mcp`) `[feature, sdk]`+- **Agents can now read the news: three free MCP tools for headlines, digests, and the 660k archive** — The three.ws MCP server grew a crypto-news trio, all free — no payment, wallet, or API key. crypto_news streams live headlines from 192 publisher feeds with category, source, language, and search filters. crypto_news_digest hands an agent the last day (or up to three) clustered into distinct stories with stance, tickers, and every covering outlet — the right first call for "what happened in crypto today". crypto_news_archive searches 660,000+ articles back to September 2017 by keyword, ticker, date, sentiment, or language, with corpus stats and trending modes. Any MCP client — Claude Desktop, Cursor, or another agent — can now cite a decade of crypto coverage. (`/docs/mcp`) `[feature, sdk]`- **Agents registered on-chain can no longer put a slur on three.ws** — The agent directory lists every agent registered on the public blockchains we index — over 126,000 of them — and it took each one's name, description and picture straight from whatever its owner published on-chain. Whether an agent appeared on our pages was decided by a flag the agent itself set, and nothing ever checked what the name said. One agent's name was a racial slur, and it was being displayed on the marketplace. Names carrying a hate slur are now withheld from every listing, search result and feed, and the agent that was showing has been taken down. The check is deliberately narrow: it looks for slurs, not swearing, and it is careful never to hide a legitimate agent whose name merely contains an ordinary word or a wallet address. (`/marketplace`) `[security, fix]`- **Auto-rigging works again — and the Agent Identity Studio demos are real** — Rigging any generated model into an animation-ready character had been failing since the cloud migration: the rig request was sent to a service that doesn't do rigging, and the GPU rigger itself crashed on a graphics call our cloud GPUs don't support. Both are fixed — rig requests now reach the real UniRig worker, which renders its voxel pass in software instead. Proof: all four Agent Identity Studio demo characters (LedgerLynx, MuseWeaver, Momentum-9, and the three.ws studio's own) were generated, rigged with full skeletons, and photographed in posed renders through the live pipeline — see them on the showcase. (`/agent-identities`) `[fix, feature]`- **Broken links across the site now go where they should** — Nine links pointed at pages that don't exist and quietly landed people on a Not Found screen. The Activity page's "Leaderboard" and "Proven wins" links now open the right section of the Oracle, the dashboard's "Upload .glb" and "Create an agent" buttons reach the real create flow, a token's "3D Agent view" opens the live 3D coin scene, and the Restyle page's MCP tool reference opens the MCP docs. (`/activity`) `[fix]`diff --git a/data/changelog.json b/data/changelog.jsonindex 799bcefd7..99d8b6e6b 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -13023,7 +13023,7 @@"feature","sdk"],- "link": "/mcp"+ "link": "/docs/mcp"},{"date": "2026-07-10",diff --git a/mcp-server/README.md b/mcp-server/README.mdindex f9c8500a8..92c0dcd4e 100644--- a/mcp-server/README.md+++ b/mcp-server/README.md@@ -85,6 +85,9 @@ Most tools quote a fixed USDC price and settle `exact` on Solana mainnet (prices| `vanity_grinder` | $0.05 | Solana keypair whose base58 address starts with `prefix` (and optionally ends with `suffix`). Returns the full base58 secret key — treat as a secret. Flat price (override with `MCP_VANITY_PRICE_USD`); a difficulty guard rejects prefixes too long to mine within the iteration cap. || `aixbt_intel` | $0.01 | aixbt narrative intelligence feed — recent intel items across crypto with category, description, observation count, official-source flag, and the project/ticker concerned. Optional category/chain filter. Live aixbt REST API. || `aixbt_projects` | $0.01 | aixbt momentum scan — projects ranked by spiking/climbing/active scores, with ticker, chain, market metrics (price, mcap, 24h volume + change), and recent intel. Filter by names or chain. Live aixbt REST API. |+| `crypto_news` | FREE | Live crypto headlines aggregated natively by three.ws from 192 publisher RSS/Atom feeds in 17 languages — filter by category, source, or language, or full-text search. Each article carries the publisher link, publish time, detected tickers, and lexicon sentiment. No payment, no key. |+| `crypto_news_digest` | FREE | The last 1–72h of coverage clustered into distinct narratives — title, plain-language summary, bullish/bearish stance, tickers, coverage count, and every real article behind each story. Names its engine honestly (`llm` semantic grouping or `heuristic` Jaccard clustering). No payment, no key. |+| `crypto_news_archive` | FREE | Search 660,000+ archived articles back to September 2017 (refreshed hourly) by keyword, ticker, source, date range, sentiment, or language — with market context at publication where captured. `mode: stats` and `mode: trending` for corpus statistics and most-covered tickers. No payment, no key. |### Agents & identitydiff --git a/mcp-server/src/index.js b/mcp-server/src/index.jsindex fcd0fa7f1..bf16a1473 100755--- a/mcp-server/src/index.js+++ b/mcp-server/src/index.js@@ -49,6 +49,9 @@ import { buildAgenCGetTaskTool } from './tools/agenc-get-task.js';import { buildAgenCGetAgentTool } from './tools/agenc-get-agent.js';import { buildAixbtIntelTool } from './tools/aixbt-intel.js';import { buildAixbtProjectsTool } from './tools/aixbt-projects.js';+import { buildCryptoNewsTool } from './tools/crypto-news.js';+import { buildCryptoNewsDigestTool } from './tools/crypto-news-digest.js';+import { buildCryptoNewsArchiveTool } from './tools/crypto-news-archive.js';import {UI_RESOURCE_URI,UI_MIME_TYPE,@@ -59,9 +62,14 @@ import {const SERVER_INSTRUCTIONS ='MCP tools from three.ws. Most are paid: each quotes its USDC price in its description, and a call ' +'without an x402 payment payload in _meta returns a PaymentRequired structuredContent (v2 MCP ' +- 'transport spec). ONE tool is free and needs no payment, wallet, or API key: forge_free generates a ' ++ 'transport spec). FOUR tools are free and need no payment, wallet, or API key: forge_free generates a ' +'textured 3D GLB from a text prompt on the free NVIDIA NIM (Microsoft TRELLIS) lane and returns a ' +- 'GLB URL + three.ws viewer link — use it for zero-cost text→3D. ' ++ 'GLB URL + three.ws viewer link — use it for zero-cost text→3D — and the crypto-news trio: ' ++ 'crypto_news (live headlines from 192 publisher feeds, filterable by category/source/language/search), ' ++ 'crypto_news_digest (the last 1–72h clustered into distinct narratives with stance, tickers, and every ' ++ 'covering outlet — the right first call for "what happened in crypto today"), and crypto_news_archive ' ++ '(search 660,000+ articles back to September 2017 by keyword/ticker/date/sentiment/language, plus ' ++ 'corpus stats and trending modes). ' +'Tools cover: free text→3D generation (forge_free), 3D avatar generation (text_to_avatar), ' +'text/image-to-3D mesh generation via a Granite-directed model chain (mesh_forge), ' +'auto-rigging a GLB into an animation-ready model (rig_mesh), ' +@@ -118,6 +126,9 @@ const TOOL_BUILDERS = [buildAgenCGetAgentTool,buildAixbtIntelTool,buildAixbtProjectsTool,+ buildCryptoNewsTool,+ buildCryptoNewsDigestTool,+ buildCryptoNewsArchiveTool,];/**diff --git a/mcp-server/src/tools/_news-core.js b/mcp-server/src/tools/_news-core.jsnew file mode 100644index 000000000..9279a08f5--- /dev/null+++ b/mcp-server/src/tools/_news-core.js@@ -0,0 +1,64 @@+// Shared plumbing for the FREE crypto-news MCP tools (`crypto_news`,+// `crypto_news_digest`, `crypto_news_archive`). All three read the public+// three.ws news APIs — the same endpoints behind /markets/news, /markets/digest,+// and /markets/archive — which are key-less and CORS-open, so the tools need+// no payment, wallet, or credential.+//+// Environment (optional):+// NEWS_API_BASE — three.ws origin override for self-hosted/staging installs.+// Default https://three.ws++import { toolError } from './_shared.js';++export const NEWS_API_BASE = (process.env.NEWS_API_BASE || 'https://three.ws').replace(/\/$/, '');++/**+ * GET a three.ws news API path and return parsed JSON, or a `toolError`+ * envelope the caller returns as-is. Upstream 4xx bodies carry+ * `{ error, message }` (e.g. bad_category with the valid list) — surface them+ * verbatim so the model can self-correct instead of guessing.+ */+export async function newsApiGet(path, params, { timeoutMs = 30_000 } = {}) {+ const qs = new URLSearchParams();+ for (const [k, v] of Object.entries(params || {})) {+ if (v !== undefined && v !== null && v !== '') qs.set(k, String(v));+ }+ const url = `${NEWS_API_BASE}${path}${qs.size ? `?${qs}` : ''}`;+ let resp;+ try {+ resp = await fetch(url, {+ headers: { accept: 'application/json', 'user-agent': 'three.ws-mcp-news/1.0' },+ signal: AbortSignal.timeout(timeoutMs),+ });+ } catch (err) {+ return toolError('news_api_unreachable', `three.ws news API unreachable: ${err.message}`, { url });+ }+ const body = await resp.json().catch(() => null);+ if (!resp.ok) {+ return toolError(+ body?.error || `http_${resp.status}`,+ body?.message || `three.ws news API responded ${resp.status}`,+ // pass through any self-correction hints (valid categories, etc.)+ body && typeof body === 'object' ? { upstream: body } : undefined,+ );+ }+ if (!body || typeof body !== 'object') {+ return toolError('bad_upstream_payload', 'three.ws news API returned a non-JSON payload');+ }+ return body;+}++/** Slim a live/archive article for tool output — links intact, bytes bounded. */+export function slimArticle(a) {+ return {+ title: a.title,+ link: a.link,+ source: a.source,+ category: a.category,+ published: a.pub_date,+ description: a.description || undefined,+ tickers: a.tickers?.length ? a.tickers : undefined,+ sentiment: a.sentiment?.label,+ lang: a.lang,+ };+}diff --git a/mcp-server/src/tools/crypto-news-archive.js b/mcp-server/src/tools/crypto-news-archive.jsnew file mode 100644index 000000000..518e7f0e5--- /dev/null+++ b/mcp-server/src/tools/crypto-news-archive.js@@ -0,0 +1,100 @@+// `crypto_news_archive` — FREE MCP tool over the largest open crypto-news+// archive: 660,000+ enriched articles from September 2017 to today (refreshed+// hourly from the live feed), hosted on three.ws infrastructure. Backed by+// GET /api/news/archive — the same engine behind three.ws/markets/archive.+// No payment, no key.++import { z } from 'zod';++import { free } from '../payments.js';+import { jsonSchemaFromZod } from './_shared.js';+import { NEWS_API_BASE, newsApiGet, slimArticle } from './_news-core.js';++const TOOL_NAME = 'crypto_news_archive';+const TOOL_DESCRIPTION =+ 'Search the largest open crypto-news archive: 660,000+ articles from September 2017 to today ' ++ '(CryptoPanic english corpus + Odaily chinese corpus + the three.ws live archiver, refreshed hourly), ' ++ 'every record enriched with tickers, tags, sentiment, language, and — where captured — the market ' ++ 'context at publication (BTC/ETH price, Fear & Greed). Query by keyword, ticker (e.g. BTC), source, ' ++ 'date range, sentiment, or language (en/zh). mode="stats" returns corpus statistics; mode="trending" ' ++ 'returns the most-covered tickers of the newest archived weeks. IMPORTANT: search scans months ' ++ 'newest→oldest and reports exactly which months it covered (scanned.complete=false means older months ' ++ 'remain) — pass start_date/end_date to reach a specific era, e.g. the 2017 ICO boom or the 2022 FTX ' ++ 'collapse. For today\'s coverage use crypto_news or crypto_news_digest. Free — no payment or API key required.';++const inputZodShape = {+ mode: z+ .enum(['search', 'stats', 'trending'])+ .describe('search (default) queries articles; stats returns corpus statistics; trending returns the most-covered tickers of the newest archived weeks.')+ .optional(),+ q: z.string().max(120).describe('Full-text query over title + description, e.g. "bitcoin etf" or "mt gox".').optional(),+ ticker: z.string().max(12).describe('Filter to articles tagged with this ticker, e.g. BTC, SOL.').optional(),+ source: z.string().max(40).describe('Filter by source key or name substring, e.g. coindesk, odaily.').optional(),+ sentiment: z.enum(['positive', 'negative', 'neutral']).describe('Filter by enriched sentiment.').optional(),+ lang: z.enum(['en', 'zh']).describe('Filter by article language.').optional(),+ start_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe('Earliest publish date, YYYY-MM-DD (archive starts 2017-09-23).').optional(),+ end_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe('Latest publish date, YYYY-MM-DD.').optional(),+ limit: z.number().int().min(1).max(100).describe('Max articles to return (default 25).').optional(),+ offset: z.number().int().min(0).max(5000).describe('Pagination offset within the scanned window.').optional(),+};++const inputJsonSchema = jsonSchemaFromZod(inputZodShape);++async function runCryptoNewsArchive(args = {}) {+ const { mode = 'search', q, ticker, source, sentiment, lang, start_date, end_date, limit = 25, offset } = args;++ if (mode === 'stats') {+ const body = await newsApiGet('/api/news/archive', { stats: 'true' });+ if (body.ok === false) return body;+ return { ok: true, ...body, browse_url: `${NEWS_API_BASE}/markets/archive` };+ }+ if (mode === 'trending') {+ const body = await newsApiGet('/api/news/archive', { trending: 'true' });+ if (body.ok === false) return body;+ return { ok: true, ...body, browse_url: `${NEWS_API_BASE}/markets/archive` };+ }++ const body = await newsApiGet(+ '/api/news/archive',+ { q, ticker, source, sentiment, lang, start_date, end_date, limit, offset },+ { timeoutMs: 60_000 },+ );+ if (body.ok === false) return body;++ const out = {+ ok: true,+ matches_in_scanned_window: body.total_scanned_matches,+ count: body.articles.length,+ has_more: body.has_more,+ scanned: body.scanned,+ articles: body.articles.map((a) => ({+ ...slimArticle(a),+ market_context: a.market_context || undefined,+ })),+ browse_url: `${NEWS_API_BASE}/markets/archive`,+ };+ // The API's own coverage hint tells the model how to reach older months.+ if (body.hint) out.hint = body.hint;+ return out;+}++export function buildCryptoNewsArchiveTool() {+ const handler = free({ toolName: TOOL_NAME, inputSchema: inputJsonSchema }, (args) =>+ runCryptoNewsArchive(args),+ );+ return {+ name: TOOL_NAME,+ title: 'Crypto news archive (660k+, 2017→)',+ description: TOOL_DESCRIPTION,+ inputSchema: inputZodShape,+ // Historical corpus reads are stable for date-bounded queries; the+ // newest month keeps growing hourly, so not strictly idempotent.+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },+ handler,+ };+}diff --git a/mcp-server/src/tools/crypto-news-digest.js b/mcp-server/src/tools/crypto-news-digest.jsnew file mode 100644index 000000000..12299edd2--- /dev/null+++ b/mcp-server/src/tools/crypto-news-digest.js@@ -0,0 +1,73 @@+// `crypto_news_digest` — FREE MCP tool: the last N hours of crypto coverage+// clustered into the handful of stories that actually matter, instead of a+// flat headline list. Backed by GET /api/news/digest — the same engine behind+// three.ws/markets/digest. No payment, no key.++import { z } from 'zod';++import { free } from '../payments.js';+import { jsonSchemaFromZod } from './_shared.js';+import { NEWS_API_BASE, newsApiGet } from './_news-core.js';++const TOOL_NAME = 'crypto_news_digest';+const TOOL_DESCRIPTION =+ 'The crypto news cycle, clustered: groups the last N hours (1–72, default 24) of coverage from the ' ++ 'three.ws aggregator into distinct narratives, each with a title, a plain-language summary, a ' ++ 'bullish/bearish/neutral stance, the tickers involved, a coverage count, and links to every real ' ++ 'article behind it. The response names the clustering engine honestly — "llm" (semantic grouping via ' ++ 'the platform model chain, with hallucinated citations dropped) or "heuristic" (keyword+ticker ' ++ 'Jaccard clustering) — plus an overall market mood and the most-covered tickers for the window. ' ++ 'Ideal first call for "what happened in crypto today". For raw headlines use crypto_news; for ' ++ 'history use crypto_news_archive. Free — no payment or API key required.';++const inputZodShape = {+ hours: z.number().int().min(1).max(72).describe('Coverage window in hours (default 24).').optional(),+ limit: z.number().int().min(3).max(12).describe('Max narratives to return (default 8).').optional(),+};++const inputJsonSchema = jsonSchemaFromZod(inputZodShape);++async function runCryptoNewsDigest({ hours = 24, limit = 8 } = {}) {+ const body = await newsApiGet('/api/news/digest', { hours, limit }, { timeoutMs: 60_000 });+ if (body.ok === false) return body;++ return {+ ok: true,+ window_hours: body.window_hours,+ mood: body.mood,+ top_tickers: body.top_tickers,+ articles_considered: body.articles_considered,+ engine: body.engine,+ generated_at: body.generated_at,+ narratives: body.narratives.map((n) => ({+ title: n.title,+ summary: n.summary,+ stance: n.stance,+ tickers: n.tickers?.length ? n.tickers : undefined,+ coverage: n.coverage,+ articles: n.articles.map((a) => ({ title: a.title, link: a.link, source: a.source, published: a.pub_date })),+ })),+ browse_url: `${NEWS_API_BASE}/markets/digest${hours !== 24 ? `?hours=${hours}` : ''}`,+ };+}++export function buildCryptoNewsDigestTool() {+ const handler = free({ toolName: TOOL_NAME, inputSchema: inputJsonSchema }, (args) =>+ runCryptoNewsDigest(args),+ );+ return {+ name: TOOL_NAME,+ title: 'Crypto news digest (clustered)',+ description: TOOL_DESCRIPTION,+ inputSchema: inputZodShape,+ // Read-only; the digest regenerates as coverage moves, so calls are+ // safe to repeat but not byte-identical.+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },+ handler,+ };+}diff --git a/mcp-server/src/tools/crypto-news.js b/mcp-server/src/tools/crypto-news.jsnew file mode 100644index 000000000..26f888f49--- /dev/null+++ b/mcp-server/src/tools/crypto-news.js@@ -0,0 +1,75 @@+// `crypto_news` — FREE MCP tool: live crypto headlines from the three.ws+// native aggregator (192 publisher RSS/Atom feeds across 27 categories and+// 17 languages, per-source cached with serve-stale-on-error). No payment, no+// key. Backed by GET /api/news/feed — the same endpoint behind+// three.ws/markets/news.++import { z } from 'zod';++import { free } from '../payments.js';+import { jsonSchemaFromZod } from './_shared.js';+import { NEWS_API_BASE, newsApiGet, slimArticle } from './_news-core.js';++const TOOL_NAME = 'crypto_news';+const TOOL_DESCRIPTION =+ 'Live crypto news headlines aggregated by three.ws directly from 192 publisher RSS/Atom feeds — ' ++ 'CoinDesk, The Block, Decrypt, CoinTelegraph, SEC press, exchange blogs, research desks, and ' ++ 'international outlets in 17 languages. Filter by category (bitcoin, ethereum, solana, defi, nft, ' ++ 'trading, research, security, regulation-adjacent geopolitical, and more), by a single source key, ' ++ 'by language, or full-text search the headlines. Each article returns title, publisher link, source, ' ++ 'publish time, detected tickers, and lexicon sentiment. An invalid category/source errors with the ' ++ 'valid list, so retry from that. For the day grouped into stories use crypto_news_digest; for ' ++ 'coverage older than a few days use crypto_news_archive. Free — no payment or API key required.';++const inputZodShape = {+ q: z.string().max(80).describe('Full-text filter over title/description/tickers, e.g. "bitcoin etf" or "SOL".').optional(),+ category: z+ .string()+ .max(24)+ .describe('One category slug, e.g. bitcoin, ethereum, solana, defi, nft, trading, research, onchain, security, mainstream, geopolitical, journalism. Omit for all. Invalid values error with the full list.')+ .optional(),+ source: z.string().max(40).describe('A single source key (e.g. coindesk, theblock, sec_press) — overrides category and lang.').optional(),+ lang: z+ .string()+ .max(5)+ .describe('Language code: en (default), or any of the 17 registry languages (zh, ja, ko, es, de, fr, …), or "all" to interleave every language.')+ .optional(),+ limit: z.number().int().min(1).max(50).describe('Max articles to return (default 20).').optional(),+};++const inputJsonSchema = jsonSchemaFromZod(inputZodShape);++async function runCryptoNews({ q, category, source, lang, limit = 20 } = {}) {+ const body = await newsApiGet('/api/news/feed', { q, category, source, lang, limit });+ if (body.ok === false) return body; // toolError envelope, verbatim++ return {+ ok: true,+ total_matching: body.total,+ count: body.articles.length,+ sources_live: `${body.sources_ok}/${body.sources_total}`,+ fetched_at: body.fetched_at,+ articles: body.articles.map(slimArticle),+ browse_url: `${NEWS_API_BASE}/markets/news${q ? `?q=${encodeURIComponent(q)}` : ''}`,+ rss_url: `${NEWS_API_BASE}/api/news/rss`,+ };+}++export function buildCryptoNewsTool() {+ const handler = free({ toolName: TOOL_NAME, inputSchema: inputJsonSchema }, (args) => runCryptoNews(args));+ return {+ name: TOOL_NAME,+ title: 'Crypto news (live, 192 feeds)',+ description: TOOL_DESCRIPTION,+ inputSchema: inputZodShape,+ // Read-only view over a live feed: repeat calls are safe but not+ // byte-identical (new stories arrive), and it reaches the open web.+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },+ handler,+ };+}diff --git a/public/changelog.json b/public/changelog.jsonindex 22bc367b5..668d1f1d3 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T18:27:18.762Z",+ "generated_at": "2026-07-10T18:27:33.083Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -82,7 +82,7 @@"type": "update","title": "Agents can now read the news: three free MCP tools for headlines, digests, and the 660k archive","summary": "The three.ws MCP server grew a crypto-news trio, all free — no payment, wallet, or API key. crypto_news streams live headlines from 192 publisher feeds with category, source, language, and search filters. crypto_news_digest hands an agent the last day (or up to three) clustered into distinct stories with stance, tickers, and every covering outlet — the right first call for \"what happened in crypto today\". crypto_news_archive searches 660,000+ articles back to September 2017 by keyword, ticker, date, sentiment, or language, with corpus stats and trending modes. Any MCP client — Claude Desktop, Cursor, or another agent — can now cite a decade of crypto coverage.",- "link": "/mcp",+ "link": "/docs/mcp","tags": ["feature","sdk"diff --git a/public/changelog.xml b/public/changelog.xmlindex dbb6a6239..f533e75e3 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -64,7 +64,7 @@</item><item><title>Agents can now read the news: three free MCP tools for headlines, digests, and the 660k archive</title>- <link>https://three.ws/mcp</link>+ <link>https://three.ws/docs/mcp</link><guid isPermaLink="false">2026-07-10:Agents can now read the news: three free MCP tools for headlines, digests, and the 660k archive</guid><pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate><category>feature</category>diff --git a/public/features.json b/public/features.jsonindex d864c7361..9aeba25b7 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T18:27:18.749Z",+ "generated_at": "2026-07-10T18:27:33.069Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/mcp-crypto-news.test.js b/tests/mcp-crypto-news.test.jsnew file mode 100644index 000000000..bebfa792c--- /dev/null+++ b/tests/mcp-crypto-news.test.js@@ -0,0 +1,169 @@+// Coverage for the FREE crypto-news MCP tool trio (`crypto_news`,+// `crypto_news_digest`, `crypto_news_archive`) — thin, honest views over the+// public three.ws news APIs. These tests guard:+// - each descriptor advertises free-ness, is read-only, and quotes no price,+// - the upstream response is slimmed without inventing fields,+// - upstream 4xx self-correction hints (valid category lists) pass through+// verbatim inside a toolError envelope (ok:false → isError),+// - network failure becomes a designed toolError, never a throw,+// - archive modes (search/stats/trending) hit the right query params.++import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';++import { buildCryptoNewsTool } from '../mcp-server/src/tools/crypto-news.js';+import { buildCryptoNewsDigestTool } from '../mcp-server/src/tools/crypto-news-digest.js';+import { buildCryptoNewsArchiveTool } from '../mcp-server/src/tools/crypto-news-archive.js';++function res(status, body = {}) {+ return { status, ok: status >= 200 && status < 300, json: async () => body };+}+const structured = (envelope) => envelope.structuredContent;++const ARTICLE = {+ id: 'aaaaaaaaaaaaaaaa',+ title: 'Bitcoin ETF inflows hit record',+ link: 'https://example.com/etf',+ description: 'Spot products absorbed inflows.',+ image: null,+ source: 'CoinDesk',+ source_key: 'coindesk',+ category: 'general',+ pub_date: '2026-07-10T10:00:00.000Z',+ tickers: ['BTC'],+ sentiment: { score: 0.4, label: 'positive', confidence: 0.7 },+ lang: 'en',+};++describe('descriptors', () => {+ it.each([+ [buildCryptoNewsTool, 'crypto_news'],+ [buildCryptoNewsDigestTool, 'crypto_news_digest'],+ [buildCryptoNewsArchiveTool, 'crypto_news_archive'],+ ])('%s is free, read-only, and quotes no USDC price', (build, name) => {+ const tool = build();+ expect(tool.name).toBe(name);+ expect(tool.description.toLowerCase()).toContain('free');+ expect(tool.description).not.toMatch(/\$[0-9]/);+ expect(tool.annotations.readOnlyHint).toBe(true);+ expect(tool.annotations.destructiveHint).toBe(false);+ expect(tool.handler).toBeTypeOf('function');+ });+});++describe('handlers', () => {+ let fetchMock;+ beforeEach(() => {+ fetchMock = vi.fn();+ vi.stubGlobal('fetch', fetchMock);+ });+ afterEach(() => {+ vi.unstubAllGlobals();+ vi.restoreAllMocks();+ });++ it('crypto_news slims articles and reports feed health', async () => {+ fetchMock.mockResolvedValue(+ res(200, { articles: [ARTICLE], total: 120, sources_ok: 180, sources_total: 192, fetched_at: 'now' }),+ );+ const out = structured(await buildCryptoNewsTool().handler({ q: 'etf', limit: 5 }));+ expect(out.ok).toBe(true);+ expect(out.total_matching).toBe(120);+ expect(out.sources_live).toBe('180/192');+ expect(out.articles[0]).toMatchObject({+ title: ARTICLE.title,+ link: ARTICLE.link,+ source: 'CoinDesk',+ tickers: ['BTC'],+ sentiment: 'positive',+ });+ // no invented fields — the slim shape only carries what upstream sent+ expect(out.articles[0]).not.toHaveProperty('id');+ const url = String(fetchMock.mock.calls[0][0]);+ expect(url).toContain('/api/news/feed');+ expect(url).toContain('q=etf');+ expect(url).toContain('limit=5');+ });++ it('passes upstream self-correction hints through as a toolError', async () => {+ fetchMock.mockResolvedValue(+ res(400, { error: 'bad_category', message: 'unknown category "defii"', categories: ['defi', 'nft'] }),+ );+ const envelope = await buildCryptoNewsTool().handler({ category: 'defii' });+ expect(envelope.isError).toBe(true);+ const out = structured(envelope);+ expect(out.ok).toBe(false);+ expect(out.error).toBe('bad_category');+ expect(out.upstream.categories).toEqual(['defi', 'nft']); // the model can retry from this+ });++ it('network failure becomes a designed toolError, never a throw', async () => {+ fetchMock.mockRejectedValue(new Error('getaddrinfo ENOTFOUND'));+ const envelope = await buildCryptoNewsTool().handler({});+ expect(envelope.isError).toBe(true);+ expect(structured(envelope).error).toBe('news_api_unreachable');+ });++ it('crypto_news_digest returns narratives with real article links', async () => {+ fetchMock.mockResolvedValue(+ res(200, {+ window_hours: 24, mood: 'bullish', top_tickers: ['BTC'], articles_considered: 90,+ engine: 'llm', provider: 'groq', generated_at: 'now',+ narratives: [+ {+ title: 'ETF inflows break records', summary: 'Two outlets report.', stance: 'bullish',+ tickers: ['BTC'], coverage: 2,+ articles: [{ title: 'a', link: 'https://x.com/1', source: 'CoinDesk', pub_date: 'd' }],+ },+ ],+ }),+ );+ const out = structured(await buildCryptoNewsDigestTool().handler({ hours: 24 }));+ expect(out.ok).toBe(true);+ expect(out.engine).toBe('llm');+ expect(out.narratives[0].articles[0].link).toBe('https://x.com/1');+ expect(String(fetchMock.mock.calls[0][0])).toContain('/api/news/digest');+ });++ it('crypto_news_archive search forwards filters and surfaces coverage honesty', async () => {+ fetchMock.mockResolvedValue(+ res(200, {+ articles: [{ ...ARTICLE, market_context: { btc_price: 64000 } }],+ total_scanned_matches: 41, has_more: true,+ scanned: { months: ['2026-07'], complete: false, months_remaining: 100 },+ hint: 'add start_date to reach older articles',+ }),+ );+ const out = structured(+ await buildCryptoNewsArchiveTool().handler({ ticker: 'BTC', sentiment: 'positive', limit: 10 }),+ );+ expect(out.ok).toBe(true);+ expect(out.scanned.complete).toBe(false);+ expect(out.hint).toContain('start_date');+ expect(out.articles[0].market_context.btc_price).toBe(64000);+ const url = String(fetchMock.mock.calls[0][0]);+ expect(url).toContain('ticker=BTC');+ expect(url).toContain('sentiment=positive');+ });++ it('crypto_news_archive stats and trending modes hit their query flags', async () => {+ fetchMock.mockResolvedValue(res(200, { stats: { total_articles: 662547 } }));+ const stats = structured(await buildCryptoNewsArchiveTool().handler({ mode: 'stats' }));+ expect(stats.stats.total_articles).toBe(662547);+ expect(String(fetchMock.mock.calls[0][0])).toContain('stats=true');++ fetchMock.mockResolvedValue(res(200, { trending: [{ ticker: 'BTC', count: 900 }] }));+ const trending = structured(await buildCryptoNewsArchiveTool().handler({ mode: 'trending' }));+ expect(trending.trending[0].ticker).toBe('BTC');+ expect(String(fetchMock.mock.calls[1][0])).toContain('trending=true');+ });+});++describe('server registration', () => {+ it('the news trio is part of the built tool surface', async () => {+ const { buildTools } = await import('../mcp-server/src/index.js');+ const names = (await buildTools()).map((t) => t.name);+ expect(names).toEqual(+ expect.arrayContaining(['crypto_news', 'crypto_news_digest', 'crypto_news_archive']),+ );+ });+});