FinanceNews MCP
Enables AI assistants to search and retrieve real-time financial news from Finnhub via natural language queries.
README
📰 FinanceNews MCP
A Model Context Protocol (MCP) server that provides financial news search capabilities. This server enables AI assistants to fetch and analyze financial news from various sources based on user queries.
✨ Features
- 🔍 Smart News Search: Query financial news with natural language
- 📊 Real-time Updates: Get the latest financial news and market updates
- 🌐 Finnhub Integration: Fetches real-time news from Finnhub financial data platform (no fake data)
- 🚀 High Performance: Built with TypeScript and Express for optimal performance
- 🔧 Easy Integration: Simple MCP protocol implementation
🛠️ Installation
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Install from npm
npm install -g financenews-mcp
Install from source
git clone https://github.com/guangxiangdebizi/FinanceNews-MCP.git
cd FinanceNews-MCP
npm install
npm run build
🚀 Quick Start
1. Start the MCP Server
# Using npm global install
financenews-mcp
# Or from source
npm run start:http
The server will start on http://localhost:3000 by default.
2. Configure Your AI Client
Add the following configuration to your MCP client (e.g., Claude Desktop):
{
"mcpServers": {
"financenews-mcp": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"timeout": 600
}
}
}
3. Start Using
Once configured, you can ask your AI assistant to search for financial news:
- "Search for Apple earnings news"
- "Find news about Federal Reserve interest rates"
- "Get cryptocurrency market updates"
🔧 Available Tools
get_financial_news
Fetches financial news based on a search query.
Parameters:
query(string, required): Search query for financial news topics
Example Usage:
{
"name": "get_financial_news",
"arguments": {
"query": "Tesla stock earnings"
}
}
📡 API Endpoints
- MCP Endpoint:
POST /mcp- Main MCP protocol endpoint - Health Check:
GET /health- Server health status
🔧 Configuration
Environment Variables
Create a .env file in the project root:
# Server Configuration
PORT=3000
NODE_ENV=development
# API Keys (for production use)
# NEWS_API_KEY=your_news_api_key
# ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
# Cache Configuration
CACHE_TTL_SECONDS=300
# Logging
LOG_LEVEL=info
Custom Port
PORT=8080 npm run start:http
🔑 Finnhub API Configuration
Getting Your Finnhub API Key
To fetch real financial news, you need to configure a Finnhub API key:
- Finnhub (finnhub.io)
- Free tier: 60 requests/minute
- Sign up at: https://finnhub.io/register
- Get your API key from the dashboard after registration
Configuration Options
You have two ways to configure your Finnhub API key:
Option 1: Environment Variable (Recommended for personal use)
- Copy the environment template:
cp env-example.txt .env
- Edit the
.envfile and add your Finnhub API key:
FINNHUB_API_KEY=your_actual_finnhub_key
Option 2: MCP Headers (Recommended for shared/team use)
Add headers directly to your MCP client configuration. This is useful when you want different API keys for different clients or when you can't modify environment variables.
Claude Desktop Configuration:
{
"mcpServers": {
"financenews-mcp": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"headers": {
"X-Finnhub-API-Key": "your_actual_finnhub_key"
}
}
}
}
Supported Header Names:
X-Finnhub-API-Key(recommended)X-API-KeyAuthorization: Bearer your_key(standard Bearer token format)
Error Handling
- API Key Missing: If no Finnhub API key is configured, the tool will display clear instructions on how to obtain and configure the API key
- No Results: If Finnhub API doesn't return any results for your query, the tool will suggest alternative search terms
- Network Errors: Any network or API errors will be clearly communicated with helpful troubleshooting information
The tool does not use sample or fake data - it only returns real news from Finnhub or clear error messages.
🏗️ Development
Setup Development Environment
git clone https://github.com/guangxiangdebizi/FinanceNews-MCP.git
cd FinanceNews-MCP
npm install
cp .env.example .env
Development Scripts
# Build the project
npm run build
# Start development server
npm run dev
# Start production server
npm run start:http
# Clean build directory
npm run clean
Project Structure
src/
├── index.ts # MCP server main entry point
└── tools/
└── financial-news.ts # Financial news search tool
🔌 Integration Examples
Claude Desktop
- Open Claude Desktop settings
- Navigate to "Developer" tab
- Add the MCP server configuration:
{
"mcpServers": {
"financenews-mcp": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"headers": {
"X-Finnhub-API-Key": "your_actual_finnhub_key"
}
}
}
}
Custom Headers (Optional)
For authentication or tenant identification:
{
"mcpServers": {
"financenews-mcp": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"X-Tenant-Id": "your_tenant_id"
}
}
}
}
📊 Production Deployment
Docker
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY build/ ./build/
EXPOSE 3000
CMD ["npm", "run", "start:http"]
PM2
npm install -g pm2
pm2 start build/index.js --name "financenews-mcp"
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
👨💻 Author
Xingyu Chen
- 📧 Email: guangxiangdebizi@gmail.com
- 🔗 LinkedIn: Xingyu Chen
- 🐙 GitHub: @guangxiangdebizi
- 📦 NPM: @xingyuchen
🙏 Acknowledgments
- Model Context Protocol for the excellent protocol specification
- Anthropic for Claude and MCP development
- The open-source community for inspiration and contributions
📈 Roadmap
- [ ] Real-time news API integrations
- [ ] Advanced filtering and categorization
- [ ] Sentiment analysis for news articles
- [ ] Historical news data access
- [ ] Multi-language support
- [ ] News summarization capabilities
<div align="center"> <p>Made with ❤️ by <a href="https://github.com/guangxiangdebizi">Xingyu Chen</a></p> <p>⭐ Star this repo if you find it helpful!</p> </div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。