MCP Hub
Back to servers

forexfactory-mcp

An MCP server that exposes ForexFactory economic calendar data as searchable tools and resources for trading assistants and LLM agents.

Stars
1
Forks
1
Tools
1
Updated
Nov 8, 2025
Validated
Jan 11, 2026

๐Ÿ“… ForexFactory MCP Server

Python License MCP uv

Contributions welcome Status PRs Welcome Made with Love

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.

ForexFactory Server MCP server
๐Ÿ“‚ Table of contents (click to expand)

๐Ÿš€ 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 (click to expand)
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-server

Run with HTTP transport:

uv run ffcal-server --transport http --host 0.0.0.0 --port 8080

SSE transport (โš ๏ธ deprecated)

uv run ffcal-server --transport sse --host 127.0.0.1 --port 8001

Environment variable defaults

MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080

๐Ÿท๏ธ Namespace

Default namespace:

ffcal

Override via .env:

NAMESPACE=ffcal

๐Ÿ“ฆ Resources

NamePathDescription
events_todayffcal://events/todayToday's events
events_weekffcal://events/weekAll events this week
events_rangeffcal://events/range/{start}/{end}Custom date range

๐Ÿ› ๏ธ Tools

NameTypeDescription
ffcal_get_calendar_eventsToolRetrieve events for a given period

Supported values:

today, tomorrow, yesterday, this_week, next_week, last_week, this_month, next_month, last_month, custom

๐Ÿ“ Prompts

NameDescription
ffcal_daily_prepTrader prep note for today
ffcal_weekly_outlookWeekly macro event summary
ffcal_volatility_gridWeekly event-risk heatmap
ffcal_trade_map_scenariosScenario 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_week

Example: 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

๐Ÿ“– docs/CLIENT_CONFIG_REFERENCE.md

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 Reference (click to expand)

โš™๏ธ Configuration

VariableDefaultDescription
NAMESPACEffcalNamespace prefix
MCP_TRANSPORTstdioTransport type (stdio, http, sse)
MCP_HOST127.0.0.1Host for HTTP/SSE
MCP_PORT8000Port for HTTP/SSE
SCRAPER_TIMEOUT_MS5000Playwright timeout
LOCAL_TIMEZONESystem localTimezone override

Example .env

MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080
NAMESPACE=ffcal

๐Ÿณ Docker Integration (click to expand)

๐Ÿณ Docker Integration

Supports both stdio (default) and HTTP/SSE.

docker compose build
docker compose up forexfactory_mcp

Runs MCP server and exposes it on port 8000.


๐Ÿงฐ Makefile Targets (click to expand)
TargetDescription
make buildBuild Docker image
make run-httpRun server in HTTP mode
make run-stdioRun in stdio mode
make dev-httpInspect via MCP Inspector
make stopStop containers

๐Ÿงฉ Troubleshooting Docker (click to expand)

๐Ÿ 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 & Roadmap (click to expand)

๐Ÿงช Testing

pytest -v

๐Ÿ“Š Roadmap

  • Event filters by currency and impact
  • Historical backfill
  • MCP prompt expansions
  • Cloud-ready deployment

๐Ÿค Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Commit with a clear message
  4. Push and open a PR

๐Ÿ“œ License

MIT License โ€“ see LICENSE for details.

Reviews

No reviews yet

Sign in to write a review

forexfactory-mcp โ€” MCP Server | MCP Hub