Forest Admin - API reference
    Preparing search index...

    Interface ForestMCPServerOptions

    Options for configuring the Forest Admin MCP Server

    interface ForestMCPServerOptions {
        agentDispatcher?: InProcessAgentDispatcher;
        agentUrl?: string;
        authSecret?: string;
        basePath?: string;
        enabledTools?: ToolName[];
        envSecret?: string;
        forestAppUrl?: string;
        forestServerClient?: ForestServerClient;
        forestServerUrl?: string;
        logger?: Logger;
        tokenTtl?: TokenTtlOptions;
    }
    Index

    Properties

    agentDispatcher?: InProcessAgentDispatcher

    Set by the agent when mounted: tool calls then dispatch to the agent in-process (no socket) instead of reaching its public api_endpoint over HTTP.

    agentUrl?: string

    Standalone MCP server only (set via FOREST_AGENT_URL). Internal URL the tools use to reach the agent's data layer, defaulting to the environment's public api_endpoint.

    authSecret?: string

    Forest Admin authentication secret

    basePath?: string

    Opt-in path prefix under which the MCP protocol and OAuth routes are mounted, e.g. '/ai'. The .well-known discovery documents stay at the origin root (per RFC 8414/9728) but are served at prefix-suffixed paths. Defaults to the origin root. Use it to avoid colliding with a host app's own OAuth routes when embedded. Requires the agent to be served at the domain root.

    enabledTools?: ToolName[]

    List of tool names to enable (allowlist). Only these tools will be exposed. New tools in future releases will NOT be auto-enabled.

    envSecret?: string

    Forest Admin environment secret

    forestAppUrl?: string

    Forest Admin app URL (for OAuth redirects)

    forestServerClient?: ForestServerClient

    Optional Forest server client for dependency injection (from agent integration)

    forestServerUrl?: string

    Forest Admin server URL

    logger?: Logger

    Optional logger function. Defaults to console logging.

    tokenTtl?: TokenTtlOptions

    Upper bounds on the OAuth token lifetimes this server issues. Forest grants 1 hour (3600s) for an access token and 8 days (691200s) for a refresh token; each value can only shorten that, never extend it. refreshTokenSeconds bounds the time between two interactive logins. Minimum 60s for either.