Skip to main content

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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run the test suite
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trading_economics_calendar_mcp-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file trading_economics_calendar_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for trading_economics_calendar_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc1a5168f070f8f8a52847d21cb7eda8396a694f4b6988923f7944a3dc0efa1f
MD5 4d502cd14359bbd8f20ff0c5da8c22a6
BLAKE2b-256 d3407e8adcf6196ca3c4071b54358dd662e3ee37d64c8eda65cee8ec83dd2c3e

See more details on using hashes here.

File details

Details for the file trading_economics_calendar_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trading_economics_calendar_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bebdcc5bd247010adafe78047ac2b72b39d125f01b87f0cc43e975655f8835e6
MD5 61d075de85a3368295e438d7d281704c
BLAKE2b-256 ecd20e29b79cd5af7e429eaa28aa263b23a6d414be7d596d4046a21929d7e750

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page