Skip to main content
Glama
S-FM
by S-FM

FAIM MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server that integrates the FAIM time series forecasting SDK with any MCP-compatible AI assistant, enabling AI-powered forecasting capabilities.

NPM Package: @faim-group/mcp

Overview

This MCP server currently exposes two foundation time-series models from the FAIM API for zero-shot forecasting:

  • Chronos2

  • TiRex

Key Features

Two MCP Tools:

  • list_models: Returns available forecasting models and capabilities

  • forecast: Performs point and probabilistic time series forecasting

Flexible Input Formats:

  • 1D arrays: Single univariate time series

  • 3D arrays: batch/sequence/feature format

Probabilistic Forecasting:

  • Point forecasts (single value predictions)

  • Quantile forecasts (confidence intervals)

  • Sample forecasts (distribution samples)

  • Custom quantile levels for risk assessment

Related MCP server: Prometheus MCP Server

Installation

Prerequisites

Remote MCP Server — Useful for Workflow Automation Tools like n8n

The MCP server is deployed remotely.

To use the remote MCP server, send requests to the following endpoint:

https://mcp.faim.it.com

Provide your FAIM API key using Bearer authentication.

Local MCP server

Configure your client to use it directly with npx:

{
  "mcpServers": {
    "faim": {
      "command": "npx",
      "args": ["-y", "@faim-group/mcp"],
      "env": {
        "FAIM_API_KEY": "your-api-key-here"
      }
    }
  }
}

No installation required - npx will automatically download and run the latest version.

Alternatively, if you prefer to install globally first:

npm install -g @faim-group/mcp

Then in config:

{
  "mcpServers": {
    "faim": {
      "command": "faim-mcp",
      "env": {
        "FAIM_API_KEY": "your-api-key-here"
      }
    }
  }
}

Option 2: Clone and Build Locally

# Clone the repository
git clone <repository-url>
cd faim-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run type checker
npm run lint

Then use the local path:

{
  "mcpServers": {
    "faim": {
      "command": "node",
      "args": ["/path/to/faim-mcp/dist/index.js"],
      "env": {
        "FAIM_API_KEY": "your-api-key-here"
      }
    }
  }
}

Examples

n8n Workflow - Demand Forecasting

An example n8n workflow for demand forecasting is available in examples/n8n/demand_forecasting.json. This workflow demonstrates how to integrate the FAIM MCP server with n8n for automated demand forecasting tasks.

To use this example:

  1. Open n8n

  2. Import the workflow from n8n_examples/demand_forecasting.json

  3. Configure your FAIM API key in the MCP connection settings

  4. Execute the workflow with your time series data

Configuration

Environment Variables

# Required: Your FAIM API key
export FAIM_API_KEY="your-api-key-here"

# Optional: Set to non-production for verbose logging
export NODE_ENV=development

MCP Compatibility

This server implements the Model Context Protocol (MCP), an open protocol for connecting AI assistants to external tools and data sources. It works with any LLM and application that implements an MCP client.

Using with Any LLM or System

This server implements the standard MCP protocol and works with any application that implements an MCP client:

  • Direct MCP client implementation

  • AI framework adapters that support MCP

  • IDE extensions that expose MCP tools to any LLM

  • Custom middleware that translates between MCP and your LLM's tool calling format

Usage

Starting the Server

# Build and start the server
npm run build
node dist/index.js

The server will:

  1. Read the API key from environment

  2. Initialize the FAIM client

  3. Listen on stdin for JSON-RPC requests

  4. Send responses to stdout

Tool 1: List Models

Returns available forecasting models and their capabilities.

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "list_models",
        "description": "...",
        "inputSchema": { ... }
      },
      {
        "name": "forecast",
        "description": "...",
        "inputSchema": { ... }
      }
    ]
  }
}

Tool 2: Forecast

Performs time series forecasting using FAIM models.

