Identity & policy
Cloudflare resolves sessions, OAuth grants, client JWTs, routing and access policy. Public clients never need direct access to Intervals credentials.
Technical design
Montis separates identity, trust, routing, deterministic computation, semantic contracts and interface rendering into explicit layers. Each layer has one responsibility and a defined authority boundary.
Intervals.icu is the data authority. Cloudflare is the public trust boundary. Railway performs deterministic computation. LLMs consume governed output; they do not redefine it.
Architecture model
The platform is designed so that identity, data access, computation and presentation can evolve independently without one layer silently taking control of another.
Cloudflare resolves sessions, OAuth grants, client JWTs, routing and access policy. Public clients never need direct access to Intervals credentials.
Athlete activity, wellness, calendar and training data originate from the connected Intervals.icu account and remain the canonical data source.
Python executes validation, aggregation, enforcement and semantic serialization through the Unified Reporting Framework.
Browser, Gemini App, ChatGPT, Claude, Codex and direct API clients consume the same execution layer through different access wrappers.
This is the central technical principle behind Montis: the user experience is replaceable; the identity, computation and semantic contracts are not.
Why this architecture is different
Giving an AI model direct access to Intervals.icu exposes useful data, but it still leaves the model to decide what that data means. Montis inserts a governed intelligence layer between athlete data and the language model.
Training load, physiology, performance behaviour, adaptation, phase and event context are resolved by Montis before conversational AI is asked to explain or discuss them. The language model therefore does not begin with an unstructured collection of athlete metrics and invent its own training state.
The model receives athlete data and must independently infer its significance, relationships and coaching implications.
Montis validates and resolves the evidence into governed athlete context and coaching decisions before the language model enters the dialogue.
Identity & token resolution
Browser sessions, ChatGPT OAuth and MCP OAuth use different access wrappers, but each resolves to the same server-side Intervals token record.
montis_session → athlete identity → shared KV token
Unified execution model
Authentication and interface differ at the edge. Once identity and data access are resolved, requests enter the same dispatcher and deterministic backend.
Browser, Gemini App, ChatGPT, MCP or direct API.
Identity, OAuth, policy, routing and parameter normalization.
Maps client access to the athlete's shared connection record.
Routes execution into the required report, calendar or athlete tool.
Runs validation, calculation, enforcement and semantic serialization.
Returns governed semantic JSON for UI or LLM rendering.
Client
→ Cloudflare Services
→ Unified Auth Resolver
→ Dispatcher / Internal Tools
→ Intervals.icu API + Railway Engine
→ Semantic JSON (URF v5.1)
→ Client / LLM Rendering
Production pipeline
Public access is concentrated at Cloudflare. Data retrieval and deterministic report computation are separated from client-specific presentation logic.
Cloudflare is the public trust and routing layer. Railway remains the private compute backend.
Public integration surfaces
The same governed coaching engine is exposed through different protocols so that applications and AI clients can use Montis without duplicating backend logic.
Public REST endpoints provide structured access through Cloudflare while Railway remains private and unreachable as a direct public backend.
MCP provides discovery, typed tool execution and public coaching resources for Claude, Codex and other MCP-capable clients without giving the model direct custody of Intervals.icu tokens.
Server URL https://montis.icu/mcp Client ID intervals-mcp Public MCP resources https://github.com/revo2wheels/montis-mcp-resources Local Inspector npx @modelcontextprotocol/inspector Inspector URL http://localhost:6274/#tools
Security model
MCP or GPT access alone is not sufficient to obtain athlete data. Protected execution must resolve to an authenticated Montis identity and the athlete's server-side Intervals connection.
Athlete data requires a successful authenticated connection to Intervals.icu.
MCP grants determine whether a client may discover and execute Montis tools.
Intervals access and refresh tokens are held in Cloudflare KV, not exposed to LLM prompts.
MCP endpoint URLs, OAuth discovery metadata and the public client identifier are intentionally public.
Client JWTs are validated before protected tool execution can resolve athlete context.
The compute backend is not exposed as the public integration surface.
URF v5.1 execution guarantees
The technical pipeline validates, filters, derives and serializes the report state before an interface or LLM sees the result.
| Layer | Implementation role | Guarantee |
|---|---|---|
| Prefetch / Edge | Identity resolution, parameter normalization, routing and optional test payloads | Consistent public request handling |
| Tier-0 | Baseline schema and required-column validation | Rejects structurally invalid input before deeper processing |
| Tier-1 | Activity filtering, normalization and numeric consistency | Clean canonical input state |
| Tier-2 | Derived metrics, locked totals and scope enforcement | No silent variance bleed between report windows |
| Tier-3 | Performance, forecast and coaching intelligence modules | Operates on governed upstream outputs |
| Serialization | Single semantic JSON contract | Stable downstream structure and precision |
| Observability | Structured logs at execution boundaries | Traceable audit chain |
Tool & LLM architecture
ChatGPT, Claude, Gemini and future clients can all use the same Montis execution layer. Tool schemas and semantic contracts constrain what the model receives and what it is allowed to invoke.
ChatGPT, Claude, Gemini and other clients can share the same backend capability without introducing separate coaching logic.
Cloudflare routes all protected execution into the same dispatcher and Railway engine.
Clients receive structured output rather than raw authority to recompute canonical metrics.
Client / LLM
↓
Cloudflare Services
↓
Unified Auth Resolver
↓
Dispatcher / Internal Tools
↓
Railway Engine
↓
Semantic JSON (URF v5.1)
↓
Read-only rendering / interaction
End-to-end behaviour
The conversational experience may feel flexible, but the underlying path is explicit and reproducible.
Architectural continuity
Direct APIs, MCP, browser features and future clients can change independently while preserving the same backend data authority and URF guarantees.
Core report computation remains centralized rather than duplicated per client.
Tier-0, Tier-1 and Tier-2 contracts remain upstream of all client rendering.
URF v5.1 provides the shared output structure consumed by multiple interfaces.
Intervals.icu remains the canonical athlete data connection.
Execution is headless and can be called from browser, chat, automation or CLI.
ChatGPT, Claude and Gemini do not get different canonical metrics from separate pipelines.
Coaching methodology
Performance Intelligence, ESPE, ADE, phase governance and the physiology behind the coaching pipeline are documented separately so this page can stay focused on architecture.