Guide · Amazon Forecast · Dataset Groups & Pipeline Overview

Amazon Forecast for MCP Servers — Time-Series Forecasting Pipeline, Dataset Groups, and SDK Setup

Amazon Forecast is AWS's fully managed time-series forecasting service. It trains machine learning models on your historical data and returns probabilistic forecasts — not just a point estimate, but a full distribution across p10, p50, and p90 quantiles. For MCP server teams, Forecast enables tools that predict request volume, anticipate endpoint downtime windows, project resource demand, and surface leading indicators before incidents occur. This overview covers the two-package SDK split, the five-stage pipeline (dataset group → datasets → predictor → forecast → query), and the domain types that determine which additional signals Forecast adds automatically.

TL;DR

Amazon Forecast uses two npm packages: @aws-sdk/client-forecast for the management plane (create resources, train models, generate forecasts) and @aws-sdk/client-forecastquery for the query plane (read forecast values at runtime). The pipeline is linear: create a dataset group → create one or more datasets and import data → create an AutoPredictor → create a forecast → query the forecast. Training takes 20–90 minutes; query calls complete in under 100 ms. Schema attribute names are lowercase (item_id, timestamp, target_value) — a common gotcha if you're used to Personalize's uppercase schema fields.

Why MCP servers benefit from time-series forecasting

Most MCP monitoring tools are reactive — they alert when something has already gone wrong. Amazon Forecast adds a predictive layer: by training on historical endpoint health, request rates, and error patterns, your MCP server tools can answer questions like:

Forecast runs entirely within your AWS account. All training data stays in your S3 bucket; IAM boundaries control access; VPC endpoints eliminate public network exposure for inference calls.

Two SDK packages, two planes

Install both before starting:

npm install @aws-sdk/client-forecast @aws-sdk/client-forecastquery

The management client handles resource lifecycle — creating datasets, training predictors, generating forecast objects:

import { ForecastClient } from "@aws-sdk/client-forecast";

const forecast = new ForecastClient({ region: "us-east-1" });

The query client reads forecast values at runtime — it has its own endpoint and its own IAM action namespace:

import { ForecastQueryClient } from "@aws-sdk/client-forecastquery";

const forecastQuery = new ForecastQueryClient({ region: "us-east-1" });

The management endpoint is forecast.us-east-1.amazonaws.com; the query endpoint is forecastquery.us-east-1.amazonaws.com. Separate IAM roles are appropriate: a provisioning role with forecast:Create* permissions for setup, and an inference role with only forecast:QueryForecast for the MCP server's runtime calls.

The five-stage pipeline

Every Forecast workflow follows the same sequence. Each stage produces an ARN that the next stage references:

  1. Dataset group — the top-level container. Selects the domain and ties all datasets, predictors, and forecasts together.
  2. Datasets + import jobs — one to three datasets (target time series, related time series, item metadata). Import jobs pull CSV data from S3.
  3. AutoPredictor (predictor) — the ML model training run. AutoML selects and ensembles the best algorithms. Backtesting metrics (RMSE, WAPE) are available after training completes.
  4. Forecast — an artifact that materializes prediction values for all items. Specifying ForecastTypes: ["0.1","0.5","0.9"] at creation requests p10/p50/p90 quantile bands.
  5. Query — runtime calls via QueryForecastCommand that return the forecast values for a specific item_id.

Forecasts are static artifacts — they represent the prediction as of when they were generated. For rolling forecasts, schedule a nightly CreateForecastCommand and swap the ARN your query calls use once the new forecast reaches ACTIVE status.

Creating a dataset group

The dataset group specifies the domain, which determines available built-in signals and schema conventions. For MCP server metrics, CUSTOM or WEB_TRAFFIC are the most appropriate choices:

import { CreateDatasetGroupCommand } from "@aws-sdk/client-forecast";

const { DatasetGroupArn } = await forecast.send(new CreateDatasetGroupCommand({
  DatasetGroupName: "mcp-endpoint-traffic",
  Domain: "CUSTOM",
  // Other domains: "RETAIL" | "INVENTORY_PLANNING" | "EC2_CAPACITY"
  //                "WORK_FORCE" | "WEB_TRAFFIC" | "METRICS"
  Tags: [{ Key: "project", Value: "alivemcp" }],
}));

console.log("Dataset group ARN:", DatasetGroupArn);
// arn:aws:forecast:us-east-1:123456789012:dataset-group/mcp-endpoint-traffic

Dataset groups are immutable after creation — you cannot change the domain. If you need to switch domains, create a new dataset group and re-import all data.

Domain selection reference

DomainBest forBuilt-in signals added
CUSTOMServer metrics, error rates, arbitrary numeric KPIsNone — full control over schema
WEB_TRAFFICRequest-per-minute endpoint traffic, page viewsHoliday calendar (US by default)
METRICSFinancial KPIs, business metrics at high frequencyNone — supports sub-hour frequencies
RETAILE-commerce demand forecastingHoliday calendar + promotions
EC2_CAPACITYAWS compute capacity planningAWS-internal utilization features
INVENTORY_PLANNINGSupply chain inventory levelsNone — specialized schema fields
WORK_FORCEStaffing demandHoliday calendar

For monitoring MCP endpoints on AliveMCP, CUSTOM gives full flexibility: you define the schema, choose which endpoints become item_id values, and decide whether to add weather or calendar signals at the predictor stage without being constrained by a domain's fixed schema.

Dataset types

Within a dataset group, you can register up to three dataset types. Only the target time series is required:

More detail on creating datasets and running import jobs is in the dataset import guide.

Pricing snapshot

ActivityPriceNotes
Dataset import$0.088 / GBBased on raw CSV size in S3
Predictor training$0.24 / hourAutoML trains multiple algorithms in parallel — billed per hour of compute
Forecast generation$1.00 / 1K time stepsSteps = items × horizon length
Forecast query$0.01 / 1K queriesQueryForecastCommand calls
Free tierFirst 10K time steps / monthApplies to both generation and query

For a dataset with 500 MCP endpoints and a 7-day hourly horizon (168 hours), forecast generation costs: 500 items × 168 steps = 84,000 time steps = $0.084. If you regenerate the forecast daily, monthly cost = $0.084 × 30 = $2.52 for generation, plus $0.01 per 1K queries.

Polling for resource readiness

All Forecast resources are created asynchronously. The pattern across all stages is identical — poll Describe*Command until Status === "ACTIVE":

import { DescribeDatasetGroupCommand } from "@aws-sdk/client-forecast";

async function waitForActive(arn, describeCmd, getStatus) {
  while (true) {
    const result = await forecast.send(describeCmd(arn));
    const status = getStatus(result);
    if (status === "ACTIVE") return result;
    if (status.endsWith("FAILED")) throw new Error(`Resource failed: ${JSON.stringify(result)}`);
    await new Promise(r => setTimeout(r, 30_000)); // 30s poll interval
  }
}

// Example: wait for dataset group
await waitForActive(
  DatasetGroupArn,
  (arn) => new DescribeDatasetGroupCommand({ DatasetGroupArn: arn }),
  (r) => r.Status
);

Use the same helper for DescribeDatasetImportJobCommand, DescribeAutoPredictorCommand, and DescribeForecastCommand. Polling at 30-second intervals is safe for all stages — predictor training takes 20–90 minutes, so aggressive polling wastes API quota without accelerating completion.

Key gotchas at a glance

Continue in this series

Related monitoring guides: CloudWatch metrics for MCP servers · SageMaker endpoints with MCP servers · Prometheus for MCP server observability