Request (Point Forecast):

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "forecast",
    "arguments": {
      "model": "chronos2",
      "x": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      "horizon": 10,
      "output_type": "point"
    }
  }
}

Request (Quantile Forecast with Confidence Intervals):

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "forecast",
    "arguments": {
      "model": "chronos2",
      "x": [[[100, 50], [102, 51], [105, 52]]],
      "horizon": 5,
      "output_type": "quantiles",
      "quantiles": [0.1, 0.5, 0.9]
    }
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "success": true,
    "data": {
      "model_name": "chronos2",
      "model_version": "1.0",
      "output_type": "point",
      "forecast": {
        "point": [[[11], [12], [13], ...]]
      },
      "metadata": {
        "token_count": 150,
        "duration_ms": 245
      },
      "shape_info": {
        "input_shape": [1, 10, 1],
        "output_shape": [1, 10, 1]
      }
    }
  }
}

Project Structure

faim-mcp/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── types.ts              # TypeScript interfaces
│   ├── tools/
│   │   ├── list-models.ts    # List models tool
│   │   └── forecast.ts       # Forecasting tool
│   └── utils/
│       ├── client.ts         # FAIM client singleton
│       ├── validation.ts     # Input validation
│       └── errors.ts         # Error transformation
├── tests/
│   ├── tools/
│   │   ├── list-models.test.ts
│   │   └── forecast.test.ts
│   └── utils/
│       ├── validation.test.ts
│       └── errors.test.ts
├── dist/                     # Built output
│   ├── index.js             # ESM bundle
│   ├── index.cjs            # CommonJS bundle
│   ├── index.d.ts           # Type declarations
│   └── *.map                # Source maps
└── package.json, tsconfig.json, tsup.config.ts, vitest.config.ts

Testing

The project includes comprehensive tests for:

  • Input Validation: Valid/invalid inputs, edge cases, boundary values

  • Error Handling: SDK errors, JavaScript errors, error classification

  • Tool Functionality: Response structure, model availability

  • Type Safety: TypeScript compilation, type guards

Run tests:

npm test                 # Run all tests
npm run test:coverage   # Run with coverage report
npm run test:ui         # Run with UI dashboard

Debugging

Enable verbose logging:

NODE_ENV=development node dist/index.js

Output goes to stderr (not interfering with stdout JSON-RPC).

Building and Deployment

Build for Production

npm run build

Outputs:

  • dist/index.js - ESM module

  • dist/index.cjs - CommonJS module

  • dist/index.d.ts - Type declarations

  • Source maps for debugging

Deployment Checklist

  • Set FAIM_API_KEY environment variable

  • Run npm run build

  • Run npm test to verify

  • Deploy dist/ directory

  • Run node dist/index.js as the server process

Troubleshooting

"FAIM_API_KEY not set"

export FAIM_API_KEY="your-key-here"
node dist/index.js

"Module not found" errors

npm install
npm run build

Server not responding

  • Check that stdout/stderr are properly connected

  • Verify JSON-RPC format of requests

  • Check logs for error messages

  • Ensure FAIM API is accessible

License

MIT

Available Tools

2 tools
forecastA

