socialcrawl-mcp 2.2.0 → 2.5.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 +49 -21
- package/dist/app.d.ts +3 -3
- package/dist/app.js +75 -12
- package/dist/chatgpt-text.d.ts +23 -0
- package/dist/chatgpt-text.js +310 -0
- package/dist/client-tag.d.ts +13 -0
- package/dist/client-tag.js +17 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +14 -4
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context.d.ts +13 -0
- package/dist/context.js +1 -0
- package/dist/cost-guard.d.ts +15 -3
- package/dist/cost-guard.js +39 -3
- package/dist/data/docs-async.d.ts +2 -2
- package/dist/data/docs-async.js +24 -3
- package/dist/data/docs-handwritten.js +968 -906
- package/dist/data/docs.js +7 -1
- package/dist/data/endpoints.js +11153 -7559
- package/dist/data/examples.js +2 -2
- package/dist/data/guide.d.ts +2 -2
- package/dist/data/guide.js +2 -2
- package/dist/data/outputs.js +425 -290
- package/dist/data/platforms.js +214 -55
- package/dist/data/recipes.js +1 -1
- package/dist/data/registry-meta.d.ts +10 -10
- package/dist/data/registry-meta.js +10 -10
- package/dist/endpoint-resolve.d.ts +1 -0
- package/dist/endpoint-resolve.js +10 -1
- package/dist/endpoint-surface.d.ts +64 -0
- package/dist/endpoint-surface.js +472 -0
- package/dist/hydration.js +28 -3
- package/dist/instructions.md +18 -18
- package/dist/listings.d.ts +24 -0
- package/dist/listings.js +55 -0
- package/dist/oauth/config.d.ts +39 -4
- package/dist/oauth/config.js +50 -6
- package/dist/oauth/resource-server.d.ts +12 -2
- package/dist/oauth/resource-server.js +5 -20
- package/dist/oauth/scopes.d.ts +2 -2
- package/dist/oauth/scopes.js +4 -4
- package/dist/param-aliases.d.ts +7 -0
- package/dist/param-aliases.js +15 -0
- package/dist/pricing.js +5 -1
- package/dist/resources/sample-gate.js +34 -1
- package/dist/resources/supplier-tokens.d.ts +1 -1
- package/dist/resources/supplier-tokens.js +2 -0
- package/dist/result.js +8 -0
- package/dist/schemas/async.d.ts +41 -31
- package/dist/schemas/async.js +28 -9
- package/dist/schemas/outputs.d.ts +4 -4
- package/dist/schemas/tools.d.ts +18 -6
- package/dist/schemas/tools.js +24 -4
- package/dist/server.js +6 -5
- package/dist/timeouts.d.ts +24 -1
- package/dist/timeouts.js +32 -0
- package/dist/tools/account.d.ts +4 -1
- package/dist/tools/account.js +1 -1
- package/dist/tools/async-common.js +3 -1
- package/dist/tools/check-balance.d.ts +4 -2
- package/dist/tools/check-balance.js +9 -0
- package/dist/tools/discover-runs.js +117 -11
- package/dist/tools/discover.js +3 -0
- package/dist/tools/estimate.js +10 -1
- package/dist/tools/list-endpoints.js +5 -3
- package/dist/tools/manage.js +2 -0
- package/dist/tools/monitors.d.ts +7 -1
- package/dist/tools/monitors.js +26 -2
- package/dist/tools/pricing.js +11 -1
- package/dist/tools/request.js +10 -2
- package/dist/types.d.ts +9 -1
- package/dist/value-prices.d.ts +18 -0
- package/dist/value-prices.js +79 -0
- package/package.json +75 -75
package/README.md
CHANGED
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
|
|
24
24
|
### Remote server (hosted — no install)
|
|
25
25
|
|
|
26
|
-
Connect straight to the hosted Streamable HTTP endpoint
|
|
26
|
+
Connect straight to the hosted Streamable HTTP endpoint. There is nothing to install or run.
|
|
27
|
+
|
|
28
|
+
**Sign in instead of a key.** The hosted server supports OAuth sign-in. Add `https://mcp.socialcrawl.dev/mcp` to your client and sign in with your SocialCrawl account. The client gets a key of its own, which you can cap or disconnect under Dashboard → Connected apps. claude.ai, ChatGPT and Perplexity take the URL as a custom connector. The steps for every client are at [socialcrawl.dev/docs/mcp/sign-in](https://www.socialcrawl.dev/docs/mcp/sign-in).
|
|
29
|
+
|
|
30
|
+
**Or send your key in a header**, for agents, scripts and CI:
|
|
27
31
|
|
|
28
32
|
**Claude Code** (works in the CLI *and* Claude Code on the web / cloud sandboxes)
|
|
29
33
|
|
|
@@ -48,10 +52,14 @@ claude mcp add --scope user --transport http socialcrawl https://mcp.socialcrawl
|
|
|
48
52
|
|
|
49
53
|
**Cursor / Windsurf / VS Code** — choose the HTTP ("streamable-http") server type with the same URL and header. `x-api-key: sc_your_key_here` works as an alternative header.
|
|
50
54
|
|
|
51
|
-
The discovery tools (`socialcrawl_find`, `socialcrawl_endpoint`, `socialcrawl_estimate`) work without a key, so you can explore before signing up.
|
|
55
|
+
The discovery tools (`socialcrawl_find`, `socialcrawl_endpoint`, `socialcrawl_estimate`) work without a key or a sign-in, so you can explore before signing up. The key header and sign-in both work on the hosted server. How the sign-in works (an OAuth 2.1 resource server, on since 27/11/2026) is in `docs/REMOTE-STREAMABLE-HTTP.md` section 10a.
|
|
56
|
+
|
|
57
|
+
**ChatGPT plugin directory.** `https://mcp.socialcrawl.dev/chatgpt` serves the same API as one tool per endpoint (`get_tiktok_profile`, `search_reddit_comments` and so on) with sign-in, because the ChatGPT directory accepts only one tool per operation. Everywhere else, use `/mcp` above: its seven tools find, price and call any endpoint.
|
|
52
58
|
|
|
53
59
|
Prefer running it locally? Every stdio option below works exactly as before.
|
|
54
60
|
|
|
61
|
+
To label this server's spend, set `SOCIALCRAWL_CLIENT_TAG` (stdio) or send an `x-client-tag` header (remote): 1-64 letters, digits, `.`, `_`, `:` or `-`. It is stored on every charge, so `socialcrawl_account` `view: "usage"` with `group_by: "tag"` shows spend per tag.
|
|
62
|
+
|
|
55
63
|
### npm
|
|
56
64
|
|
|
57
65
|
```bash
|
|
@@ -153,7 +161,7 @@ Restart your AI client after saving the configuration.
|
|
|
153
161
|
|
|
154
162
|
`socialcrawl-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that connects AI agents to the [SocialCrawl API](https://socialcrawl.dev) — a unified data API over social, commerce, jobs, finance, research and web data. `socialcrawl_find` with no task lists every platform; `socialcrawl_account` view `freshness` shows the live counts.
|
|
155
163
|
|
|
156
|
-
Retrieve profiles, posts, comments, search results, trending content, and analytics from TikTok, Instagram, YouTube, Twitter/X, LinkedIn, Reddit, Threads, Douyin, Xiaohongshu, Telegram, Quora, Bluesky, Apple Music, GitHub, Hacker News, Product Hunt, Polymarket, and many more platforms. Pull products, offers, price history, reviews, and sellers from Amazon, Walmart, Target, Home Depot, eBay, Klarna, AliExpress, Etsy, Sephora, H&M, Kohl's, Wayfair, Gumtree, and Google Shopping; apps, charts, and reviews from Google Play and the Apple App Store; hotels, restaurants, attractions, cruises, and traveler reviews from Tripadvisor, plus local business data from Yelp and Google Business; brand reputation from Trustpilot and software reviews from G2; job listings and salary bands from LinkedIn, Indeed, Bing, and Xing; market quotes, price history, financial statements, and options chains; US congressional trading disclosures; Korean search and Data Lab trend series from Naver; cross-web brand mentions with sentiment via Content Analysis; Google News headlines and Google Trends interest curves — plus web research via Tavily and Perplexity, AI-powered X search via Grok, on-page SEO audits, and a single `/search/everywhere` endpoint that fans out across the major social platforms, news, Quora and Naver in one call. New in 2.2.0: Weibo, Goodreads, Airbnb, Booking.com, Bing and DuckDuckGo.
|
|
164
|
+
Retrieve profiles, posts, comments, search results, trending content, and analytics from TikTok, Instagram, YouTube, Twitter/X, LinkedIn, Reddit, Threads, Douyin, Xiaohongshu, Telegram, Quora, Bluesky, Apple Music, GitHub, Hacker News, Product Hunt, Polymarket, and many more platforms. Pull products, offers, price history, reviews, and sellers from Amazon, Walmart, Target, Home Depot, eBay, Klarna, AliExpress, Etsy, Sephora, H&M, Kohl's, Wayfair, Gumtree, and Google Shopping; apps, charts, and reviews from Google Play and the Apple App Store; hotels, restaurants, attractions, cruises, and traveler reviews from Tripadvisor, plus local business data from Yelp and Google Business; brand reputation from Trustpilot and software reviews from G2; job listings and salary bands from LinkedIn, Indeed, Bing, and Xing; market quotes, price history, financial statements, and options chains; US congressional trading disclosures; Korean search and Data Lab trend series from Naver; cross-web brand mentions with sentiment via Content Analysis; Google News headlines and Google Trends interest curves — plus web research via Tavily and Perplexity, AI-powered X search via Grok, on-page SEO audits, and a single `/search/everywhere` endpoint that fans out across the major social platforms, news, Quora and Naver in one call. New in 2.2.0: Weibo, Goodreads, Airbnb, Booking.com, Bing and DuckDuckGo. New in 2.3.0: 20 more platforms — Zillow, Redfin, Realtor.com, Apartments.com, Homes.com, Apple Maps, Yahoo, Yandex, Baidu, Wikipedia, Stack Overflow, npm, PyPI, Steam, SoundCloud, IKEA, Kroger, Sprouts, Best Buy and idealo — plus Google Maps reviews and review history, company job boards, bulk review history, and every price change since 2.2.0. New in 2.5.0: the full text of X Articles (`twitter/article`, and on `twitter/tweet` at no extra cost), the posts that quote a post, LinkedIn resharers and GitHub star history; 14 new endpoints (X trends, an account's replies, whole threads, list and community members, followers and posts; Instagram reposts and hashtag search; TikTok places; Facebook Marketplace category browse; Reddit posts by linked site and account search); new fields on X (link cards among them), Instagram, Reddit, TikTok (caption files), YouTube, LinkedIn and Facebook; new joins priced per use (YouTube video details, X profile details, Reddit activity, community info and media, Instagram counts, Marketplace vehicle details); transcripts with timed segments metered by video length; LinkedIn company lanes by page link; NSFW and AI-label filters on Discover; and exact quotes for every new price, including the `pages` lever on profile/full.
|
|
157
165
|
|
|
158
166
|
New in v2.0.0: **seven tools instead of eleven** (`socialcrawl_find`, `socialcrawl_endpoint`, `socialcrawl_estimate`, `socialcrawl_request`, `socialcrawl_collect`, `socialcrawl_account`, `socialcrawl_manage`). See [Available Tools](#available-tools) for the 1.x → 2.0 mapping and [CHANGELOG.md](CHANGELOG.md) for every release.
|
|
159
167
|
|
|
@@ -427,35 +435,35 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
|
|
|
427
435
|
| Platform | Data Available |
|
|
428
436
|
|----------|----------------|
|
|
429
437
|
| **LinkedIn** | Profiles (single sub-resources or one-call bundles: all, complete, with-posts) & company pages (incl. lookup by domain, also-viewed, employee counts), posts & post-with-comments, reposts, reactions, comments & replies, Pulse articles with comments and reactions, people search (keyword or search-URL), company & hashtag search, similar members, profile sub-resources (experience, education, skills, position skills, certifications, followed schools/newsletters/Top Voices, last activity…), jobs (search, company jobs, jobs a member posted, hiring team, details), company insights, groups, the complete post-history archive (metered per post), transcripts, Ad Library, profile-360 |
|
|
430
|
-
| **Prism** | Cross-platform composites — URL lookup, comment harvesting, batch post-stats/profile/comment lookup, async background jobs of up to 5,000 items, handle-audit, name→accounts resolution (find-accounts), handle/link mentions, adverse-post screening, campaign-brief checks, hook/format lift, term earliness, a no-keyword country trend board, commenter language mix, comment-sourced buyer leads, brand mentions, demand signals, AI visibility, crisis radar/post-mortem, reputation, share-of-voice, creator vetting & creator cards, org radar, Korea gap, AI consensus answers, video/app/product intelligence |
|
|
438
|
+
| **Prism** | Cross-platform composites — URL lookup, comment harvesting, batch post-stats/profile/comment lookup, async background jobs of up to 5,000 items (or 1,000 calls of any GET endpoint), bulk review history for up to 20,000 Yelp/Tripadvisor/App Store/Google Play items (`reviews/bulk`), handle-audit, name→accounts resolution (find-accounts), handle/link mentions, adverse-post screening, campaign-brief checks, hook/format lift, term earliness, a no-keyword country trend board, commenter language mix, comment-sourced buyer leads, brand mentions, demand signals, AI visibility, crisis radar/post-mortem, reputation, share-of-voice, creator vetting & creator cards, org radar, Korea gap, AI consensus answers, video/app/product intelligence |
|
|
431
439
|
| **Instagram** | Profiles, account transparency (profile/about), posts, reels, comments & comment replies, highlights, stories, tagged & location feeds, followers/following, similar accounts, post likers, reshare stats, one-call reels/posts feeds with share counts, engagement analytics, universal + popular-post search, reels/hashtag/profile/location/music search (reel search with creator cards via `include=creator`), on-screen text (OCR), trending, transcripts, profile-360 |
|
|
432
440
|
| **TikTok** | Profiles, videos, comments & replies, on-screen text extraction, keyword/hashtag/user/music search + suggestions, hashtag details, trending (global or in-country For You), TikTok's own popular-hashtag and Top Videos boards, audience, similar accounts, followers, liked videos, playlists & collections, place feeds, effects, live, songs, transcripts, Ad Library, profile-360 |
|
|
433
|
-
| **Facebook** | Pages, groups & group posts, posts, comments & replies, photos, reels (incl. full reels feed with view counts), events & event search, Marketplace, keyword search over posts/pages/people/videos/groups, transcripts, full Ad Library |
|
|
434
|
-
| **YouTube** | Channels, videos, shorts, comments & replies, sponsors, playlists & items, community posts, search (advanced
|
|
441
|
+
| **Facebook** | Pages, groups & group posts, a group's upcoming events (with details), posts, comments & replies (with sticker/GIF/image media), photos, reels (incl. full reels feed with view counts), events & event search, Marketplace, keyword search over posts/pages/people/videos/groups, transcripts, full Ad Library |
|
|
442
|
+
| **YouTube** | Channels, videos, shorts, comments & replies, sponsors, playlists & items, community posts, search (advanced with `features`, autocomplete), search inside one channel, channel podcasts, trending, live streams, `sort=oldest` on videos and shorts, channel contact email lookup, media files (audio/video/subtitles/thumbnails), transcripts, batch videos/channels/transcripts, profile-360 |
|
|
435
443
|
| **Web Scraping** | Scrape, web search, site map, LLM extract, async crawl/batch-scrape/agent jobs with per-page error feeds, change monitors, interactive browser sessions, document parse — driven by `socialcrawl_manage` (area `web`) |
|
|
436
444
|
| **US Congress Trades** | US Congress STOCK Act disclosures — trade feeds (all/48h/7d), members, per-politician and per-ticker stats and trades, state delegations, and the full statistics suite (party, sectors, issuers, volume, unusual activity, buy/sell ratio, late filings) |
|
|
437
445
|
| **Klarna** | Product details and every merchant offer, keyword search + suggestions, user and professional reviews with score overviews, price history, product comparison, category browsing with filters/keywords/buying guides, store listings |
|
|
438
|
-
| **Tripadvisor** | Hotels, restaurants
|
|
446
|
+
| **Tripadvisor** | Hotels, restaurants and attractions — search and full detail for each — plus cruise details and reviews; traveler reviews up to 500 deep with visit month, traveller type, sub-ratings and owner replies; place lookup by URL, destination autocomplete, experience types |
|
|
439
447
|
| **Twitter/X** | Profiles, tweets and replies, tweet & user search, user media, followers, following, retweeters, communities, video transcripts, AI search via Grok, profile-360 |
|
|
440
448
|
| **Naver** | Korea's #1 portal — blog, news, encyclopedia, cafe, KiN, local, image, web search, errata & adult classifiers, Data Lab search-trend & shopping-insight series, brief |
|
|
441
449
|
| **Reddit** | Subreddits, post detail, comments, user profiles with post and comment history, keyword/comment/media search, subreddit discovery, transcripts, omni-search VoC sweep |
|
|
442
|
-
| **GitHub** | Users, repos, issues, PRs, READMEs, releases, search, repo dossier, user profile-velocity |
|
|
450
|
+
| **GitHub** | Users, repos (stars, forks, open issues, language), repository search with qualifiers, issues and PRs (state, merged, labels, full body), READMEs, releases, search, repo dossier, user profile-velocity |
|
|
443
451
|
| **Gumtree** | UK classifieds — listing search and details, similar listings, seller profiles and their ads, search suggestions, trending searches, category tree with filters, location lookup |
|
|
444
|
-
| **Jobs** | Job search and listing detail across LinkedIn, Indeed, Bing and Xing, LinkedIn organization-id resolution
|
|
452
|
+
| **Jobs** | Job search and listing detail across LinkedIn, Indeed (with job type, workplace, salary and recency filters), Google Jobs, Bing and Xing; a company's open roles on Greenhouse, Lever, Ashby or Workday; Levels.fyi jobs with pay; LinkedIn organization-id resolution; salary ranges by title and country |
|
|
445
453
|
| **Sephora** | Product details, reviews, keyword search + suggestions, category tree browsing, brand listings and per-brand products, store lookup, per-SKU in-store availability |
|
|
446
454
|
| **Content Analysis** | Cross-web brand mentions, sentiment, rating distributions, phrase/category trends |
|
|
447
|
-
| **Google** | Web search,
|
|
455
|
+
| **Google** | Web search, Images, Patents, AI Overview, autocomplete, Maps business search (rating and opening-hours filters), Business Profile (info, Maps reviews up to 1,000 deep with sort/since/phrase/topic filters, an async review history up to 10,000 reviews, extended reviews, contributor reviews, popular times, photos, menu, updates, Q&A), Ads Transparency, keyword volume, Travel hotels |
|
|
448
456
|
| **AliExpress** | Product details, keyword search, similar products, reviews, per-SKU shipping, hot products, featured promotions, category tree |
|
|
449
457
|
| **Apple App Store** | App search, search suggestions, app details, reviews, charts, listings database, reference data |
|
|
450
|
-
| **Google Play** | App search, search suggestions, app details, reviews, charts, listings database, reference data |
|
|
451
|
-
| **Amazon** | Product search, ASIN details, reviews, sellers, shop pages, Best Sellers charts, current deals, seller profiles — ~13 marketplaces |
|
|
458
|
+
| **Google Play** | App search, books and audiobooks search, films and shows search, search suggestions, app details, reviews with developer replies, charts, listings database, reference data |
|
|
459
|
+
| **Amazon** | Product search and suggestions, ASIN details, reviews, sellers, shop pages, Best Sellers charts, current deals, seller profiles — ~13 marketplaces |
|
|
452
460
|
| **Douyin** | China's TikTok — video search, creator profiles and feeds, video detail, comments and comment replies, creator search, hot-search board (mostly metered per row) |
|
|
453
461
|
| **Finance** | Instrument quotes, ticker search, markets overview, instrument news, daily price history, company financial statements, options chains |
|
|
454
|
-
| **G2** | Software marketplace — product pages, reviews, category listings and the category index, vendor profiles and their catalogue, product URL index |
|
|
462
|
+
| **G2** | Software marketplace — product pages, reviews (`depth` 1-100, did-you-mean on an unknown slug), category listings and the category index, vendor profiles and their catalogue, a searchable product URL index |
|
|
455
463
|
| **Quora** | Question search and detail, answer search, Space post search, profile search, Space/topic search |
|
|
456
464
|
| **H&M** | Keyword search + suggestions, store listings by country, countries/languages, category tree, per-product supplier and factory disclosure |
|
|
457
|
-
| **Pinterest** |
|
|
458
|
-
| **Spotify** | Artists, tracks, albums, podcasts, episodes, search |
|
|
465
|
+
| **Pinterest** | Profiles, pins, boards, user boards, search, Pinterest Trends by country, URL save-counts |
|
|
466
|
+
| **Spotify** | Artists, tracks, albums, playlists with tracks, podcasts, episodes, search |
|
|
459
467
|
| **Threads** | Profiles, posts, post comments, keyword search, user search |
|
|
460
468
|
| **Utility** | Free API self-discovery — quickstart, endpoint catalogue, per-endpoint usage guide, cross-cutting capabilities index, plain-words call planner, LLM context payload. 0 credits, served from the live registry. Behind `socialcrawl_find`, `socialcrawl_endpoint`, `socialcrawl_estimate` and `socialcrawl_account` |
|
|
461
469
|
| **Xiaohongshu** | RED / Little Red Book — note search, hot-search board, creator profiles and their notes, note detail, top-level comments (5cr per returned row) |
|
|
@@ -467,16 +475,16 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
|
|
|
467
475
|
| **TikTok Shop** | Products, reviews, listings, search, creator showcases |
|
|
468
476
|
| **Universal Search** | One query fanned out across many platforms (20cr flat) — with date windows, platform include/exclude, languages, country and `depth=quick`; lists of up to 100 searches as one background run and scheduled watches that deliver only new rows (`POST`, managed with `socialcrawl_manage` area `search_runs`); `multi` — each named platform's own native search in one call at the sum of their page prices; forums lane; multi-country news lane (metered); creator-discovery lane across TikTok/Threads/Instagram |
|
|
469
477
|
| **Walmart** | Product details, reviews, keyword search, category browsing, seller offers |
|
|
470
|
-
| **Yelp** | Business profiles by
|
|
471
|
-
| **Bluesky** | Profiles, user posts, post details, keyword post search |
|
|
478
|
+
| **Yelp** | Business profiles by id, name slug or any `/biz/` link (phone, website, amenities, neighborhoods), reviews at 1 credit a page (`limit`, `sort`, rating/language/text filters, hidden not-recommended reviews), an async review history, business search (compact and full-card, `bbox` tiling past 240 results) |
|
|
479
|
+
| **Bluesky** | Profiles, user posts (filter + cursor), followers, post details, keyword post search |
|
|
472
480
|
| **Etsy** | Listings by id or URL, a shop's catalogue, similar listings, search suggestions |
|
|
473
|
-
| **Hacker News** | Story search,
|
|
481
|
+
| **Hacker News** | Story search, front-page feeds (top, new, best, Ask, Show, job), story and comment tree by id or URL, profile |
|
|
474
482
|
| **Home Depot** | Keyword search, product details by item id or URL (store/zip-aware pricing), reviews, store lookup by ZIP |
|
|
475
483
|
| **Tavily** | Web search (with LLM answer), URL extraction, sitemap, full crawl |
|
|
476
484
|
| **Twitch** | Profiles, clips, videos, schedules |
|
|
477
485
|
| **Google Trends** | Interest-over-time (explore), rising/breakout related queries, and Trending Now by location |
|
|
478
486
|
| **Kwai** | Profiles, posts |
|
|
479
|
-
| **Telegram** | Public channel profiles, channel post feeds, single post lookup |
|
|
487
|
+
| **Telegram** | Public channel profiles, channel post feeds, single post lookup, post comments (newest 100, then 50 a page), channel discovery |
|
|
480
488
|
| **Truth Social** | Profiles, posts |
|
|
481
489
|
| **Wayfair** | Product search, product details by SKU, reviews |
|
|
482
490
|
| **eBay** | Listing search incl. sold/completed with realised prices, listing details |
|
|
@@ -496,9 +504,29 @@ Pass an `idempotencyKey` to `socialcrawl_request` (UUIDv4 recommended) to make t
|
|
|
496
504
|
| **Weibo** | Accounts, an account's posts, posts, comments and replies, post search back through time, account search, hot-search list |
|
|
497
505
|
| **Goodreads** | Books by id/URL/ISBN, reader reviews (free labels), editions, review comments, search, authors and their books, quotes, series, Listopia lists |
|
|
498
506
|
| **Airbnb** | Listing search for a place and stay, listing cards, guest reviews (free labels), availability calendars |
|
|
499
|
-
| **Booking.com** | Property search for a destination and stay, property cards, guest reviews (free labels) |
|
|
500
|
-
| **Bing** | Web results, domain rank up to 200 deep, videos, search suggestions |
|
|
507
|
+
| **Booking.com** | Property search for a destination and stay, property cards, rooms and rates for a stay, guest reviews (free labels) |
|
|
508
|
+
| **Bing** | Web results, domain rank up to 200 deep, images, videos, Shopping search and product offers, search suggestions |
|
|
501
509
|
| **DuckDuckGo** | Web results, domain rank up to 200 deep, news, videos, images, instant answers, suggestions |
|
|
510
|
+
| **Zillow** | Listing search, a home with price and tax history (agent, parcel, open houses, schools, floor plans), region and address lookup |
|
|
511
|
+
| **Redfin** | Listing search to your `limit` with photos, a home with price and tax history (opt-in `include=details`) |
|
|
512
|
+
| **Realtor.com** | Homes for sale or rent from any search link, a home's full card |
|
|
513
|
+
| **Apartments.com** | Rental search, a building with its units |
|
|
514
|
+
| **Homes.com** | A home's full card by link |
|
|
515
|
+
| **Apple Maps** | Place search in a map box or around a point, up to 50 places by id |
|
|
516
|
+
| **Yahoo** | Web results |
|
|
517
|
+
| **Yandex** | Web results and Images |
|
|
518
|
+
| **Baidu** | Web results up to the 750th |
|
|
519
|
+
| **Wikipedia** | Article search, an article as plain text |
|
|
520
|
+
| **Stack Overflow** | Question search, a question, its answers and comments |
|
|
521
|
+
| **npm** | Package search, a package version |
|
|
522
|
+
| **PyPI** | A project release |
|
|
523
|
+
| **Steam** | Store search, an app by id |
|
|
524
|
+
| **SoundCloud** | A track by link |
|
|
525
|
+
| **IKEA** | Product search |
|
|
526
|
+
| **Kroger** | Product search |
|
|
527
|
+
| **Sprouts** | Product search, a product by link |
|
|
528
|
+
| **Best Buy** | A product by link |
|
|
529
|
+
| **idealo** | Italy price comparison — product search, a product with every shop offer |
|
|
502
530
|
|
|
503
531
|
`socialcrawl_find` with no task lists every platform with its live endpoint count.
|
|
504
532
|
|
package/dist/app.d.ts
CHANGED
|
@@ -27,9 +27,9 @@ export interface AppConfig {
|
|
|
27
27
|
*/
|
|
28
28
|
trustProxy?: number | boolean;
|
|
29
29
|
/**
|
|
30
|
-
* OAuth 2.1 resource-server mode
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* OAuth 2.1 resource-server mode. Omitted → read from env (on when
|
|
31
|
+
* SOCIALCRAWL_OAUTH_KEY_LOOKUP_SECRET is set, see oauth/config.ts);
|
|
32
|
+
* `null` → off. The key header keeps working when it is on.
|
|
33
33
|
*/
|
|
34
34
|
oauth?: OAuthResourceServerConfig | null;
|
|
35
35
|
}
|
package/dist/app.js
CHANGED
|
@@ -4,9 +4,19 @@ import { createHash } from "node:crypto";
|
|
|
4
4
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
5
|
import { extractApiKey } from "./auth.js";
|
|
6
6
|
import { createServer } from "./server.js";
|
|
7
|
+
import { createEndpointServer, endpointToolScopes } from "./endpoint-surface.js";
|
|
7
8
|
import { SERVER_NAME, SERVER_VERSION } from "./constants.js";
|
|
8
9
|
import { oauthConfigFromEnv } from "./oauth/config.js";
|
|
9
10
|
import { mountProtectedResourceMetadata, oauthGate, RESOLVED_API_KEY } from "./oauth/resource-server.js";
|
|
11
|
+
import { SCOPES_SUPPORTED } from "./oauth/scopes.js";
|
|
12
|
+
import { CHATGPT_SURFACE, isListing, listingSurface } from "./listings.js";
|
|
13
|
+
/**
|
|
14
|
+
* /mcp is the seven-tool server; /chatgpt is the endpoint surface (one tool per
|
|
15
|
+
* endpoint) for the ChatGPT plugin directory. Both share the limiters below.
|
|
16
|
+
*/
|
|
17
|
+
const MCP_PATHS = ["/mcp", "/chatgpt"];
|
|
18
|
+
/** Token shown in the OpenAI platform's "Domain verification" panel for the SocialCrawl plugin. */
|
|
19
|
+
const OPENAI_APPS_CHALLENGE_TOKEN = "Kt1HUZBedz6_KD-TQLluvPVN4hxxHkhW5toy8pq_hq0";
|
|
10
20
|
export function buildApp(config) {
|
|
11
21
|
const oauth = config.oauth === undefined ? oauthConfigFromEnv(process.env) : (config.oauth ?? undefined);
|
|
12
22
|
const app = express();
|
|
@@ -48,6 +58,14 @@ export function buildApp(config) {
|
|
|
48
58
|
});
|
|
49
59
|
if (oauth) {
|
|
50
60
|
mountProtectedResourceMetadata(app, oauth);
|
|
61
|
+
// /chatgpt has its own metadata; the root fallback keeps naming /mcp.
|
|
62
|
+
if (oauth.endpointSurface) {
|
|
63
|
+
mountProtectedResourceMetadata(app, { resource: oauth.endpointSurface.resource, issuer: oauth.issuer }, { root: false });
|
|
64
|
+
}
|
|
65
|
+
// Each store listing names its own address as the resource (sheet A1).
|
|
66
|
+
for (const { resource } of oauth.listings?.values() ?? []) {
|
|
67
|
+
mountProtectedResourceMetadata(app, { resource, issuer: oauth.issuer }, { root: false });
|
|
68
|
+
}
|
|
51
69
|
}
|
|
52
70
|
// The xForwardedForHeader validation would 500 any request carrying an
|
|
53
71
|
// X-Forwarded-For header while `trust proxy` is off. We ignore that header
|
|
@@ -56,7 +74,7 @@ export function buildApp(config) {
|
|
|
56
74
|
// Tier 1 — hard per-IP ceiling for ALL /mcp traffic. Generous enough that no
|
|
57
75
|
// real client hits it; stops garbage-key floods from bypassing limiting.
|
|
58
76
|
const globalLimits = config.globalRateLimit ?? { windowMs: 60_000, limit: 600 };
|
|
59
|
-
app.use(
|
|
77
|
+
app.use(MCP_PATHS, rateLimit({
|
|
60
78
|
windowMs: globalLimits.windowMs,
|
|
61
79
|
limit: globalLimits.limit,
|
|
62
80
|
standardHeaders: true,
|
|
@@ -67,7 +85,7 @@ export function buildApp(config) {
|
|
|
67
85
|
// skips it (valid keys are limited upstream by concurrency + credit billing;
|
|
68
86
|
// invalid keys are caught by the global ceiling above).
|
|
69
87
|
const limits = config.rateLimit ?? { windowMs: 60_000, limit: 60 };
|
|
70
|
-
app.use(
|
|
88
|
+
app.use(MCP_PATHS, rateLimit({
|
|
71
89
|
windowMs: limits.windowMs,
|
|
72
90
|
limit: limits.limit,
|
|
73
91
|
standardHeaders: true,
|
|
@@ -81,11 +99,42 @@ export function buildApp(config) {
|
|
|
81
99
|
// With OAuth on, the gate answers 401/403 or resolves the token's API key
|
|
82
100
|
// into res.locals; without it, the key comes straight from the headers.
|
|
83
101
|
const mcpGate = oauth ? [oauthGate(oauth)] : [];
|
|
84
|
-
|
|
102
|
+
// /chatgpt lists tools anonymously (the directory scans them) but runs none:
|
|
103
|
+
// every tool there needs an account, so any tools/call without one gets the
|
|
104
|
+
// 401 that starts sign-in.
|
|
105
|
+
const chatgptScopes = endpointToolScopes();
|
|
106
|
+
const chatgptGate = oauth?.endpointSurface
|
|
107
|
+
? [
|
|
108
|
+
oauthGate({ ...oauth, resource: oauth.endpointSurface.resource, verifier: oauth.endpointSurface.verifier }, { anonymousTools: new Set(), scopesForTool: (name) => chatgptScopes[name] ?? SCOPES_SUPPORTED }),
|
|
109
|
+
]
|
|
110
|
+
: [];
|
|
111
|
+
// A known listing has its own gate (its own resource and audience); an
|
|
112
|
+
// unknown one is gated exactly like /mcp.
|
|
113
|
+
const listingGates = new Map([...(oauth?.listings ?? [])].map(([slug, l]) => [slug, oauthGate({ ...oauth, resource: l.resource, verifier: l.verifier })]));
|
|
114
|
+
const listingGate = (req, res, next) => {
|
|
115
|
+
const slug = String(req.params.listing);
|
|
116
|
+
const gate = (isListing(slug) ? listingGates.get(slug) : undefined) ?? mcpGate[0];
|
|
117
|
+
if (gate)
|
|
118
|
+
gate(req, res, next);
|
|
119
|
+
else
|
|
120
|
+
next();
|
|
121
|
+
};
|
|
122
|
+
const serve = (build, surfaceOf) => async (req, res) => {
|
|
85
123
|
// Stateless: fresh server + transport per request, key bound via closure.
|
|
86
124
|
const resolvedKey = res.locals[RESOLVED_API_KEY];
|
|
87
|
-
|
|
88
|
-
|
|
125
|
+
// The caller's own x-client-tag labels its charges (API-210); client.ts
|
|
126
|
+
// drops one that breaks the API's rule. Never read from process env here.
|
|
127
|
+
const tagHeader = req.headers["x-client-tag"];
|
|
128
|
+
const clientTag = typeof tagHeader === "string" ? tagHeader : undefined;
|
|
129
|
+
// The surface label comes from this app's own route, never from a header.
|
|
130
|
+
const clientSurface = surfaceOf?.(req);
|
|
131
|
+
const ctx = {
|
|
132
|
+
apiKey: resolvedKey ?? extractApiKey(req.headers),
|
|
133
|
+
baseUrl,
|
|
134
|
+
...(clientTag ? { clientTag } : {}),
|
|
135
|
+
...(clientSurface ? { clientSurface } : {}),
|
|
136
|
+
};
|
|
137
|
+
const server = build(ctx);
|
|
89
138
|
const transport = new StreamableHTTPServerTransport({
|
|
90
139
|
sessionIdGenerator: undefined,
|
|
91
140
|
enableJsonResponse: true,
|
|
@@ -111,16 +160,30 @@ export function buildApp(config) {
|
|
|
111
160
|
});
|
|
112
161
|
}
|
|
113
162
|
}
|
|
114
|
-
}
|
|
115
|
-
app.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
163
|
+
};
|
|
164
|
+
app.post("/mcp", ...mcpGate, serve(createServer));
|
|
165
|
+
app.post("/chatgpt", ...chatgptGate, serve(createEndpointServer, () => CHATGPT_SURFACE));
|
|
166
|
+
app.post("/mcp/:listing", listingGate, serve(createServer, (req) => {
|
|
167
|
+
const slug = String(req.params.listing);
|
|
168
|
+
return isListing(slug) ? listingSurface(slug) : undefined;
|
|
169
|
+
}));
|
|
170
|
+
for (const path of [...MCP_PATHS, "/mcp/:listing"]) {
|
|
171
|
+
app.get(path, (_req, res) => {
|
|
172
|
+
res.status(405).set("Allow", "POST").send();
|
|
173
|
+
});
|
|
174
|
+
app.delete(path, (_req, res) => {
|
|
175
|
+
res.status(405).set("Allow", "POST").send();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
121
178
|
app.get("/healthz", (_req, res) => {
|
|
122
179
|
res.json({ status: "ok", name: SERVER_NAME, version: SERVER_VERSION });
|
|
123
180
|
});
|
|
181
|
+
// OpenAI Apps (ChatGPT plugin) domain verification, 27/11/2026. The portal
|
|
182
|
+
// fetches this origin-root URL and expects the token as the whole body. The
|
|
183
|
+
// token is public by design, so it lives here rather than in an env var.
|
|
184
|
+
app.get("/.well-known/openai-apps-challenge", (_req, res) => {
|
|
185
|
+
res.type("text/plain").send(OPENAI_APPS_CHALLENGE_TOKEN);
|
|
186
|
+
});
|
|
124
187
|
// Error handler: malformed JSON / oversized bodies otherwise fall through to
|
|
125
188
|
// Express's default HTML error page — return JSON-RPC errors instead.
|
|
126
189
|
app.use((err, _req, res, next) => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Written text for /chatgpt tools whose registry wording OpenAI's tool scan
|
|
3
|
+
* refused or would refuse (30/11/2026): a read whose text says it carries on
|
|
4
|
+
* in the background, a comparison with another product, a title that says
|
|
5
|
+
* "every" over a capped call, two prices in one description, telegraphic
|
|
6
|
+
* text with arrows. Only this surface reads it; /mcp and the API docs keep
|
|
7
|
+
* the registry text.
|
|
8
|
+
*
|
|
9
|
+
* Every fact here comes from the endpoint's own registry entry. Paths such as
|
|
10
|
+
* `blog/search` are fine: the surface turns them into tool names. The rules in
|
|
11
|
+
* chatgpt-surface.test.ts hold for every tool, so a new endpoint whose
|
|
12
|
+
* registry text breaks one fails the suite until it has an entry here.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolText {
|
|
15
|
+
title?: string;
|
|
16
|
+
summary?: string;
|
|
17
|
+
useWhen?: string;
|
|
18
|
+
/** Replaces the cost sentence when the price is not per call. */
|
|
19
|
+
cost?: string;
|
|
20
|
+
/** Argument descriptions to replace; null leaves the argument out. */
|
|
21
|
+
params?: Record<string, string | null>;
|
|
22
|
+
}
|
|
23
|
+
export declare const TOOL_TEXT: Record<string, ToolText>;
|