Model Context Protocol (MCP) server for Forest Admin with OAuth authentication support.
This MCP server provides HTTP REST API access to Forest Admin operations, enabling AI assistants and other MCP clients to interact with your Forest Admin data through a standardized protocol.
The MCP server is included with the Forest Admin agent. Simply call mountAiMcpServer():
import { createAgent } from '@forestadmin/agent';
const agent = createAgent(options)
.addDataSource(myDataSource)
.mountAiMcpServer();
agent.mountOnExpress(app);
agent.start();
The MCP server will be automatically initialized and mounted on your application.
You can also run the MCP server standalone using the CLI:
npx forest-mcp-server
Or programmatically:
node dist/index.js
The following environment variables are required to run the server as a standalone:
| Variable | Required | Default | Description |
|---|---|---|---|
FOREST_ENV_SECRET |
Yes | - | Your Forest Admin environment secret |
FOREST_AUTH_SECRET |
Yes | - | Your Forest Admin authentication secret (must match your agent) |
MCP_SERVER_PORT |
No | 3931 |
Port for the HTTP server |
export FOREST_ENV_SECRET="your-env-secret"
export FOREST_AUTH_SECRET="your-auth-secret"
export MCP_SERVER_PORT=3931
npx forest-mcp-server
Once running, the MCP server exposes a single endpoint:
/mcp - Main MCP protocol endpointThe server expects MCP protocol messages in the request body and returns MCP-formatted responses.
npm run build
npm run build:watch
npm run lint
npm test
npm run clean
The server consists of:
GPL-3.0
https://github.com/ForestAdmin/agent-nodejs
For issues and feature requests, please visit the GitHub repository.