> ## Documentation Index
> Fetch the complete documentation index at: https://forest-chore-open-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Forest MCP Server

> Securely access your Forest data and actions from AI-enabled third party apps using the Model Context Protocol.

# What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external data and tools through natural language.

# What can the Forest MCP do?

The Forest MCP server lets AI tools like Claude, Dust, and others to:

* Access collection schemas
* Securely query and browse your data
* Execute actions on records

All of this while respecting the Roles & Permissions of your Forest project, and logging every activity, just like if they were performed through the UI.

The Forest MCP Server also enables other third party apps to embed and access Forest data and actions, for example in [Zendesk](/product/embed/zendesk), or [n8n](/product/embed/n8n).

# Enabling the Forest MCP Server

There are 2 ways to configure the Forest MCP Server:

* **Standalone**: the Forest MCP Server runs as an standalone service, pointing to your existing node.js or ruby back-end
* **Mounted**: the Forest MCP Server runs as part of your node.js back-end

## Standalone Forest MCP Server

To run your Forest MCP Server as a standalone service, you will first need to download the mcp-server package:

```text theme={null}
npm install @forestadmin/mcp-server
```

You will then need to provide your FOREST\_ENV\_SECRET and FOREST\_AUTH\_SECRET variables to start the Forest MCP Server, to ensure it can authenticate and access the right back-end, corresponding to your project and environment of choice:

```text theme={null}
FOREST_ENV_SECRET=xxx FOREST_AUTH_SECRET=xxx npx forest-mcp-server
```

<Note>
  Follow [this guide](/get-started/connect/environment-variables) to retrieve your AUTH and ENV secrets for the relevant environment.
</Note>

Your Forest MCP Server will be accessible at this URL: `{your-standalone-server-url}/mcp`

<img src="https://mintcdn.com/forest-chore-open-api/DwOJ-XBdKEod-4Pc/images/diagrams/mcp-standalone.svg?fit=max&auto=format&n=DwOJ-XBdKEod-4Pc&q=85&s=446bb2ede14e5dcc87422398e4344bc9" alt="Standalone: the AI agent hits the MCP server running as a separate service, which talks to your Forest back-end and your data" width="100%" data-path="images/diagrams/mcp-standalone.svg" />

## Mounted Forest MCP Server

<Note>
  This is only available with the node.js back-end. For other back-ends, refer to the Standalone method further down.
</Note>

<img src="https://mintcdn.com/forest-chore-open-api/DwOJ-XBdKEod-4Pc/images/diagrams/mcp-mounted.svg?fit=max&auto=format&n=DwOJ-XBdKEod-4Pc&q=85&s=741719356b2e7c8e6993542df321514a" alt="Mounted: the AI agent hits the /mcp endpoint mounted directly inside your Forest back-end, which talks to your data" width="100%" data-path="images/diagrams/mcp-mounted.svg" />

In your node.js's `index.js` file, simply call the `mountAiMcpServer()` method when creating the back-end, for example:

```text theme={null}
const agent = createAgent(options).addDataSource(/* ... */).mountAiMcpServer();
```

Upon restarting your back-end, the Forest MCP Server will automatically start, as confirmed by the following console log:

```text theme={null}
info: [MCP] Server initialized successfully
```

Your Forest MCP Server URL will be `{your-agent-url}/mcp`

<Note>
  Your back-end URL can be found in the Forest UI's Project Settings, under the Environments tab.

  Note that each Environment has its own Back-end URL, and therefore its own Forest MCP Server URL.
</Note>

# Available tools

The Forest MCP server exposes the following capabilities:

### Read

| Tool                 | Description                                           |
| -------------------- | ----------------------------------------------------- |
| `describeCollection` | Get schema of a collection (fields, types, relations) |
| `list`               | Search and list records with filters and pagination   |
| `listRelated`        | List related records                                  |

### Write

| Tool         | Description                     |
| ------------ | ------------------------------- |
| `create`     | Create a new record             |
| `update`     | Update an existing record       |
| `delete`     | Delete one or more records      |
| `associate`  | Link records through a relation |
| `dissociate` | Unlink records from a relation  |

### Actions

| Tool            | Description                        |
| --------------- | ---------------------------------- |
| `getActionForm` | Get form fields for a smart action |
| `executeAction` | Execute a smart action             |

## Restrict tools

You can restrict which tools the MCP server exposes using `enabledTools`. Only the tools you list will be available, and **new tools added in future releases will NOT be automatically enabled**, so your configuration stays safe over time.

<CodeGroup>
  ```javascript Mounted on agent theme={null}
  agent.mountAiMcpServer({
    enabledTools: ['describeCollection', 'list', 'listRelated'],
  });
  ```

  ```bash Standalone theme={null}
  FOREST_MCP_ENABLED_TOOLS="describeCollection,list,listRelated" \
    FOREST_ENV_SECRET=xxx FOREST_AUTH_SECRET=xxx npx forest-mcp-server
  ```
</CodeGroup>

When `enabledTools` is not set, all tools are enabled by default.

<Info>
  `describeCollection` is always enabled, even if omitted from the list, as it is required for the MCP server to function properly.
</Info>

## Connect your AI assistant

Your MCP endpoint is available at `/mcp` (`<your-agent-url>/mcp` when mounted, `<your-standalone-server-url>/mcp` when standalone). On first connection, a browser window opens for you to log in with your Forest credentials; the assistant then operates with that user's permissions.

<CodeGroup>
  ```bash Claude Code theme={null}
  claude mcp add --transport http forest-admin <your-mcp-endpoint>
  ```

  ```json Claude Desktop theme={null}
  {
    "mcpServers": {
      "forest-admin": {
        "command": "npx",
        "args": ["-y", "mcp-remote", "<your-mcp-endpoint>"]
      }
    }
  }
  ```

  ```json Cursor theme={null}
  {
    "mcpServers": {
      "forest-admin": {
        "url": "<your-mcp-endpoint>"
      }
    }
  }
  ```

  ```json VS Code theme={null}
  {
    "servers": {
      "forest-admin": {
        "type": "http",
        "url": "<your-mcp-endpoint>"
      }
    }
  }
  ```

  ```toml Codex (OpenAI) theme={null}
  [mcp_servers.forest-admin]
  url = "<your-mcp-endpoint>"
  ```
</CodeGroup>

<Info>
  Use the MCP transport type `"http"` (not `"sse"` or `"url"`): the Forest MCP server uses Streamable HTTP. Your URL should still use `https://`. Clients that rely on `mcp-remote` (Claude Desktop, Windsurf, JetBrains) require Node.js 18+ (some versions need 20+).
</Info>

## Use cases

### AI-assisted operations

Use Claude or other AI assistants to:

* Answer questions about your data
* Generate reports and insights
* Automate routine tasks
* Perform data analysis

### Example prompts

> "Show me all pending orders from the last 24 hours"

> "What customers have the highest lifetime value?"

> "Execute the 'Send Invoice' action on order #12345"

## Security

The Forest MCP server:

* Respects all Forest permissions and roles
* Uses your environment's authentication
* Logs all operations for audit purposes
* Never exposes sensitive data without proper access

<Warning>
  Only provide MCP server access to trusted AI tools and users. The server can perform any operation that the authenticated user can perform.
</Warning>