Perform time series forecasting using FAIM platform. Supports both point forecasting (single value) and probabilistic forecasting (confidence intervals). Can handle univariate and multivariate time series data. Currently supported models: Chronos2 (default, recommended for multivariate) and TiRex (fast, univariate only).

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesThe forecasting model to use. Chronos2: State-of-the-art, supports univariate/multivariate, custom quantiles. TiRex: Fast alternative for univariate only, uses fixed quantiles [0.1,0.2,...,0.9], custom quantiles parameter ignored.
xNoTime series data to forecast from. MUST be an array, NOT a string. Can be a 1D array [1,2,3,4,5], 2D array [[1,2],[3,4]] (multiple series/batch or multivariate per model), or 3D array [[[1],[2]]] (batch, sequence, features). Never pass x as a JSON string - always pass as an actual array.
horizonYesNumber of time steps to forecast into the future. Must be a positive integer. Example: 10 means predict the next 10 steps.
output_typeNoType of forecast output. "point" = single value per step (fastest). "quantiles" = confidence intervals (use for uncertainty estimation). Default: "point".
quantilesNoCustom quantile levels to compute (only used with output_type="quantiles" and Chronos2 model). For TiRex, this parameter is ignored and fixed quantiles [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9] are always returned. Values must be between 0 and 1. Example: [0.1, 0.5, 0.9] for 10th, 50th, 90th percentiles.
is_multivariateNoFor 2D input arrays only with Chronos2: interpret as multivariate time series (true) or batch of univariate series (false, default). Ignored for 1D arrays, 3D arrays, and TiRex model.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses output types (point vs quantiles), model-specific behavior (TiRex ignores custom quantiles, returns fixed quantiles), and input shape constraints (MUST be array, not string). It does not cover rate limits or cost, but is transparent about core behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (3 sentences) with no fluff. First sentence states core purpose, second covers capabilities, third lists models. Every sentence provides essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters, no output schema, and a sibling tool, the description covers tool purpose, model selection criteria, input format constraints, and output types. It lacks description of return value structure, but without output schema this is acceptable. For a complex forecasting tool, it is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds significant value beyond schema: explains model differences, input shape nuances, default output type, and the meaning of is_multivariate for Chronos2 with 2D arrays. This extra context justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool performs time series forecasting, distinguishes between point and probabilistic forecasting, and explicitly lists supported models (Chronos2, TiRex). It differentiates from the sibling tool list_models by focusing on forecasting actions rather than model listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides guidance on when to use each model (e.g., 'Chronos2...recommended for multivariate', 'TiRex...fast, univariate only') and input shape requirements. It could be improved by explicitly stating when not to use the tool, but the sibling tool list_models covers model selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_modelsA

List all available forecasting models and their capabilities. Returns information about Chronos2, TiRex, and other available models, including supported output types and features.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It clearly states the tool lists and returns information about models, which implies read-only behavior. Could mention it has no side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no parameters and no output schema, the description is complete. It explains what models are listed and what information is returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description correctly adds no parameter details, which is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all available forecasting models and their capabilities, including specific model names and features. It distinguishes itself from the sibling tool 'forecast' which likely creates forecasts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when you need to see available models, but does not explicitly state when to use it versus the sibling tool 'forecast' or any exclusions.

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. Dates show when Glama detected each change.

  1. 2 tool updatesv0.2.1
    • First observedforecast
    • First observedlist_models

TDQS

A4.2/5.0
Disambiguation5/5

The two tools serve entirely different purposes: one performs forecasting while the other lists available models. There is no ambiguity or overlap.

Naming Consistency5/5

Both tools follow the descriptive verb_noun pattern (forecast, list_models) and use consistent lowercase_with_underscores naming.

Tool Count2/5

With only two tools, the server feels underdeveloped for a forecasting platform. Expected tools like data management, evaluation, or model configuration are missing.

Completeness2/5

The tool surface is severely incomplete. Typical forecasting workflows require data upload, model training, evaluation, and result retrieval, none of which are present beyond the basic forecast and model listing.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server implementation that can be run directly or through Docker, enabling AI assistants to interact with external systems through the MCP standard.
    2
    -
  • A
    license
    B
    quality
    F
    maintenance
    A Model Context Protocol server that enables AI assistants to query Prometheus metrics, discover available data, and analyze system performance through natural language interactions.
    5
    85
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server powered by Meta's Prophet that enables LLMs to perform time-series forecasting, trend analysis, and predictive modeling on historical data. It provides LLM-friendly statistical summaries, automated business-rule validation, and ready-to-render Chart.js visualizations.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Model Context Protocol (MCP) server that gives AI assistants a safe, correct data-analyst capability over business metrics - without raw SQL improvisation.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/S-FM/faim-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server