@cyanheads/guardian-mcp-server
Provides tools for searching, browsing, and retrieving full article text from The Guardian's journalism archive (1999–present), including full-text search with filters, single article retrieval, and content browsing by section or tag.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Overview
The Guardian's journalism archive, 1999 to today. Search full text, browse by section or tag, and fetch individual articles.
Tools
Tool | Description |
| Full-text search across The Guardian's archive with optional section, tag, contributor, and date filters |
| Fetch a single Guardian article by ID with body text and metadata |
| Browse by section or tag, or discover available sections and tags, across four modes |
Related MCP server: Guardian News MCP Server
Capability reference
guardian_search_articles tool
querysupportsAND/OR/NOTand quoted phrases. Pass an empty string to search by filters alone. The defaultrelevancesort falls back tonewestfor a blank query, with a notice. You can also selectnewestoroldestexplicitly.Filter by
section,tag,contributor,from_date, orto_date. Bare contributor slugs receive theprofile/prefix. Dates useYYYY-MM-DDand must form a valid range.page_sizeaccepts 1–50 (default 10). Setinclude_body: falseto omit article previews from the request and results. Results includetotal,page,pages,page_size, and the appliedorder_by.Fails with
no_resultswhen no articles match the active filters orinvalid_datefor an invalid date or inverted range.tagaccepts comma (AND), pipe|(OR), hyphen-(NOT), and parentheses, e.g.environment/climate-crisis|environment/flooding. Wrap an OR expression in parentheses when also passingcontributor.
guardian_get_article tool
Pass the exact article
idasarticle_id, or pass an article URL ontheguardian.comorwww.theguardian.com.Returns the complete available body text, contributors, section and pillar metadata, and exact keyword, series, and tone tags usable in search and browse. Includes
first_published_dateandlast_modifiedwhen available. Thepublished_datefield is the Guardian web publication timestamp and can advance for a live blog.Fails with
not_found
guardian_browse_content tool
section_latestrequiressection_idand accepts section, edition, and tag paths.tag_latestrequirestag_id. Both return body previews by default. Setinclude_body: falsefor article metadata only.list_tagsfilters by optionalquery,tag_type, andsection_id.list_sectionsreturns all matching sections and ignorespageandpage_size. Paginated modes acceptpage_sizefrom 1–50 (default 10).Fails with
missing_section_id,missing_tag_id,section_not_found, ortag_not_found.tag_idaccepts the same boolean expressions as search'stag.
All three tools also fail with status-specific HTTP errors. Not retryable: unauthorized (401), access_denied (403), request_rejected (400), validation_failed (422), invalid_request, request_conflict, request_not_found, and api_unsupported (501). Retryable: api_timeout (408/425/504), rate_limited (429), and api_error (other 5xx). Each error carries a recovery hint. Guardian can reject paging past 38,000 results even within the reported page count.
Features
Built 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.
Guardian-specific:
Wraps the Guardian Open Platform API with a free non-commercial developer key
Full body text extraction — HTML stripped, not just headlines or abstracts
Contributor ID discovery via
guardian_browse_contentmodelist_tagswithtag_type=contributorSection and tag taxonomy browsing (
list_sections,list_tags) for filter discovery before searchingDeveloper key limits are up to 1 call per second and 500 calls per day. The server applies no additional throttling.
Agent-friendly output:
Search and article-returning browse modes cap previews at 2,000 words and set
truncated; callguardian_get_articlefor the full textTyped error reasons across all three tools, each paired with a recovery hint
total/page/pageson every paginated response so callers can track result scope
Getting started
Add the following to your MCP client configuration file. Register for a free Guardian Open Platform API key at open-platform.theguardian.com/access.
{
"mcpServers": {
"guardian-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/guardian-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"GUARDIAN_API_KEY": "your-api-key"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"guardian-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/guardian-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"GUARDIAN_API_KEY": "your-api-key"
}
}
}
}Or with Docker:
{
"mcpServers": {
"guardian-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "GUARDIAN_API_KEY=your-api-key",
"ghcr.io/cyanheads/guardian-mcp-server:latest"
]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 GUARDIAN_API_KEY=your-api-key bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.4 or higher (or Node.js v24+).
A free Guardian Open Platform API key — register at open-platform.theguardian.com/access. The non-commercial developer tier is free and instant.
Installation
Clone the repository:
git clone https://github.com/cyanheads/guardian-mcp-server.gitNavigate into the directory:
cd guardian-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# Edit .env and set GUARDIAN_API_KEYConfiguration
Variable | Description | Default |
| Required. Free developer key from open-platform.theguardian.com/access. | — |
| Transport: |
|
| Port for HTTP server. |
|
| HTTP session mode: |
|
| Auth mode: |
|
| Log level (RFC 5424). |
|
| Directory for log files (Node.js only). Relative paths resolve from the server package. |
|
| Log failed tool arguments and results, redacted by key name and capped by |
|
| Storage backend. |
|
| Enable OpenTelemetry instrumentation (spans, metrics, completion logs). |
|
| Base OTLP URL; traces use | — |
| Opt-in OTLP log endpoint, used as-is. | — |
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t guardian-mcp-server .
docker run --rm -e GUARDIAN_API_KEY=your-api-key -p 3010:3010 guardian-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/guardian-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing ( |
| Tool definitions ( |
| Guardian Open Platform API client, normalization, and type definitions. |
| Unit and integration tests. |
| Design document and directory tree. |
Development guide
See CLAUDE.md / AGENTS.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools in the
createApp()toolsarray insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
Powered by The Guardian.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Web search, scraping, RAG answers with citations, and translation as MCP tools.
One MCP URL for web search, page reading, pay-per-result data tools and a browser agent.
Public web tools for agents: product extraction, claim checks, webpage QA and ranked audits.
Search the agentic web. 4,100+ sites, 11 tools incl. check_url + verify_mcp for probe-before-use.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to the complete archives of The Guardian newspaper since 1999, including the full text of 1.9 million articles.1630 npm20MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to search for the latest news articles from The Guardian using keywords and check service status. Provides access to Guardian's news content through their API with configurable result limits.1-
- AlicenseNot gradedqualityCmaintenanceEnables searching and retrieving articles, sections, and tags from The Guardian via the Guardian Open Platform API.83 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to search the web and fetch pages as clean, budget-controlled text through MCP tools.8MIT