MCP server for fetching trading economics calendar events
Project description
Trading Economics Calendar MCP Server
A Model Context Protocol (MCP) server that provides access to economic calendar events from Trading Economics. This server allows you to fetch economic events with various filters including countries, importance levels, and date ranges.
Features
- 📅 Fetch economic calendar events
- 🌍 Filter by major countries
- 📊 Filter by importance level (low, medium, high)
- 📆 Date range filtering
- 🔍 High-impact events filtering
- 🏛️ Country-specific event queries
Installation
From PyPI (when published)
pip install trading-economics-calendar-mcp
From Source
git clone <repository-url>
cd trading-economics-calendar-mcp
pip install -e .
Usage
As MCP Server
Start the server:
trading-economics-mcp
Available Tools
1. Get Economic Events
get_economic_events(
countries=["United States", "Germany"],
importance="high",
start_date="2024-01-01",
end_date="2024-01-31"
)
2. Get Today's Events
get_today_economic_events(
countries=["United States"],
importance="medium"
)
3. Get This Week's Events
get_week_economic_events(
countries=["Japan", "United Kingdom"],
importance="high"
)
4. Get Major Countries
get_major_countries()
# Returns: {"united_states": "United States", "germany": "Germany", ...}
5. Get Importance Levels
get_importance_levels()
# Returns: {"low": 1, "medium": 2, "high": 3}
6. Get High-Impact Events
get_high_impact_events(
countries=["United States", "China"],
start_date="2024-01-01",
end_date="2024-01-31"
)
7. Get Events by Country
get_events_by_country(
country="United States",
start_date="2024-01-01",
end_date="2024-01-07",
importance="high"
)
Supported Countries
The server supports filtering by major economies:
- United States
- China
- Japan
- Germany
- United Kingdom
- France
- Italy
- Canada
- Australia
- Brazil
- India
- Russia
- South Korea
- Spain
- Mexico
- Netherlands
- Switzerland
- Belgium
- Sweden
- Austria
Response Format
Each economic event returns the following structure:
{
"date": "2024-01-15",
"time": "08:30",
"country": "United States",
"event": "Retail Sales",
"importance": 3,
"actual": "0.6%",
"forecast": "0.4%",
"previous": "0.3%"
}
Configuration
The server uses the following default settings:
- Base URL:
https://tradingeconomics.com - Request timeout: 30 seconds
- User agent: Modern browser string
Error Handling
The server includes comprehensive error handling:
- Network timeouts
- Invalid response parsing
- Missing data fields
- Rate limiting (when applicable)
Development
Setup Development Environment
git clone <repository-url>
cd trading-economics-calendar-mcp
pip install -e ".[dev]"
Run Tests
pytest
Code Formatting
black trading_economics_calendar/
flake8 trading_economics_calendar/
mypy trading_economics_calendar/
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request
License
MIT License - see LICENSE file for details.
Disclaimer
This tool fetches publicly available data from Trading Economics. Please respect their terms of service and rate limits. This tool is for educational and research purposes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trading_economics_calendar_mcp-0.1.0.tar.gz.
File metadata
- Download URL: trading_economics_calendar_mcp-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc1a5168f070f8f8a52847d21cb7eda8396a694f4b6988923f7944a3dc0efa1f
|
|
| MD5 |
4d502cd14359bbd8f20ff0c5da8c22a6
|
|
| BLAKE2b-256 |
d3407e8adcf6196ca3c4071b54358dd662e3ee37d64c8eda65cee8ec83dd2c3e
|
File details
Details for the file trading_economics_calendar_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trading_economics_calendar_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bebdcc5bd247010adafe78047ac2b72b39d125f01b87f0cc43e975655f8835e6
|
|
| MD5 |
61d075de85a3368295e438d7d281704c
|
|
| BLAKE2b-256 |
ecd20e29b79cd5af7e429eaa28aa263b23a6d414be7d596d4046a21929d7e750
|