Skip to content

docs(mcp-server): document the tokenTtl option - #18

Merged
Scra3 merged 6 commits into
mainfrom
feat/mcp-token-ttl-doc
Jul 29, 2026
Merged

docs(mcp-server): document the tokenTtl option#18
Scra3 merged 6 commits into
mainfrom
feat/mcp-token-ttl-doc

Conversation

@Scra3

@Scra3 Scra3 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Documents the new tokenTtl option shipped in agent-nodejs#1788, requested by Spendesk to force periodic re-authentication and limit the blast radius of a leaked token.

Adds a ## Token lifetimes section after Restrict tools, the two env vars to the standalone table, and one bullet in ## Security linking to it so it is findable from both angles.

Two things get their own callout because they are what surprise users:

  • Both values only shorten the lifetime Forest Admin granted (<Warning>). A value longer than Forest's own lifetime has no effect — the option cannot extend a token.
  • refreshTokenSeconds is measured from the login, not from the last refresh. That distinction is the whole point: Forest grants a full refresh lifetime on every refresh, so a per-refresh bound would slide forever and never force a re-login.

A small table contrasts the two settings by what the end user actually notices: accessTokenSeconds is invisible (the assistant refreshes silently), refreshTokenSeconds sends them back through the browser login.

Branched from main (the local clone was on feat/wf-executor-doc).

Note

Document tokenTtl options for configuring OAuth token lifetimes in the MCP server

Adds a new 'Token lifetimes' section and two new environment variable entries to mcp-server.mdx.

  • Documents FOREST_MCP_ACCESS_TOKEN_TTL_SECONDS and FOREST_MCP_REFRESH_TOKEN_TTL_SECONDS environment variables and their equivalent tokenTtl options on agent.mountAiMcpServer
  • Explains default durations, minimum value (60 seconds), measurement semantics for refresh tokens, and that invalid values cause startup failure
  • Notes that shorter lifetimes only apply to tokens issued after enabling the option, and warns against setting values above Forest's upper bounds
  • Adds a bullet noting the MCP server supports shortening OAuth token lifetimes

Macroscope summarized c2f90df.

@mintlify

mintlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
forest 🟢 Ready View Preview Jul 28, 2026, 1:21 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread product/process/workflows/forest-runtime.mdx
Comment thread product/process/workflows/forest-runtime.mdx Outdated
Requirements:

- **`@forestadmin/agent` ≥ 1.84.0**.
- **The executor package**, installed at the **exact version your agent pins**. It's an *optional peer dependency* the agent loads dynamically at runtime, so `tsc` won't flag it when it's missing — but `agent.start()` throws _"The embedded workflow executor requires the `@forestadmin/workflow-executor` package"_. The pin is exact (a `^` range conflicts), so install that specific version — find it in your lockfile or with `npm info @forestadmin/agent peerDependencies`:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium workflows/forest-runtime.mdx:54

The suggested command npm info @forestadmin/agent peerDependencies queries the registry's latest agent version, not the version installed by the reader. When an older supported agent pins a different executor version, this returns the wrong exact version, so the subsequent npm install conflicts with that agent's peer dependency. Include the installed agent version in the command, e.g. npm info @forestadmin/agent@1.84.0 peerDependencies.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @product/process/workflows/forest-runtime.mdx around line 54:

The suggested command `npm info @forestadmin/agent peerDependencies` queries the registry's `latest` agent version, not the version installed by the reader. When an older supported agent pins a different executor version, this returns the wrong exact version, so the subsequent `npm install` conflicts with that agent's peer dependency. Include the installed agent version in the command, e.g. `npm info @forestadmin/agent@1.84.0 peerDependencies`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct and fixed in #20 — the command is now npm info @forestadmin/agent@<your-agent-version> peerDependencies, with a note that a bare invocation answers for latest, whose executor pin may differ from the agent actually installed. Landing on main since this file left #18 in the rebase.

alban bertolini and others added 6 commits July 29, 2026 10:49
Both values are upper bounds — they only shorten what Forest Admin granted — and
refreshTokenSeconds is anchored on the login rather than the last refresh, so the
page states both explicitly: that is what surprises users.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only accessTokenSeconds has an inert case. refreshTokenSeconds bounds the whole
session, which Forest Admin re-extends on every refresh, so any value shortens it
however large — stating otherwise told readers a working control does nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Without the numbers a reader cannot tell whether their value will bind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Forest Admin re-grants its refresh lifetime on every refresh, so leaving
refreshTokenSeconds unset means a working assistant never signs in again. Listing
8 days as the default steered readers away from the whole useful range.

Also documents that refresh tokens predating the option anchor on their last
refresh, giving one longer session before the bound applies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The signed JWT carries the Forest token, so a leak stays exploitable against the
agent past the cap. Say so rather than implying the cap bounds the leak.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Scra3
Scra3 force-pushed the feat/mcp-token-ttl-doc branch from dba7a89 to c2f90df Compare July 29, 2026 08:50
@Scra3
Scra3 merged commit cb36767 into main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant