Scrapling MCP Server
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
D4D4Vinci/Scrapling107k近 7 天新增 1,982 个 star
Search and analyze global news coverage and US TV transcripts via the GDELT Project APIs.
Search and analyze global news coverage and US television transcripts from the GDELT Project's real-time APIs via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://gdelt.caseyjhand.com/mcp
News and TV coverage analysis from the GDELT Project: global news in 65+ languages, and historical TV transcripts across 150+ stations, with coverage dates varying by station. Article search and relative timespan windows cover the last 3 months; explicit dates reach older windows in the coverage timeline's volume and tone modes, the language and country breakdowns, and the tone distribution. Sentence search reads what the last 72 hours of English-language coverage said. Search articles, sentences, and clips, track coverage spikes, analyze tone, and compare coverage across languages, countries, stations, and shows.
| Tool | Description |
|---|---|
gdelt_search_articles | Search recent global news with full-text and filter operators. Returns every fetched in-window article, up to 250 per call, with date-window continuation guidance at the provider ceiling. |
gdelt_search_sentences | Read the sentences of the last 72 hours of English-language news that hold every query term, one per article, with the surrounding text and a window to re-run for the next matches. |
gdelt_get_coverage_timeline | Track normalized coverage, raw matching-article counts with monitored denominators, or average tone. Expand supplied article references for selected timesteps. |
gdelt_get_tone_distribution | Get a tone histogram (bins ~−30 to +30) showing whether coverage is uniformly negative, bimodal, or clustered near neutral. |
gdelt_get_coverage_breakdown | Compare coverage by source language or source country. Values are normalized shares of each source population's media output, not additive article counts. |
gdelt_search_themes | Find GKG theme identifiers for the theme: operator the DOC tools accept — drought finds NATURAL_DISASTER_DROUGHT, cyberattack finds CYBER_ATTACK — ranked by the count GDELT's theme lookup lists. |
gdelt_search_tv | Search television news closed captions and return separate station timelines or pooled coverage. |
gdelt_get_tv_breakdown | Rank stations by airtime share or matching-clip count, and shows by share of matching clips. |
gdelt_get_tv_clips | Retrieve up to 3,000 matching TV clips with transcript excerpts and Internet Archive viewing links, returning every fetched in-window clip. |
gdelt_get_tv_context | Get the most frequent co-occurring words and phrases from GDELT's relevance-ranked sample of TV clips matching a query. |
gdelt_list_tv_stations | List TV stations with market, network, and monitoring date ranges — all of them, or filtered by station ID, network, or market — to verify station availability before querying. |
gdelt_search_articles toolsourcecountry:, sourcelang:, domain:, theme:, tone</tone>), proximity (near20:) and repetition (repeat3:) — gdelt_search_themes finds the identifiers theme: takesrelevance, dateDesc, dateAsc, toneDesc, toneAsc, hybridRel) and fetch count, up to 250 per call; larger maxRecords values clamp to 250 by defaultseendate (when GDELT saw the article, not its publication time), domain, language, source country, and social image URLclimate OR energy) is sent as one group, (climate OR energy), which effectiveQuery and the notice show; any other query with OR outside parentheses (climate OR energy sourcelang:english, climate OR sourcelang:english) fails invalid_query before any request, and a lowercase or first or last stays a word (on all nine query tools)query, or a timespan that is not a number with an optional unit after it (24hours, 7d, 60), is refused before any request (on all four DOC tools). A timespan over 3 months is sent as given and runs on 3 months, disclosed in windowClampstartDatetime/endDatetime window under 30 minutes is never sent to DOC (on all four DOC tools): a local GKG mirror answers it where one runs, and otherwise the call fails invalid_date_rangecontinuationWindows gives narrower date windows to re-query (de-duplicate by url), halving a window of 60 minutes or more. A shorter one has no halves DOC accepts: it gets one window per 15-minute slot a local GKG mirror holds where one can answer it, until a mirror answer is down to one slot, and none otherwise. The ceiling is not a cursor; an indivisible window can still contain more matches than one call returnsstartDatetime/endDatetime window are dropped, and the notice counts themgdelt_search_sentences toolseendate, and language, with isquote flagging a quotation mark; one sentence per articlegdelt_search_articles), -term (excludes the exact word only), near5:"trump putin", and repeat2:"ukraine". quotesOnly keeps sentences holding a quotation mark. sourcecountry:, theme:, and tone filters draw a hint to use gdelt_search_articles, sourcelang: is refused, and domain: is not offered: GDELT answered it with no match, and an empty answer to a query naming it says so in the noticesort: dateDesc (default, newest first) or dateAsc. There is no relevance ordermaxRecords (default 25, cap 200, clamped with limitClamp) counts matching sentences before GDELT keeps one per article, so a page usually holds fewer matches. A page that is not every match hands back continuationWindow, the startDatetime/endDatetime to re-run for the next matches. GDELT reads window bounds only to the minute, so that window's edge sits on a whole minute and the matches seen in that minute can repeat: de-duplicate by url. The notice says when the page holds every match in its window (complete) and when no narrower window reaches further, so only a larger maxRecords can (blocked): a page whose matches all fall in one minute, common on a broad query, cannot be continued inside that minute, so at the 200 ceiling continuationWindow skips past it and the notice says soendDatetime goes upstream rounded up to the next whole minute, and matches GDELT returns outside the requested window are dropped and counted in the noticetimespan is a whole number followed by min, h, hours, d, or days, from 31min to 72h (default 72h); a longer one runs as 72h and is disclosed in windowClamp, and 30min, w, m, or 1.5d are refused as invalid_query. An explicit window starting before the 72-hour reach runs from 5 minutes inside it (windowClamp), one ending before the reach or starting in the future is refused as invalid_date_range, and one under 60 minutes goes upstream widened, with matches outside the requested window dropped and counted in the noticegdelt_get_coverage_timeline toolvolume (normalized % per timestep), volume_raw (matching-article counts with the monitored-article denominator norm), volume_with_articles (volume plus supplied top articles), and tone (average sentiment)referenceCount, the number of references GDELT supplied, not all matching articles. points: ["<date>"] selects named timesteps with every supplied link; GDELT's reference list itself is capped at tenoffset and limit (default 10, cap 400); nextOffset retrieves the next page. Each series' pointCount and peak cover the full series on every page; pointCount counts the points GDELT returned, not the window's timestepsvolume_raw, smoothing changes value, not normtimespan (up to 3 months) or explicit startDatetime/endDatetime; dateResolution (15min/hour/day) is the one GDELT reports, inferred from returned intervals only when it reports none. In volume and tone modes an explicit window may predate the last 3 months; volume_raw and volume_with_articles cover only the last 3 monthsmissingTimesteps (present only above 0) counts the timesteps GDELT left out between the first and last it returned, and the notice names each missing run. A left-out timestep is a gap in GDELT's data, not zero coverage, which GDELT returns as 0. It is the same on every page and in every mode, never reported for a mirror answer, and leading steps dropped by smoothing are not gapspoints date matching no timestep, or an offset past the last timestep, is rejected with the valid valuesgdelt_get_tone_distribution toolcount counts matching articles, while referenceCount counts supplied links. The default preview shows 3 links; bins: [<bin>] selects named bins with every supplied link. An unknown bin is rejected with the available binspeakNegativeBin, peakPositiveBin, neutralPct (% of articles in the −2 to +2 range)offset and limit (default 10, cap 400), returning nextOffset when more remain. This is a snapshot across matching articles, unlike the tone timelinetimespan (up to 3 months) or explicit startDatetime/endDatetime, and an explicit window may predate the last 3 monthsgdelt_get_coverage_breakdown toollanguage or country into a multi-series time series, ranking every series by summed value. otherSeriesLabels names the ranked series not on the pageseries: ["<label>"] returns only those series, complete, under selectedSeries; a label matching no series is rejected with the available labels, and a label several series share returns all of themoffset and limit (default 10, cap 75), returning nextOffset when more remain. Copy exact labels from the response for series selectionssum (the ranking key, neither a share nor an article count), pointCount (points GDELT returned), and peak for the whole series on every page. includePoints: false (default true) leaves data out of every returned series for a lighter ranking; ranking and paging do not changeoperator, a paste-ready sourcecountry:<FIPS> or sourcelang:<name> for gdelt_search_articles and gdelt_get_coverage_timeline queries. Country codes are FIPS, not ISO (AU is Austria). It is omitted when the series name maps to no GDELT code or to several (Serbia, Equatorial Guinea)timespan (up to 3 months) or explicit startDatetime/endDatetime, and an explicit window may predate the last 3 months. dateResolution is the one GDELT reports, inferred only when it reports nonemissingTimesteps (present only above 0) counts the timesteps GDELT left out between the first and last it returned across every series, and the notice names each missing run. A left-out timestep is a gap in GDELT's data, not zero coverage. It is the same on every page and under series or includePoints: false, and never reported for a mirror answergdelt_search_themes tooloperator such as theme:TAX_DISEASE_OUTBREAKcyberattack → CYBER_ATTACK, plant disease → TAX_PLANTDISEASE). If nothing matches, it retries once with a trailing s dropped (protests → PROTEST) and the notice says sooffset / limit (default 25, cap 100); larger limits clamp by default. nextOffset appears only when more matches remain, and an offset past a non-empty result fails offset_out_of_rangegdelt_search_tv toolstations (e.g. ["CNN", "FOXNEWS"]) take station IDs, not display labels. Each entry is trimmed, blank entries are dropped, and the rest of the list is sent in full; an entry that is not letters and digits ("FOX News", "CNN,MSNBC", "CNN*") fails with invalid_query before any request. TV queries can also use station, network, or market selectors; verify IDs and coverage dates through the station catalognormalize toggles relative airtime % (default) vs. raw matching 15-second clip counts; optional dateres aggregation (hour/day/week/month/year). TV operators: station:, network:, market:, show:, context:; OR outside parentheses as in gdelt_search_articlesstation (the ID the stations input takes, FOXNEWS) and stationName (GDELT's label, FOX News). If an ID can't be resolved, the series keeps stationName without station and the notice says sonextOffset with the same inputs for the next page. Each series carries pointCount and peak for the whole series on every page; the text surface's per-station sum and page peak cover only the returned pagestartDatetime/endDatetime that falls inside a period is widened outward to it, and the notice names the UTC window the values cover. An endDatetime exactly on the clock hour counts as the second before it, so it adds no period starting there (20240924000000–20241004000000 ends with Oct 3). Without dateres, a window of exactly 3×365 days or 7 days and a second ending on the hour is sent with the dateres its span implies (month, day), so the trimmed second does not change the points' resolution. A window the trim would leave under 30 minutes is sent as given, because GDELT refuses a shorter one, and counts the hour after its endcombined: true pools stations into a Combined timeline. Normalized values use pooled matching clips divided by pooled monitored clips, not an average of station percentages; no station ID is assigned to the combined seriestimespan counts back from now, past the end of most stations' monitoring; for archived periods pass startDatetime/endDatetime inside a station's range from gdelt_list_tv_stations. An empty result for stations names each selected station whose monitoring range the window misses, with that rangegdelt_get_tv_clips toolmaxRecords values clamp to 3,000 by defaultstation and stationName (resolved as in gdelt_search_tv, so a series' station passes straight into stations), air timestamp, 15-second transcript excerpt, direct Archive.org link, and optional thumbnailstartDatetime/endDatetime window are dropped and counted in the notice, though edge clips still spend maxRecords (a timespan call drops nothing)continuationWindows gives narrower windows to re-query (de-duplicate by archiveUrl); whole-hour retrieval can still prevent reaching every match in a dense hourstations names each selected station whose monitoring range the window missesgdelt_get_tv_breakdown toolnormalize: false; resolvable rows include a station IDnormalize: false. Labels are preserved exactly, but GDELT sometimes abbreviates them with ellipses, so they are not all reusable show: selectorsoffset / limit paging (default 25, cap 10,000), totalRows, and nextOffsetendDatetime exactly on the clock hour counts as the second before it, so it adds no period starting there, and the length GDELT reads is the window minus that second: exactly 3×365 days ranks over days, and 7 days and a second over hours. A window the trim would leave under 30 minutes is sent as givenstations names each selected station whose monitoring range the window missesgdelt_get_tv_context toolnotice. Compare windows or stations with a separate, narrower call for eachoffset / limit (default 25, cap 25,000). The notice names the UTC window the terms cover when an explicit edge falls inside a period, and an endDatetime exactly on the clock hour counts as the second before it, as for gdelt_get_tv_breakdown. totalTerms counts the returned vocabulary across all pages, not matching clips; nextOffset and truncated disclose remaining termsstations names each selected station whose monitoring range the window missesgdelt_list_tv_stations toolstations, network, and market filtersnetwork: "FOX" does not match FOXNEWS); activeCount and totalCount count the returned stationsisActive is true when the end date is within the last 24 hoursstations parameter on other TV toolsBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
GDELT-specific:
timespan answer only while younger than the timespan), and the response says so in staleResponse; an invalid query, an unparseable body, or a cancelled call never falls back. A call holding such an answer waits on GDELT at most 45 s, and not at all while its own API (DOC, TV, or Context) is cooling down after a rate limitstations arrays instead of raw TV query syntaxAgent-friendly output:
timespan sent (a window the call ran on instead is in windowClamp), so calls chain without re-deriving parameterslabel fields ("Volume Intensity", "Average Tone", language/country names) instead of positional arraysisActive boolean and ISO 8601 datesnotice on how to broaden the query. On the DOC tools the notice also says GDELT returns empty answers when overloaded, so retry before treating the result as no coveragestaleResponse (fetchedAt, ageSeconds, reason) on every DOC, Context, and TV tool when a stored answer was served; source, attempts, and coverage on the four DOC tools while a mirror is configuredA public instance is available at https://gdelt.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"gdelt-mcp-server": {
"type": "streamable-http",
"url": "https://gdelt.caseyjhand.com/mcp"
}
}
}
Add the following to your MCP client configuration file.
{
"mcpServers": {
"gdelt-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/gdelt-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"gdelt-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/gdelt-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"gdelt-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/gdelt-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
git clone https://github.com/cyanheads/gdelt-mcp-server.git
cd gdelt-mcp-server
bun install
cp .env.example .env
# edit .env if you need to override defaults
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
| Variable | Description | Default |
|---|---|---|
GDELT_BASE_URL | Override the GDELT API base URL for the DOC, Context, and TV APIs. | https://api.gdeltproject.org/api/v2 |
GDELT_REQUEST_DELAY_MS | Minimum milliseconds between GDELT requests (enforces 1 req/5s limit). | 5300 |
GDELT_REQUEST_TIMEOUT_MS | Deadline for a single GDELT request (a call with retries is bounded at twice this). | 60000 |
GDELT_CLAMP_LIMITS | Clamp oversized positive integer counts to each tool's served cap, with limitClamp, a log, and a counter. Set false to reject above-cap counts instead. | true |
GDELT_MIRROR_PATH | SQLite database file of the local GKG mirror. Unset leaves the mirror off. | none |
GDELT_MIRROR_WINDOW_DAYS | Days of 15-minute GKG slots the mirror keeps, 1–90. | 7 |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | Port for the HTTP server. | 3010 |
MCP_HTTP_ENDPOINT_PATH | HTTP endpoint path where the MCP server is mounted. | /mcp |
MCP_PUBLIC_URL | Public origin override for TLS-terminating reverse-proxy deployments. | none |
MCP_AUTH_MODE | Auth mode: none, jwt, or oauth. | none |
MCP_SESSION_MODE | HTTP session mode: auto, stateful, or stateless. | stateless |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
MCP_GC_PRESSURE_INTERVAL_MS | Opt-in Bun-only forced-GC loop interval in ms. | 0 (disabled) |
LOGS_DIR | Directory for log files (Node.js only). | <app-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
Build and run:
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security audit
bun run test # Vitest test suite
bun run lint:mcp # Validate MCP definitions against spec
docker build -t gdelt-mcp-server .
docker run --rm -p 3010:3010 gdelt-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/gdelt-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
The DOC API sometimes refuses requests for long stretches, or answers empty while overloaded. The optional mirror keeps a local SQLite copy of GDELT's Global Knowledge Graph (GKG), the English and translingual feeds GDELT publishes every 15 minutes on data.gdeltproject.org, so the four DOC tools (gdelt_search_articles, gdelt_get_coverage_timeline, gdelt_get_tone_distribution, gdelt_get_coverage_breakdown) can still answer. It is off unless GDELT_MIRROR_PATH is set. TV tools, sentence search, and theme search never use it.
When it answers. DOC is asked first (a stored answer to the identical request counts as DOC's, and wins over the mirror), and the mirror answers when DOC is rate-limited, unavailable, or returns nothing. An empty DOC answer is replaced only if the mirror finds at least one match. An explicit window under 30 minutes, which DOC refuses as too short, is never sent to DOC: the mirror answers it, with matches or none, and attempts opens with DOC's window_too_short. Where the mirror cannot answer, the call fails invalid_date_range, naming the mirror's reason. Invalid queries and cancelled calls never reach it. A mirror answer carries source: "gkg_mirror", attempts (what each source did), and coverage when the mirror holds less than the requested window, and the notice says why it answered. When the mirror cannot answer (no completed init, a query operator it can't evaluate, a window outside what it holds), DOC's error is returned with the mirror's reason in the message and a hint.
How its answers differ from DOC's.
theme: matches the exact theme ID. GKG themes are tagged on translated articles too, so a theme: element in place of a keyword reaches non-English coverage the keyword misses; the notice says so when the query requires a keyword. sourcecountry: and country breakdowns use GDELT's 2015 domain-to-country file, which covered 83–92% of sampled rows; matching articles from outlets it doesn't list are left out of country series and counted in the notice.volume_raw denominator are over mirrored articles, so they differ from DOC's figures. Shares, tone means, and smoothed values the mirror computes carry four decimals, as DOC's normalized values do.nearN:, repeatN:, the image operators (imagetag: and the rest), unknown name: operators, and comparisons other than tone/toneabs are not compiled; a sourcelang: or sourcecountry: value it can't resolve is refused too. It also refuses an unquoted keyword that is one character or contains a hyphen, an OR group that nests or contains an exclusion, an excluded OR group, and a query of more than 100 elements or 1,000 characters. The mirror declines a query that uses any of these, and the error or the attempts detail names which.Enable it.
GDELT_MIRROR_PATH to a database file, and optionally GDELT_MIRROR_WINDOW_DAYS.bun run mirror:init from a checkout. It downloads every 15-minute slot of both feeds in the window, 2 s apart, resumes where it stopped if interrupted, and never runs on server startup.better-sqlite3 too, or startup fails when GDELT_MIRROR_PATH is set.With Docker, point the path at a file on a mounted volume (the image creates /var/lib/gdelt-mirror, owned by the bun user) and run the scripts in the container:
docker run -d --name gdelt -p 3010:3010 \
-v gdelt-mirror:/var/lib/gdelt-mirror \
-e GDELT_MIRROR_PATH=/var/lib/gdelt-mirror/gkg.db \
gdelt-mcp-server
docker exec gdelt bun run mirror:init
bun run mirror:verify (or docker exec gdelt bun run mirror:verify) reports the SQLite integrity check, sync status, row count, and each feed's covered slots and gaps.
Disk and bandwidth. A stored article takes about 1.8 KB, plus about 3 MB for the domain-to-country table. A 7-day window (the default) runs about 3 GB in a typical week and up to about 5.6 GB at weekday peak volume; a busy 15-minute slot holds up to about 4,760 rows across both feeds. The first mirror:init for 7 days fetches about 1,344 files, up to about 12.5 GB, and takes 50–60 minutes, most of it the pause between files. Steady-state refresh downloads 0.56–1.71 GB a day. Size scales with GDELT_MIRROR_WINDOW_DAYS.
Refresh. On HTTP transport the server refreshes the mirror every 15 minutes once a first init has completed. On stdio, run bun run mirror:refresh from cron every 15 minutes. One process syncs a store at a time: a run that starts while another holds it stops before fetching anything, so the server skips that tick and mirror:init or mirror:refresh exits 1 with Mirror sync is already in progress; rerun the script once the other run finishes. A run that was killed holds the store for up to two minutes more.
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and inits services. |
src/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts). Eleven tools across the DOC, Context, and TV APIs and the GKG theme lookup. |
src/services/gdelt | GdeltDocService, GdeltContextService, and GdeltTvService wrapping the DOC, Context, and TV APIs, a rate-limit cooldown per API in front of the request slot all three share, the response cache that serves repeated and stale answers, the router that falls back to the mirror on DOC calls, and GdeltThemeService for the GKG theme lookup. |
src/services/gkg-mirror | The optional local GKG mirror: feed download and parsing, the SQLite store and its worker thread, the DOC query compiler, and the queries that emulate the four DOC modes. |
scripts | Repository tooling, including the mirror:init, mirror:refresh, and mirror:verify scripts. |
tests/ | Unit and integration tests mirroring src/. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagesrc/mcp-server/tools/definitions/index.tsIssues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
D4D4Vinci/Scrapling107k近 7 天新增 1,982 个 star
Fetches web content and converts it to Markdown for an LLM to read
MOmodelcontextprotocol/servers92k近 7 天新增 200 个 star
Keyword research, site audits, rank tracking and AI visibility for your AI agent.
EVevery-app/open-seo29k近 7 天新增 630 个 star
Search and discover Agent Skills from the skills.sh registry. Powered by HAPI MCP server.
AGagentskills/agentskills28k近 7 天新增 208 个 star
The search engine for AI agents: cited answers from your local code, docs, specs and logs.
XExerj-org/xerj23k近 7 天新增 2,746 个 star