MCP
MCP and agent integrations
Connect TSFM.ai to ChatGPT, Claude, Cursor, and other MCP clients — including Claude on the web — through a hosted Streamable HTTP endpoint with OAuth 2.1.
Endpoint
Hosted Streamable HTTP endpoint
https://api.tsfm.ai/mcpThe MCP server lets an agent discover tools, inspect arguments, and execute forecasts through the same contract described in the HTTP docs. It removes the “translate docs into tool config” step for supported clients.
If you are building your own integration layer rather than plugging into an MCP client, use the SDKs or the raw HTTP API.
Authentication
OAuth-first auth for modern MCP clients
TSFM.ai supports OAuth 2.1 with PKCE for hosted MCP clients. In practice that means a compatible client can prompt you to sign in and then use your account without storing raw API keys in local configuration.
- Hosted MCP clients should sign in through the OAuth 2.1 flow exposed by the TSFM.ai endpoint.
- Custom MCP clients can authenticate the transport with any supported Bearer credential, including OAuth access tokens and API keys.
- After the connection is authenticated, tool discovery and tool calls run against that attached account context.
Client setup
Register the endpoint, then let the client discover the toolset
Open Settings → Apps & Connectors → Advanced Settings, enable Developer Mode, and register the MCP server.
[mcp_servers.tsfm]
url = "https://api.tsfm.ai/mcp"Available tools
The important tools map directly back to the docs
| Tool | Purpose |
|---|---|
| forecast | Run a canonical TSFM forecast using the same request shape documented in the Forecast API page. |
| forecastBatch | Submit multiple forecast jobs when an agent needs to compare or fan out work. |
| listModels | Browse the hosted model catalog and narrow by capability before choosing a model. |
| getModelById | Inspect a single model’s capabilities, cost, context length, and metadata. |
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "forecast-worker", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(new URL("https://api.tsfm.ai/mcp"));
await client.connect(transport);
// When connecting programmatically, attach an OAuth bearer token with your
// transport or connection wrapper before calling authenticated tools.
const result = await client.callTool({
name: "forecast",
arguments: {
model: "amazon/chronos-bolt-small",
inputs: [{ item_id: "store_017", target: [428, 435, 441, 438, 446, 452, 460, 458, 466, 472] }],
parameters: { prediction_length: 7, freq: "D", quantiles: [0.1, 0.5, 0.9] }
}
});const tools = await client.listTools();
console.log(tools.tools.map((tool) => tool.name));
// -> ["forecast", "forecastBatch", "listModels", "getModelById"]