MCP server: call TimesFM-3 from Claude / Cursor (median + q10–q90)

#2
by DevairMd - opened

I wrapped TimesFM-3 as an MCP server so Claude Desktop, Claude Code, and Cursor can call it as a tool.

Repo: https://github.com/thenameisdevair/timesfm3-mcp

Tool is forecast(history, horizon). Response is the median point forecast plus the nine official quantile heads (q10–q90).

License is unchanged: this uses google/timesfm-3.0-pytorch, so it is research / evaluation / non-production only. Do not put it behind a paid or production planner.

Local install is in the README. Happy to take API-shape feedback here.

One thing I'd add to the response is forecast timestamps, or accept a start time and frequency with the series. Returning only arrays makes it easy for an agent to attach q10–q90 to the wrong periods, especially after missing observations. Even a strict regular-series check would make this safer.

Good catch. Right now the tool only returns arrays, so an agent can attach q10–q90 to the wrong dates after a gap or a wrong frequency.

TimesFM-3 itself has no calendar. The wrapper can add one without changing the model.

Plan:

  • Optional start + freq on the request (start = first history timestamp).
  • If those are set, each returned series includes timestamps for the forecast steps.
  • If the caller passes a timestamp list for the history, it must be strictly regular or the tool errors.
  • No silent gap-filling. Irregular series get refused.
  • If start/freq are omitted, the current array-only response stays unchanged.

Freq allowlist I’m starting with: H, D, W, M.

I’ll ship this as optional fields so existing clients don’t break. If you have a preferred timestamp format (ISO-8601 vs unix), say so — ISO-8601 is the default I’ll use.

Shipped. start + freq (H/D/W/M) are optional on forecast. You can also pass a strictly regular timestamps list for the history.

Forecast steps then include ISO dates. Gaps are an error — no silent fill. Omit the calendar args and the old array-only response is unchanged.

Repo: https://github.com/thenameisdevair/timesfm3-mcp

Nice — ISO-8601 is the right default. One edge case worth documenting: M is a calendar month, not a fixed duration, so it shouldn't be derived with a constant timedelta. Fast turnaround.

Sign up or log in to comment