Forest Admin - API reference
    Preparing search index...

    Forest Admin - API reference

    Forest agent for Node.js: your data, workflows and AI agents, running on your infrastructure.

    npm CI License

    Forest is the back office for operations teams in regulated companies. Ops teams review, decide and act on your data from one interface, or let AI agents do it through MCP, within the roles, permissions and audit logs you define.

    This repository is the Node.js agent: the part of Forest that runs on your servers, connects to your databases and services, and exposes them to the Forest interface and to AI agents. Your business data never goes through Forest.

    Note

    Forest v2. This is the current Node.js SDK. Using forest-express-sequelize or forest-express-mongoose? You are on v1: see the migration guide.

    npm install @forestadmin/agent @forestadmin/datasource-sql
    
    import { createAgent } from '@forestadmin/agent';
    import { createSqlDataSource } from '@forestadmin/datasource-sql';

    const agent = createAgent({
    authSecret: process.env.FOREST_AUTH_SECRET,
    envSecret: process.env.FOREST_ENV_SECRET,
    isProduction: process.env.NODE_ENV === 'production',
    });

    agent.addDataSource(createSqlDataSource(process.env.DATABASE_URL));

    await agent.start();

    Required environment variables: FOREST_ENV_SECRET, FOREST_AUTH_SECRET, DATABASE_URL. Full guide: docs.forest.app/get-started/quickstart

    Node.js Developed and tested on Node.js 24 (see .nvmrc)
    Framework None required: standalone server, or mounted on Express, Koa, Fastify or NestJS
    Data Connect your databases and services through data sources: SQL, Sequelize, Mongoose, MongoDB, Zendesk, replicas, RPC.
    Customization Computed fields, actions, segments, hooks and validations in TypeScript, with autocompletion generated from your schema.
    Workflows Runs your Forest business processes on your side (@forestadmin/workflow-executor).
    MCP server Exposes your collections and actions to AI agents through the Model Context Protocol (@forestadmin/mcp-server).
    Permissions and audit Roles, scopes and activity logs defined in Forest, enforced on every request, from the UI or from an AI agent.
    The Node.js agent runs on your infrastructure. Forest calls it over HTTPS; the agent queries your databases and services, and exposes an MCP server to AI agents.

    The agent runs on your infrastructure. The Forest interface calls your agent, and your agent queries your sources: Forest does not store your business data. You control what is exposed, to whom, and the logic applied to it.

    Get started https://docs.forest.app/get-started/quickstart
    Connect a data source https://docs.forest.app/get-started/connect/data-sources/overview
    Node.js API reference https://docs.forest.app/reference/agent-api/nodejs
    MCP server https://docs.forest.app/product/embed/mcp-server
    Migrating from v1 https://docs.forest.app/guides/migration/from-v1/overview
    Packages in this monorepo

    @forestadmin/agent · datasource-sql · datasource-sequelize · datasource-mongoose · datasource-mongo · datasource-zendesk · datasource-replica · datasource-customizer · mcp-server · workflow-executor · agent-testing · plugin-aws-s3 · plugin-flattener · plugin-export-advanced · forest-cloud

    Experimental plugins and data sources: forestadmin-experimental.

    Bug reports and pull requests are welcome. See CONTRIBUTING.md for setup, tests and commit conventions.

    yarn install && yarn build && yarn test
    

    Apache 2.0. See LICENSE.