bing-news-mcp-server
v1.0.0
Published
A streamable HTTP MCP server for fetching Bing news data
Maintainers
Readme
📰 Bing News MCP Server
A powerful Model Context Protocol (MCP) server that provides seamless access to Bing News data through a streamable HTTP interface. Perfect for AI applications, chatbots, and news aggregation services.
✨ Features
- 🔍 Smart News Search - Search Bing News with advanced filtering options
- 🔥 Trending News - Get the hottest news stories across different categories
- 🌐 Multi-language Support - Support for different markets and languages
- ⚡ Streamable HTTP Protocol - Modern MCP implementation with HTTP transport
- 🛡️ Robust Error Handling - Comprehensive error handling and validation
- 📱 Responsive Design - Clean, formatted output perfect for AI consumption
🚀 Quick Start
Installation
npm install bing-news-mcp-serverRunning the Server
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm startThe server will start on http://localhost:3000 with the MCP endpoint at /mcp.
Health Check
Visit http://localhost:3000/health to verify the server is running properly.
🔧 Configuration
Client Configuration
Add this to your MCP client configuration (e.g., mcp.json):
{
"mcpServers": {
"bing-news": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"timeout": 600
}
}
}Using with Gateway (Optional)
For production deployments, you can use the SuperGateway:
npm run start:gatewayThis will proxy the server through http://localhost:3100/mcp.
Custom Headers
If you need authentication or custom headers:
{
"mcpServers": {
"bing-news": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"timeout": 600,
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"X-API-Key": "your-api-key"
}
}
}
}🛠️ Available Tools
1. Bing News Search (bing_news_search)
Search for specific news articles based on your query.
Parameters:
query(required): Search terms for news articlescount(optional): Number of articles to return (1-50, default: 10)freshness(optional): Time filter - "Day", "Week", "Month" (default: "Week")market(optional): Market/region code (default: "en-US")
Example:
{
"query": "artificial intelligence breakthrough",
"count": 15,
"freshness": "Day",
"market": "en-US"
}2. Trending News (bing_news_trending)
Get the most popular and trending news stories.
Parameters:
category(optional): News category - "all", "world", "business", "technology", "entertainment", "sports", "science", "health" (default: "all")count(optional): Number of articles to return (1-50, default: 15)market(optional): Market/region code (default: "en-US")
Example:
{
"category": "technology",
"count": 20,
"market": "en-US"
}📊 Response Format
Both tools return structured news data including:
- Title - Article headline
- URL - Direct link to the full article
- Snippet - Brief article summary
- Source - News publisher
- Published Date - When the article was published
- Image URL - Article thumbnail (when available)
- Category - News category (for trending news)
🏗️ Development
Project Structure
src/
├── index.ts # Main MCP server entry point
└── tools/
├── bing-news.ts # News search functionality
└── bing-trending.ts # Trending news functionalityBuilding from Source
# Clone the repository
git clone https://github.com/guangxiangdebizi/bing-news-mcp-server.git
cd bing-news-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devAdding Custom Tools
- Create a new tool file in
src/tools/ - Export a tool object with
name,description,parameters, andrunmethod - Import and register the tool in
src/index.ts
🌍 Supported Markets
The server supports various international markets:
en-US- United States (English)en-GB- United Kingdom (English)zh-CN- China (Chinese Simplified)ja-JP- Japan (Japanese)de-DE- Germany (German)fr-FR- France (French)es-ES- Spain (Spanish)- And many more...
🔒 Security & Best Practices
- The server implements CORS protection
- Request validation and sanitization
- Rate limiting considerations
- Secure header handling
- No sensitive data logging
📈 Performance
- Efficient HTTP client with connection pooling
- Optimized HTML parsing with Cheerio
- Session management for stateless HTTP
- Automatic cleanup of inactive sessions
- Configurable timeouts and limits
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- 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
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
👨💻 Author
Xingyu Chen
- 🌐 LinkedIn: Xingyu Chen
- 📧 Email: [email protected]
- 🐙 GitHub: @guangxiangdebizi
- 📦 NPM: @xingyuchen
🙏 Acknowledgments
- Built with the Model Context Protocol SDK
- Powered by Express.js and Cheerio
- News data sourced from Bing News
⭐ Star this repository if you find it helpful! ⭐
