slekrem/MacroPulseMCP
If you are the rightful owner of MacroPulseMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
MacroPulseMCP is a comprehensive Model Context Protocol (MCP) server that provides access to Trading Economics data through standardized tools.
MacroPulseMCP
A comprehensive Model Context Protocol (MCP) server that provides access to Trading Economics data through standardized tools. This server exposes economic indicators, market data, forecasts, news, and more through MCP-compatible interfaces.
Features
MacroPulseMCP provides 13 comprehensive tool categories covering all major Trading Economics API endpoints:
High Priority Tools
- IndicatorsTools - Economic indicators (GDP, inflation, unemployment, etc.)
- CalendarTools - Economic calendar events and releases
- MarketsTools - Real-time market data (stocks, commodities, currencies, bonds)
- ForecastsTools - Economic forecasts and projections
- NewsTools - Economic and financial news
Medium Priority Tools
- MarketsHistoricalTools - Historical market price data
- EarningsTools - Corporate earnings calendar and data
- FederalReserveTools - US Federal Reserve economic data (FRED)
- LatestUpdatesTools - Recently updated data tracking
Specialized Tools
- RatingsTools - Credit ratings (sovereign and corporate)
- ComtradeTools - International trade statistics
- WorldBankTools - World Bank development indicators
- MarketsIntradayTools - Real-time intraday trading data
Installation
Prerequisites
- .NET 9.0 or later
- Trading Economics API key
Setup
- Clone the repository:
git clone https://github.com/slekrem/MacroPulseMCP.git
cd MacroPulseMCP
- Build the project:
dotnet build
- Configure your API key in
appsettings.json:
{
"TradingEconomics": {
"ApiKey": "guest:guest"
}
}
Usage
Running the MCP Server
dotnet run --project MacroPulseMCP
The server runs via stdio transport and automatically exposes all available tools.
Available Tools
Each tool category provides multiple methods for accessing specific data:
Economic Indicators
Get_all_indicators()- All economic indicatorsGet_indicators_by_country(country)- Indicators for specific countryGet_indicator_all_countries(indicator)- Specific indicator for all countriesGet_historical_indicators(countries, indicators, startDate?, endDate?)- Historical data
Economic Calendar
Get_all_calendar_events()- All calendar eventsGet_calendar_events_by_date(startDate, endDate)- Events by date rangeGet_calendar_events_by_countries(countries)- Events by countryGet_calendar_events_by_indicator(indicators)- Events by indicator
Markets
Get_commodities()- Commodities pricesGet_currency()- Currency exchange ratesGet_market_indices()- Stock market indicesGet_bonds()- Bond market dataGet_market_by_symbols(symbols)- Data for specific symbols
Forecasts
Get_forecast_by_country(country)- Forecasts by countryGet_forecasts_by_indicators(indicators)- Forecasts by indicatorGet_forecasts_by_countries_and_indicators(countries, indicators)- Combined forecasts
News
Get_latest_news()- Latest economic newsGet_news_by_country(countries)- News by countryGet_news_by_indicator(indicators)- News by indicator
API Key
You can use the default test key guest:guest for testing, but it has limitations. For production use, obtain your own API key from Trading Economics.
Architecture
The server is built using:
- .NET 9.0 - Runtime platform
- ModelContextProtocol - MCP server framework
- Microsoft.Extensions.Hosting - Application hosting
- Dependency Injection - Service management
Key Components
ITradingEconomicsService- HTTP client abstraction for API callsTradingEconomicsService- Implementation with authenticationMacroPulseMcpOptions- Configuration model for API key- Tool classes with
[McpServerTool]attributes for MCP exposure
Configuration
The server uses standard .NET configuration with support for:
appsettings.json- Base configurationappsettings.{Environment}.json- Environment-specific settings- Environment variables
Configuration Schema
{
"TradingEconomics": {
"ApiKey": "string" // Your Trading Economics API key
}
}
Development
Adding New Tools
- Create a new class in the
Tools/directory - Add
[McpServerToolType]attribute to the class - Add
[McpServerTool]and[Description]attributes to methods - Use dependency injection to access
ITradingEconomicsService
Example:
[McpServerToolType]
public class CustomTools(ITradingEconomicsService service)
{
[McpServerTool, Description("Get custom data.")]
public async Task<string> Get_custom_data(
[Description("Parameter description")] string parameter)
{
return await service.GetData($"custom/{parameter}");
}
}
Building and Testing
# Build the project
dotnet build
# Run the server
dotnet run --project MacroPulseMCP
# Clean build artifacts
dotnet clean
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.