MCP Server

Connect AI assistants and MCP clients directly to the News API calendar and backtesting endpoints.

Overview

Connect your MCP client to:

https://www.jblanked.com/news/api/mcp

You do not need to install or run a separate server. Every request is made with your own API key, so your existing permissions, rate limits, and usage charges apply.

Connecting

Point any MCP client that supports remote Streamable HTTP servers at the endpoint. Example client configuration (syntax varies by client):

{
  "mcpServers": {
    "jblanked-news": {
      "url": "https://www.jblanked.com/news/api/mcp",
      "headers": {
        "Authorization": "Api-Key YOUR_API_KEY"
      }
    }
  }
}

Authentication

  1. Get your API key from the API key page.
  2. Send it on every request in the Authorization header as Api-Key YOUR_API_KEY (Bearer is also accepted).

The server validates your key and forwards it to the News API, so usage is billed to your account exactly like direct REST calls. Requests without a valid key receive 401 Unauthorized.

Available Tools

ToolDescription
get_calendar Calendar events for a source (mql5, forex-factory, fxstreet) and period (today, week, month, year, or range with start/end dates), with optional currency, impact, and offset filters.
list_backtesting_events List available backtesting events for a source.
get_backtesting_full_list Full backtesting event data, including histories; optionally for one currency.
get_backtesting_event Basic backtesting details for one event.
get_backtesting_event_history Historical actual, forecast, previous, and outcome values for an event.
get_backtesting_event_full Full event details, including available analysis and machine-learning data.
get_mql5_machine_learning Machine-learning predictions for one MQL5 event.
get_mql5_smart_analysis Smart-analysis results for one MQL5 event.

Python Example

Fetch today's Forex Factory calendar with the official MCP Python client (pip install mcp httpx).

import asyncio
import json
import sys

import httpx
from mcp import ClientSession
from mcp.shared.exceptions import MCPError
from mcp.client.streamable_http import streamable_http_client

MCP_URL = "https://www.jblanked.com/news/api/mcp/"
MAX_ERROR_BODY_CHARS = 4000
API_KEY = "YOUR_API_KEY"


async def main():
    """Main function to initialize the MCP session and get today's calendar."""
    headers = {"Authorization": f"Api-Key {API_KEY}"}

    async with httpx.AsyncClient(headers=headers) as http_client:
        async with streamable_http_client(MCP_URL, http_client=http_client) as (
            read_stream,
            write_stream,
        ):
            async with ClientSession(read_stream, write_stream) as session:
                print("Initializing MCP session...", file=sys.stderr)
                try:
                    await session.initialize()
                except MCPError:
                    print("Double-check your API key and try again.")
                    return

                print(
                    "MCP ready. Getting today's calendar...",
                    file=sys.stderr,
                )

                result = await session.call_tool(
                    "get_calendar",
                    arguments={
                        "source": "forex-factory",
                        "period": "today",
                    },
                )

                if result.is_error:
                    details = "\n".join(
                        item.text
                        for item in result.content
                        if getattr(item, "text", None)
                    )
                    print(
                        f"get_calendar returned an error: {details or 'No details provided.'}",
                        file=sys.stderr,
                    )
                    return

                if not result.content:
                    print("No events returned.")
                    return

                for item in result.content:
                    text = getattr(item, "text", None)
                    if text is None:
                        print(item)
                        continue

                    try:
                        data = json.loads(text)
                    except json.JSONDecodeError:
                        print(text)
                    else:
                        print(json.dumps(data, indent=2, ensure_ascii=False))


asyncio.run(main())

Tip: calendar endpoints can be slow on first fetch while data is collected. If your client times out, raise the httpx timeout, e.g. httpx.AsyncClient(headers=headers, timeout=httpx.Timeout(60.0, connect=10.0)).

Support