The ForexFactory MCP Server provides programmatic access to economic calendar data from ForexFactory for trading assistants, LLMs, and agentic workflows.
Tools: Retrieve economic calendar events using ffcal_get_calendar_events for predefined periods (today, tomorrow, yesterday, this_week, next_week, last_week, this_month, next_month, last_month) or custom date ranges, returning JSON-formatted data.
Resources: Subscribe to calendar events via MCP endpoints for today (ffcal://events/today), the current week (ffcal://events/week), or custom date ranges (ffcal://events/range/{start}/{end}).
Prompts: Generate AI-ready trading intelligence including daily prep notes, weekly outlooks, volatility grids, and trade scenario maps. Output format is customizable via a style parameter (bullet points, tables, etc.).
Integration: Compatible with MCP clients including LangChain, n8n, Python applications, and MCP CLI. Supports multiple transport modes (stdio, HTTP, SSE) and Docker-ready deployment for flexible integration scenarios.
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
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ForexFactory MCP Servershow me today's economic events"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π 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.
forexfactory-mcp/
βββ src/forexfactory_mcp/ # Main package
β βββ models/ # Schemas & enums
β βββ services/ # Scraper + data normalization
β βββ tools/ # MCP tool definitions
β βββ resources/ # MCP resource definitions
β βββ prompts/ # Prompt templates (optional MCP prompts)
β βββ utils/ # Shared helpers & config
β βββ server.py # FastMCP server entrypoint
β
βββ examples/ # Example clients
βββ tests/ # Unit tests
βββ .env.example # Copy to .env for config
βββ pyproject.toml # Dependencies & metadata
βββ README.md # Documentation
βββ .python-version # Python version pin (3.12)(See repo for full details β this is a high-level layout for contributors.)
π§ Installation
Requirements
Python 3.12+
uv or pip
A modern terminal or MCP-compatible client
Setup
# Clone repo
git clone https://github.com/kjpou1/forexfactory-mcp.git
cd forexfactory-mcp
# Install dependencies
uv sync # or: pip install -e .
# Copy example environment and adjust if needed
cp .env.example .envβΆοΈ Usage
β‘ Quickstart
Start the server with default settings (stdio transport):
uv run ffcal-serverRun with HTTP transport:
uv run ffcal-server --transport http --host 0.0.0.0 --port 8080SSE transport (β οΈ deprecated)
uv run ffcal-server --transport sse --host 127.0.0.1 --port 8001Environment variable defaults
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080π·οΈ Namespace
Default namespace:
ffcalOverride via .env:
NAMESPACE=ffcalπ¦ Resources
Name | Path | Description |
|
| Today's events |
|
| All events this week |
|
| Custom date range |
π οΈ Tools
Name | Type | Description |
| Tool | Retrieve events for a given period |
Supported values:
today, tomorrow, yesterday, this_week, next_week, last_week, this_month, next_month, last_month, customπ Prompts
Name | Description |
| Trader prep note for today |
| Weekly macro event summary |
| Weekly event-risk heatmap |
| Scenario map for specific events |
π§© Prompt Styles
All prompts support a style parameter to control formatting.
Default:
style: str = "bullet points"See the Output Style Reference for available formats.
π» Client Examples
Example: Using MCP CLI
mcp call ffcal:get_calendar_events time_period=this_weekExample: Using in Python
from mcp.client.session import Session
async with Session("ws://localhost:8000") as session:
result = await session.call_tool("ffcal:get_calendar_events", {"time_period": "today"})
print(result)Example: LangChain Integration
from langchain.agents import initialize_agent
from langchain_mcp import MCPToolkit
toolkit = MCPToolkit.from_server_url("ws://localhost:8000", namespace="ffcal")
agent = initialize_agent(toolkit.tools)
response = agent.run("What are today's USD-related high impact events?")
print(response)π Client Configuration Reference
Includes:
β Example configs for Claude Desktop (local + Docker)
π³ Docker build and setup
π§© VS Code MCP integration (future)
π§ͺ Testing + troubleshooting checklist
π Inspector setup for visual debugging
βοΈ Configuration
Variable | Default | Description |
|
| Namespace prefix |
|
| Transport type ( |
|
| Host for HTTP/SSE |
|
| Port for HTTP/SSE |
|
| Playwright timeout |
| System local | Timezone override |
Example .env
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080
NAMESPACE=ffcalπ³ Docker Integration
Supports both stdio (default) and HTTP/SSE.
docker compose build
docker compose up forexfactory_mcpRuns MCP server and exposes it on port 8000.
Target | Description |
| Build Docker image |
| Run server in HTTP mode |
| Run in stdio mode |
| Inspect via MCP Inspector |
| Stop containers |
π 1. uv or dependency install fails
Run:
docker compose build --no-cache forexfactory_mcpβ‘ 2. Server exits immediately
Switch to:
make run-httpπ 3. Port in use
Change port:
docker compose run --rm -e MCP_PORT=8080 forexfactory_mcpπ 4. Browser fails
Install Chromium:
docker compose run forexfactory_mcp playwright install chromiumπ§ͺ Testing
pytest -vπ Roadmap
Event filters by currency and impact
Historical backfill
MCP prompt expansions
Cloud-ready deployment
π€ Contributing
Fork the repo
Create a feature branch
Commit with a clear message
Push and open a PR
π License
MIT License β see LICENSE for details.
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.