Skip to main content
Glama
nyt-mcp

nyt-mcp

by joe5saia

nyt-mcp

MCP server for the New York Times APIs.

Tools

Tool

NYT API

Description

search_articles

Article Search

Search by keyword with Lucene filters, date ranges, pagination

get_top_stories

Top Stories

Current top stories by section (home, world, science, …)

get_most_popular

Most Popular

Most emailed / shared / viewed articles (1, 7, or 30 days)

get_newswire

Times Newswire

Live stream of just-published articles

get_bestsellers

Books

NYT Best Sellers lists (hardcover-fiction, etc.)

get_archive

Archive

Article metadata for any month back to 1851

read_article

(scrape)

Fetch and extract the full text of an NYT article URL

Related MCP server: Times Newswire API MCP Server

Setup

  1. Get an API key at https://developer.nytimes.com/get-started.

  2. Set the API_KEY environment variable (or create a .env file):

    export API_KEY=your-nyt-api-key

Installation

No installation needed — just run with uvx:

# From PyPI (after publishing)
uvx nyt-mcp

# From GitHub
uvx --from git+https://github.com/joe5saia/nyt-mcp nyt-mcp

Or install permanently:

uv tool install nyt-mcp
# or from GitHub:
uv tool install git+https://github.com/joe5saia/nyt-mcp

Running as an MCP Server

Claude Code

claude mcp add nyt-mcp -- uvx nyt-mcp

Amp

Add to your MCP config (e.g. ~/.config/amp/settings.json):

{
  "mcpServers": {
    "nyt-mcp": {
      "command": "uvx",
      "args": ["nyt-mcp"],
      "env": {
        "API_KEY": "your-nyt-api-key"
      }
    }
  }
}

Standalone (stdio)

API_KEY=your-key uvx nyt-mcp

Development

uv run ruff check src/ tests/   # lint
uv run ruff format src/ tests/  # format
uv run ty check src/             # type check
uv run pytest tests/ -v          # test

Available Tools

6 tools
get_archiveB

Get article metadata from the NYT Archive for a given month.

Results are capped at 50 articles to keep context manageable.

Args: ctx: MCP context (injected automatically). year: Year (>= 1851). month: Month (1-12).

Returns: Formatted list of archived articles.

Inputs: ctx (required), year (required), month (required). Returns: result

get_bestsellersA

Get the NYT Best Sellers list.

Args: ctx: MCP context (injected automatically). list_name: List slug (e.g. 'hardcover-fiction', 'paperback-nonfiction'). date: Published date (YYYY-MM-DD) or 'current' for the latest.

Returns: Formatted best-seller list.

Inputs: ctx (required), date, list_name. Returns: result

get_newswireB

Get the latest articles from the Times Newswire (live stream).

Args: ctx: MCP context (injected automatically). source: Content source - 'all', 'nyt', or 'inyt'. section: Section name, or 'all' for everything.

Returns: Formatted list of recent articles.

Inputs: ctx (required), source, section. Returns: result

get_top_storiesC

Get the current top stories for a given NYT section.

Args: ctx: MCP context (injected automatically). section: Section name (e.g. 'home', 'world', 'science', 'politics').

Returns: Formatted list of top stories.

Inputs: ctx (required), section. Returns: result

search_articlesA

Search NYT articles by keyword and optional filters.

Args: ctx: MCP context (injected automatically). query: Search query string. filter_query: Lucene-syntax filter (e.g. 'section.name:"Books"'). begin_date: Start date in YYYYMMDD format. end_date: End date in YYYYMMDD format. sort: Sort order - 'newest', 'oldest', or 'relevance'. page: Page number (0-indexed, max 100).

Returns: Formatted search results.

Inputs: ctx (required), query (required), page, sort, +3 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool maps to a distinct NYT data source (search, top stories, most popular, newswire, bestsellers, archive), so boundaries are largely clear. The only mild overlap is among search_articles, get_top_stories, and get_newswire, which all return article lists but are distinguished by source semantics.

    Naming Consistency5/5

    Five tools use a clean get_<noun> pattern (get_top_stories, get_most_popular, get_newswire, get_bestsellers, get_archive), and search_articles is a sensible, readable variation on the verb for a query operation. The convention is predictable throughout.

    Tool Count5/5

    Six tools is well-scoped for the NYT API surface, with each tool earning its place by covering a distinct endpoint-like capability. No redundant or filler tools.

    Completeness4/5

    The set covers the major NYT read paths: keyword search, curated stories, popularity, newswire, bestsellers, and historical archive. Minor gaps exist (e.g., no single-article fetch by URL/ID, no byline/review endpoints), but core discovery workflows are fully served.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers