NYTimes MCP
Provides access to New York Times APIs including article search, real-time news wire, most popular articles, monthly archives, and bestseller lists through 5 specialized tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NYTimes MCP search for recent articles about artificial intelligence"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NYTimes MCP
A FastMCP-based Model Context Protocol (MCP) server that provides access to the New York Times APIs through native MCP tools and resources.
Overview
This MCP server provides 5 specialized tools for accessing various New York Times APIs:
Article Search - Search the NYT article archive
News Wire - Real-time news feed
Most Popular - Most viewed/shared/emailed articles
Archive - Monthly article archives
Bestseller Lists - NYT book bestseller lists
Related MCP server: Real Time News Data MCP Server
Features
Native MCP Protocol: Built with FastMCP for seamless integration with MCP clients
5 Specialized Tools: One tool per NYT API endpoint for maximum flexibility
3 Reference Resources: Discoverable resources for available sections, lists, and API limits
Formatted Responses: Clean, simplified responses for most endpoints
Type-Safe Parameters: Full type validation on all tool parameters
Error Handling: Robust error management with detailed error messages
Requirements
Python 3.13+
NYT API Key (get one at NYT Developer Portal)
uv for package management
Note: if using pip, you should do yourself a favor and do
pip install uv, then feel free to follow the rest of this guide.
Quickest start (Agent MCP settings)
If using Claude Desktop, Claude Code, Gemini CLI, Qwen Code, etc, simply add the following to your MCP settings JSON file, replacing your_api_key_here with your actual NYT API key.
{
"mcpServers": {
"nytimes": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/jeffmm/nytimes-mcp.git",
"nytimes-mcp"
],
"env": {
"NYT_API_KEY": "your_api_key_here"
}
}
}
}Your agent tool should now be able to access the NYTimes MCP server tools.
Quick Start (manual)
1. Clone and Install
git clone https://github.com/your-username/nytimes-mcp.git
cd nytimes-mcp2. Install with uv
uv tool install .3. Configure API Key
Ensure you have your NYT API key in your environment.
export NYT_API_KEY=your_api_key_hereAlternatively, create a .env file:
NYT_API_KEY=your_api_key_here4. Run the Server
Development Mode (with Inspector)
fastmcp dev src/nytimes_mcp/server.py:mcpThis starts the MCP Inspector UI for testing tools interactively.
Production Mode
uvx nytimes-mcpProject Structure
nytimes-mcp/
├── src/
│ └── nytimes_mcp/
│ ├── __init__.py
│ ├── server.py # FastMCP server with tool/resource definitions
│ ├── tools.py # NYT API tool implementations
│ ├── resources.py # MCP resource definitions
│ ├── nyt_client.py # NYT API client logic
│ ├── utils.py # Response formatting utilities
│ └── config.py # Configuration settings
├── .env
├── .gitignore
├── pyproject.toml
├── CLAUDE.md
└── README.mdAvailable MCP Tools
1. search_articles
Search NYT articles by query, date range, and other criteria.
Parameters:
query(string, required): Search querysort(string, optional): "newest" or "oldest" (default: "newest")begin_date(string, optional): Start date in YYYYMMDD formatend_date(string, optional): End date in YYYYMMDD formatpage(int, optional): Page number for pagination
Returns: Formatted response with articles array containing headline, snippet, web_url, and pub_date
2. get_latest_news
Get the latest news items from the NYT news wire.
Parameters:
limit(int, optional): Number of items to return (default: 20)offset(int, optional): Pagination offset (default: 0)source(string, optional): "nyt" or "inyt" (default: "nyt")section(string, optional): relevant section, e.g. "u.s.", "technology" (default: "all")See
nyt://reference/sectionsresource for available sections
Returns: Formatted response with news_items array
3. get_most_popular
Get the most popular NYT articles.
Parameters:
type(string, optional): "viewed", "shared", or "emailed" (default: "viewed")time_period(string, optional): "1", "7", or "30" days (default: "1")See
nyt://reference/popular-typesresource for available options
Returns: Formatted response with articles array
4. get_archive
Get NYT articles from a specific month and year archive.
Parameters:
year(int, optional): Year (default: current year)month(int, optional): Month 1-12 (default: current month)
Returns: Full NYT archive API response (unformatted)
5. get_bestseller_list
Get NYT bestseller lists.
Parameters:
list(string, optional): List name (default: "hardcover-fiction")See
nyt://reference/bestseller-listsresource for available list names
offset(int, optional): Pagination offset (default: 0)
Returns: Full NYT Books API response (unformatted)
Available MCP Resources
Resources provide reference data that can be accessed by MCP clients:
nyt://reference/sections- Available sections for top_storiesnyt://reference/bestseller-lists- Available bestseller list namesnyt://reference/api-limits- NYT API rate limits and usage information
Using with MCP Clients
Claude Desktop (or most other CLI tools)
Add to your MCP configuration JSON:
{
"mcpServers": {
"nytimes": {
"command": "uvx",
"args": ["nytimes-mcp"],
"env": {
"NYT_API_KEY": "your_api_key_here"
}
}
}
}Or if installed locally
{
"mcpServers": {
"nytimes": {
"command": "uvx",
"args": ["nytimes-mcp"],
"env": {
"NYT_API_KEY": "your_api_key_here"
}
}
}
}Development
Install Development Dependencies
uv syncRun Tests
uv run pytestDevelopment Server with Inspector
uv run fastmcp dev src/nytimes_mcp/server.py:mcpThis opens the MCP Inspector for interactive testing.
API Rate Limits
The NYT API has rate limits (approximately 5 requests/minute, 500 requests/day maximum). Use the nyt://reference/api-limits resource to check current limits.
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
License
MIT License
Security Note
Never commit your
.envfileKeep your NYT API key private
Use environment variables for sensitive data
Contact
Create an issue for bug reports or feature requests.
Available Tools
5 toolsget_archiveB
Get New York Times articles from a specific month and year archive.
Args: year: Year (default: current year) month: Month 1-12 (default: current month)
Returns: Full NYT archive API response (unformatted)
Inputs: year, month.
get_bestseller_listA
Get New York Times bestseller lists.
Args: list: List name (e.g., "hardcover-fiction", "hardcover-nonfiction", "paperback-nonfiction") Default is "hardcover-fiction". Use the 'nyt://reference/bestseller-lists' resource for available list names. offset: Pagination offset (default: 0)
Returns: Full NYT Books API response (unformatted)
Inputs: list, offset.
get_latest_newsB
Get the latest news items from the NYT news wire (real-time news feed).
Args: limit: Number of items to return (default: 20) offset: Pagination offset (default: 0) source: News source - "nyt" or "inyt" (default: "nyt") section: News section (default: "all"). e.g. "u.s." or "technology". Use the 'nyt://reference/sections' resource for available section names.
Returns: Formatted response with news_items array containing title, abstract, url, section, subsection, published_date, and byline
Inputs: limit, offset, source, section.
get_most_popularA
Get the most popular New York Times articles.
Args: type: Type of popularity - "viewed", "shared", or "emailed" (default: "viewed") time_period: Time period in days - "1", "7", or "30" (default: "1") Use the 'nyt://reference/popular-types' resource for available options.
Returns: Formatted response with articles array containing title, abstract, url, and published_date
Inputs: popularity_type, time_period.
search_articlesB
Search New York Times articles by query, date range, and other criteria.
Args: query: Search query string sort: Sort order - "newest" or "oldest" (default: "newest") begin_date: Start date in YYYYMMDD format (optional) end_date: End date in YYYYMMDD format (optional) page: Page number for pagination, 0-indexed (optional)
Returns: Formatted response with articles array containing headline, snippet, web_url, and pub_date
Inputs: query (required), sort, begin_date, end_date, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose targeting different NYT data domains: get_archive retrieves historical articles by month/year, get_bestseller_list fetches book rankings, get_latest_news provides real-time news, get_most_popular shows popular articles, and search_articles enables keyword-based searches. There is no overlap or ambiguity between these functions.
All tools follow a consistent verb_noun naming pattern with 'get_' or 'search_' prefixes: get_archive, get_bestseller_list, get_latest_news, get_most_popular, and search_articles. This uniformity makes the tool set predictable and easy to understand.
With 5 tools, this server is well-scoped for accessing NYT content. Each tool serves a distinct and valuable purpose (archives, bestsellers, news, popularity, and search), and there are no redundant or trivial tools. The count is appropriate for the domain.
The tool set covers major NYT content areas comprehensively, including articles (archive, latest, popular, search) and bestsellers. A minor gap is the lack of tools for specific content types like multimedia, comments, or user interactions, but core reading and discovery workflows are fully supported.
Related MCP Connectors
Real-time news search across 500,000+ sources in 60+ languages with sentiment and entities.
Search, filings, sanctions, company, domain, email, SEO and weather tools, paid per call over x402.
Give your AI assistant access to the world’s news. Search articles in any language, track coverage over time, and research companies and events.
News, web search, mail, markets, weather, places, files, calendar, contacts. 67 tools, one endpoint.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceEnables access to comprehensive news data through the Perigon API, including searching for articles, stories, journalists, sources, people, companies, topics, and Wikipedia content with advanced filtering capabilities.6Apache 2.0- AlicenseBqualityDmaintenanceEnables access to real-time news articles through search, topic headlines, full story coverage, and geo-based local news across multiple countries and languages using the Real Time News Data API.7MIT
- AlicenseBqualityDmaintenanceEnables conversational AI to access, analyze, and interact with Associated Press news content through natural language, with 26 tools for search, trends, and content monitoring.2661 npm2MIT
- AlicenseNot gradedqualityCmaintenanceWraps The New York Times Developer APIs, enabling natural language querying of NYT data through the Pipeworx MCP gateway.150 npm1MIT