ForexFactory MCP Server
📅 ForexFactory MCP Server
Сервер MCP (Model Context Protocol), который предоставляет данные экономического календаря ForexFactory в качестве ресурсов и инструментов.
Разработан для использования в агентских рабочих процессах, LLM и торговых помощниках.
🚀 Функции
✅ Получение событий экономического календаря по периодам времени (
today,this_week,customи т.д.)✅ Доступ через ресурсы MCP (для доступа по подписке)
✅ Доступ через инструменты MCP (прямые вызовы от клиентов/агентов)
✅ Ответы в формате JSON для легкой интеграции
⚡ Интеграция с LangChain, n8n или любым MCP-совместимым клиентом
📌 Статус разработки
Этот проект активно развивается. Основная функциональность стабильна (получение событий экономического календаря ForexFactory через инструменты и ресурсы MCP), но мы все еще:
Расширяем возможности (промпты, варианты развертывания)
Улучшаем документацию и примеры
Мы приветствуем отзывы и участие в разработке, пока продолжаем развивать экосистему.
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)(Полную информацию см. в репозитории — это высокоуровневая структура для участников разработки.)
Related MCP server: FRED API MCP Server
🔧 Установка
Требования
Python 3.12+
uv или pip
Современный терминал или MCP-совместимый клиент
Настройка
# Clone repo
git clone https://github.com/kjpou1/forexfactory-mcp.git
cd forexfactory-mcp
# Install dependencies
uv sync # or: pip install -e .
# Install Playwright browser binaries
uv run playwright install chromium
# or, if using pip/venv:
playwright install chromium
# Copy example environment and adjust if needed
cp .env.example .env▶️ Использование
⚡ Быстрый старт
Запустите сервер с настройками по умолчанию (транспорт stdio):
uv run ffcal-serverЗапуск с транспортом HTTP:
uv run ffcal-server --transport http --host 0.0.0.0 --port 8080Транспорт SSE (⚠️ устарело)
uv run ffcal-server --transport sse --host 127.0.0.1 --port 8001Значения переменных окружения по умолчанию
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080🏷️ Пространство имен
Пространство имен по умолчанию:
ffcalПереопределение через .env:
NAMESPACE=ffcal📦 Ресурсы
Имя | Путь | Описание |
|
| События на сегодня |
|
| Все события на неделю |
|
| Пользовательский диапазон дат |
🛠️ Инструменты
Имя | Тип | Описание |
| Инструмент | Получить события за указанный период |
Поддерживаемые значения:
today, tomorrow, yesterday, this_week, next_week, last_week, this_month, next_month, last_month, custom📝 Промпты
Имя | Описание |
| Заметка для подготовки трейдера на сегодня |
| Еженедельный обзор макроэкономических событий |
| Тепловая карта рисков событий на неделю |
| Карта сценариев для конкретных событий |
🧩 Стили промптов
Все промпты поддерживают параметр style для управления форматированием.
По умолчанию:
style: str = "bullet points"См. Справочник стилей вывода для доступных форматов.
💻 Примеры клиентов
Пример: Использование MCP CLI
mcp call ffcal:get_calendar_events time_period=this_weekПример: Использование в 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)Пример: Интеграция с LangChain
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)📘 Справочник конфигурации клиента
Включает:
✅ Примеры конфигураций для Claude Desktop (локально + Docker)
🐳 Сборка и настройка Docker
🧩 Интеграция с VS Code MCP (в будущем)
🧪 Чек-лист тестирования и устранения неполадок
🔍 Настройка инспектора для визуальной отладки
⚙️ Конфигурация
Переменная | По умолчанию | Описание |
|
| Префикс пространства имен |
|
| Тип транспорта ( |
|
| Хост для HTTP/SSE |
|
| Порт для HTTP/SSE |
|
| Тайм-аут Playwright |
| Системное локальное | Переопределение часового пояса |
Пример .env
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080
NAMESPACE=ffcal🐳 Интеграция с Docker
Поддерживает как stdio (по умолчанию), так и HTTP/SSE.
docker compose build
docker compose up forexfactory_mcpЗапускает сервер MCP и открывает его на порту 8000.
Цель | Описание |
| Сборка образа Docker |
| Запуск сервера в режиме HTTP |
| Запуск в режиме stdio |
| Проверка через MCP Inspector |
| Остановка контейнеров |
🐍 1. Ошибка установки uv или зависимостей
Запустите:
docker compose build --no-cache forexfactory_mcp⚡ 2. Сервер немедленно завершает работу
Переключитесь на:
make run-http🌐 3. Порт занят
Измените порт:
docker compose run --rm -e MCP_PORT=8080 forexfactory_mcp🔐 4. Ошибка браузера
Установите Chromium:
docker compose run forexfactory_mcp playwright install chromium🧪 Тестирование
pytest -v📊 Дорожная карта
[ ] Фильтры событий по валюте и важности
[ ] Загрузка исторических данных
[ ] Расширение промптов MCP
[ ] Развертывание, готовое к облаку
🤝 Участие в разработке
Сделайте форк репозитория
Создайте ветку для функции
Закоммитьте с понятным сообщением
Отправьте изменения и откройте PR
📜 Лицензия
Лицензия MIT – подробности см. в LICENSE.
Available Tools
1 toolmy-ffcal_get_calendar_eventsC
Retrieve ForexFactory calendar events for a given time period or custom date range.Valid time_period values include: today, tomorrow, yesterday, this_week, next_week, last_week, this_month, next_month, last_month, custom.
| Name | Required | Description | Default |
|---|---|---|---|
| time_period | No | ||
| start_date | No | ||
| end_date | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieval but lacks details on permissions, rate limits, error handling, or response format. For a read operation with zero annotation coverage, this is insufficient to inform the agent adequately.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by parameter details. It is efficient with minimal waste, though it could be slightly more structured by separating usage notes from parameter lists.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema, the description does not need to explain return values. However, with no annotations, 3 parameters, and 0% schema coverage, the description partially compensates by detailing one parameter but leaves gaps in behavioral transparency and parameter semantics, making it minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains the 'time_period' parameter by listing valid values, which adds meaning beyond the schema. However, it does not cover 'start_date' or 'end_date' parameters, leaving two of three parameters undocumented, resulting in a baseline score due to partial compensation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Retrieve') and resource ('ForexFactory calendar events') with scope ('for a given time period or custom date range'), making the purpose specific and understandable. However, since there are no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It only lists valid values for one parameter without explaining usage context or trade-offs, leaving the agent with minimal direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- Changed
my-ffcal_get_calendar_events1 field changed- added
Input schema / titleAdded value: +"get_calendar_eventsArguments"
1 tool update
- First observed
my-ffcal_get_calendar_events
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose: retrieving ForexFactory calendar events.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'my-ffcal_get_calendar_events' follows a verb_noun pattern, which is consistent with itself.
A single tool is generally too few for a server's purpose, as it limits functionality and scope. For a ForexFactory calendar server, one might expect additional tools for filtering, sorting, or managing events, making this count feel thin and under-scoped.
The server only provides retrieval of calendar events, with no tools for creating, updating, deleting, or otherwise managing events. This is a significant gap, as it lacks basic CRUD operations and limits the server's utility to read-only access.
Maintenance
Related MCP Connectors
Macroeconomic and FX time-series data for AI agents: indicators, calendars, COT, forex, commodities.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Scheduled macroeconomic releases from ForexFactory and FXStreet; pay-per-event via Apify.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides access to macroeconomic indicators, FX rates, COT data, commodities, and release calendars through the FXMacroData API for AI agents.830 PyPIMIT
- AlicenseBqualityDmaintenanceIntegrates the FRED (Federal Reserve Economic Data) API with MCP, enabling AI assistants to retrieve economic time series data such as GDP, inflation, and interest rates.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides 10 financial data tools (market data, economic indicators, news, insider trades, and calendars) via a single MCP layer, enabling any MCP-compatible LLM to access diverse financial data through a unified interface.1MIT
- AlicenseNot gradedqualityFmaintenanceProvides macro-economic event data, earnings reports, and market overviews as MCP tools, enabling AI agents to query calendars, check event proximity, and assess trade safety.52 PyPI2MIT