Integrates with LangChain agents through MCPToolkit, enabling AI agents to access ForexFactory economic calendar data for trading and financial analysis workflows
Provides MCP-compatible access to ForexFactory economic calendar events for automation workflows and trading pipelines
π ForexFactory MCP Server
An MCP (Model Context Protocol) server that exposes ForexFactory economic calendar data as resources and tools.
Designed for use in agentic workflows, LLMs, and trading assistants.
π Features
β Retrieve economic calendar events by time period (
today
,this_week
,custom
, etc.)β Access via MCP resources (for subscription-style access)
β Access via MCP tools (direct calls from clients/agents)
β JSON-first responses for easy integration
β‘ Integrates with LangChain, n8n, or any MCP-compatible client
π Development Status
This project is actively developed. The core functionality is stable (retrieving ForexFactory economic calendar events via MCP tools and resources), but we are still:
Expanding features (prompts, deployment options)
Improving documentation and examples
We welcome feedback and contributions while we continue building out the ecosystem.
π Project Structure
(See repo for full details β this is a high-level layout for contributors.)
π§ Installation
Requirements
Python 3.12+ (see
.python-version
for exact version)uv or pip
A modern terminal or MCP-compatible client
Setup
βΆοΈ Usage
Start the MCP server
The server will expose MCP resources, prompts, and tools that clients can call.
π·οΈ Namespace
This MCP server registers under the namespace:
You can override this in your .env
file:
All tools and resources are exposed with this prefix.
Examples:
ffcal_get_calendar_events
ffcal:events_week
ffcal:events_today
π¦ Resources
Resources expose economic calendar events for fixed time windows or a custom date range. They are useful for streaming or subscription-based access to calendar data.
Name | Path | Description |
|
| Economic calendar events scheduled for today |
|
| Events from yesterday |
|
| Events scheduled for tomorrow |
|
| All events this week |
|
| Explicit alias for this weekβs events |
|
| All events scheduled for next week |
|
| Events from last week |
|
| All events scheduled for this month |
|
| All events scheduled for next month |
|
| Events from last month |
|
| Custom date range (YYYY-MM-DD to YYYY-MM-DD) |
π οΈ Tools
Tools are direct, parameterized calls that allow you to query economic events dynamically.
Name | Type | Description | Parameters |
| Tool | Retrieve events for a given period |
(str),
(YYYY-MM-DD),
(YYYY-MM-DD) |
Supported time_period
values
When custom
is used, you must also pass start_date
and end_date
.
π Prompts
Unlike resources (which return structured event data) and tools (which query events dynamically), prompts generate structured text outputs β trader notes, playbooks, and scenario analyses β that can be directly integrated into workflows or reports.
All prompt names are prefixed with the configured namespace (default: ffcal_
).
If you override NAMESPACE
in your .env
, replace the prefix accordingly.
Name | Description | Why Use |
| Summarize todayβs calendar into a trader prep note . | Quick morning scan to know which events matter today. |
| Generate an FX daily trading playbook for today. | Structured trade plan aligned with key macro drivers. |
| Summarize upcoming weekβs high-impact events . | Helps prepare positioning for the week ahead. |
| Draft a Sunday note for next weekβs events. | Pre-market research note for weekend review. |
| Cross-asset spillover radar relevant to FX markets. | Highlights risks from equities, bonds, and commodities that may spill into FX. |
| Note on positioning, ETF flows, and options expiries . | Capture sentiment and positioning context beyond the economic calendar. |
| Weekly event-risk heatmap presented as a grid. | Visualize which days/times carry the most volatility risk. |
| Scenario map for a chosen event with trading implications. | Anticipate market reactions and map trade scenarios ahead of the release. |
π» Client Examples
Example: Using MCP CLI
Example: Using in Python
Example: LangChain Integration
βοΈ Configuration
No special config is required, but you may set environment variables.
Variable | Default | Description |
|
| MCP namespace for tools/resources |
|
| Timeout for Playwright (milliseconds) |
| system local (fallback UTC) | Local timezone override (e.g.,
) |
| (empty β default fields) | Comma-separated list of fields to include, or
for all fields |
| (empty β none) | Comma-separated list of fields to exclude (applied after INCLUDE_FIELDS) |
Include/Exclude Fields
You can control which event fields are returned by the MCP server using
INCLUDE_FIELDS
and EXCLUDE_FIELDS
.
Processing Rules
If both are empty β the server returns a default lean set:
id, title, currency, impact, datetime, forecast, previous, actualIf
INCLUDE_FIELDS=*
β all available fields are included.If
INCLUDE_FIELDS
β only the specified fields are included. Example:INCLUDE_FIELDS=id,name,currency,date,forecast,previous,actualIf both β
First, apply
INCLUDE_FIELDS
.Then, remove any fields listed in
EXCLUDE_FIELDS
.
Example Configurations
Supported Fields
Category | Fields |
Identity |
,
,
,
,
,
|
Titles |
,
,
|
Metadata |
,
,
,
|
Links |
,
,
,
,
|
Status Flags |
,
,
,
,
,
,
,
|
Impact |
,
,
,
|
Timing |
,
,
,
|
Values |
,
,
,
,
,
,
|
Display |
,
,
,
,
,
,
,
,
|
Example .env
π§ͺ Testing
π Roadmap
Event filters by currency and impact
Historical event backfill
In-memory caching (to reduce repeated scraping)
Docker container for deployment
MCP prompts for querying events in natural language
π€ Contributing
Fork this repo
Create a feature branch:
git checkout -b feature/my-feature
Commit changes:
git commit -m "Add my feature"
Push branch:
git push origin feature/my-feature
Open a Pull Request
π License
MIT License β see LICENSE for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables access to ForexFactory economic calendar data through MCP resources and tools. Supports retrieving economic events by time periods for integration with trading assistants and agentic workflows.