Provides a unified gateway to NYT APIs with a single endpoint and health checks.
Configuration
View docs{
"mcpServers": {
"aovabo-nyt-mcp-server": {
"command": "python",
"args": [
"src/server.py"
],
"env": {
"MCP_HOST": "0.0.0.0",
"MCP_PORT": "8000",
"NYT_API_KEY": "YOUR_API_KEY"
}
}
}
}You will run a Python-based MCP server that acts as a single gateway to New York Times APIs, simplifying how you query articles, top stories, real-time news, most popular items, archive data, and the Books API from a unified endpoint.
Use a dedicated MCP client to interact with the NYT MCP server through the single /mcp/message endpoint. You send a message that specifies the desired NYT API function (such as article_search or times_wire) along with parameters, and the server returns a clean, formatted response. You can rely on the health endpoint to verify the server is up and ready to serve requests.
Prerequisites you need to meet before starting:
Follow these steps to set up and run the MCP server locally:
git clone https://github.com/your-username/nyt-mcp-server.git
cd nyt-mcp-server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Create environment configuration
cat > .env << 'ENV'
NYT_API_KEY=your_api_key_here
MCP_PORT=8000
MCP_HOST=0.0.0.0
ENV
# Run the server
python src/server.pyThe server expects environment configuration to provide your NYT API key and how the MCP server should bind to network interfaces. Keep your NYT API key private and avoid committing the .env file. Use environment variables for sensitive data.
Main endpoint for all NYT API interactions. You send a structured message describing the desired NYT API operation and parameters, and receive a unified response.
Health check endpoint to verify the MCP server is running and healthy.
Perform a comprehensive search for NYT articles with query, sort, and pagination options.
Retrieve top stories for a specific section.
Receive real-time updates from Times Wire with configurable limits and sources.
Fetch most popular NYT items by type and time period.
Access NYT archive data by year and month.
Query the Books API for lists like hardcover-fiction.