The News MCP Server is a smart news search server that automatically switches between multiple news APIs when one reaches its limit, ensuring reliable news fetching without worrying about API limits. It supports multiple free news APIs, tracks quota usage, and works with multiple languages.
# Clone the repository
git clone https://github.com/guangxiangdebizi/news-mcp.git
cd news-mcp
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
Get free API keys from any of these services (more keys provide better reliability):
*Claimed unlimited for free tier
Edit the .env
file and add your API keys:
# Add at least one API key (more is better for reliability)
THE_NEWS_API_KEY=your_api_key_here
NEWSDATA_IO_KEY=your_api_key_here
NEWSAPI_ORG_KEY=your_api_key_here
GNEWS_API_KEY=your_api_key_here
TWINGLY_API_KEY=your_api_key_here
# Build the project
npm run build
# Start the MCP server
npm start
# Or run in development mode
npm run dev
Add to your Claude Desktop configuration:
Stdio Mode (Local Development):
{
"mcpServers": {
"news-mcp": {
"command": "node",
"args": ["path/to/news-mcp/build/index.js"]
}
}
}
SSE Mode (Web Access):
# Start SSE server
npm run sse
{
"mcpServers": {
"news-mcp": {
"type": "sse",
"url": "http://localhost:3100/sse",
"timeout": 600
}
}
}
Search for news articles with automatic API switching.
Parameters:
query
(required): Search keywords or topicslanguage
(optional): Language code (default: "en")limit
(optional): Number of articles (1-10, default: 5)Example:
// Search for technology news
{
"query": "artificial intelligence",
"language": "en",
"limit": 5
}
// Search for Chinese news
{
"query": "科技新闻",
"language": "zh",
"limit": 3
}
The system follows this priority order:
TheNewsAPI (∞) → NewsData.io (200) → NewsAPI.org (100) → GNews (100) → Twingly (50)
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "news-mcp" '{"command":"node","args":["path/to/news-mcp/build/index.js"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"news-mcp": {
"command": "node",
"args": [
"path/to/news-mcp/build/index.js"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"news-mcp": {
"command": "node",
"args": [
"path/to/news-mcp/build/index.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect