home / mcp / litefarm mcp server

LiteFarm MCP Server

Local MCP server enabling Claude Desktop to manage LiteFarm data and perform SQL Sandbox operations.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bundelkund-litefarm-mcp-server": {
      "command": "node",
      "args": [
        "C:\\\\Users\\\\YourUsername\\\\graph-project\\\\Litefarm-mcp-server\\\\node_modules\\\\tsx\\\\dist\\\\cli.mjs",
        "C:\\\\Users\\\\YourUsername\\\\graph-project\\\\Litefarm-mcp-server\\\\index.ts"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_NAME": "pg-litefarm",
        "DB_PORT": "5433",
        "DB_USER": "postgres",
        "TRANSPORT": "stdio",
        "DB_PASSWORD": "postgres",
        "LITEFARM_EMAIL": "[email protected]",
        "LITEFARM_API_URL": "http://localhost:5000",
        "LITEFARM_PASSWORD": "dein-passwort"
      }
    }
  }
}

You run a LiteFarm MCP Server locally to connect Claude Desktop with your LiteFarm installation. This server lets you manage farms, tasks, crops, and locations, and also perform complex SQL operations safely through a sandboxed workflow. It runs locally and exposes both API-backed actions and an atomized SQL sandbox for multi-step processes.

How to use

Use Claude Desktop to interact with LiteFarm data through natural language prompts. You can list farms, create a new farm, fetch farm details, manage tasks, search crops, and access location data. For advanced workflows, you can perform SQL Logic Sandbox operations to execute multi-step transactions atomically. All actions are accessible via the MCP server as described in the integration steps.

How to install

Prerequisites you need to have before installing the server.

Node.js version 18.0.0 or newer must be installed on your system.

LiteFarm must be running locally at http://localhost:5000.

A PostgreSQL database must be available for the SQL Logic Sandbox on port 5433.

Claude Desktop with MCP support is required to connect to the server.

Configuration and running the MCP server

# Step 1: Install dependencies
npm install

# Step 2: Create a local environment file
cp .env.example .env
```

```bash
# Step 3: Configure environment values in .env
# LiteFarm API configuration
LITEFARM_API_URL=http://localhost:5000
[email protected]
LITEFARM_PASSWORD=your-password
TRANSPORT=stdio

# Database configuration for SQL Logic Sandbox
DB_HOST=localhost
DB_PORT=5433
DB_NAME=pg-litefarm
DB_USER=postgres
DB_PASSWORD=postgres
```

```bash
# Step 4: Run the MCP server locally via the standard stdio flow
node node_modules/tsx/dist/cli.mjs /path/to/index.ts
```

Note: The exact path to your index.ts and the project root should be adjusted to your environment. If you prefer a fully defined command in Claude Desktop, use the precise paths you configured during setup.

Claude Desktop integration (config excerpt)

{
  "mcpServers": {
    "litefarm": {
      "command": "node",
      "args": [
        "C:\\Users\\YourUsername\\graph-project\\Litefarm-mcp-server\\node_modules\\tsx\\dist\\cli.mjs",
        "C:\\Users\\YourUsername\\graph-project\\Litefarm-mcp-server\\index.ts"
      ],
      "cwd": "C:\\Users\\YourUsername\\graph-project\\Litefarm-mcp-server",
      "env": {
        "LITEFARM_API_URL": "http://localhost:5000",
        "LITEFARM_EMAIL": "[email protected]",
        "LITEFARM_PASSWORD": "your-password"
      }
    }
  }
}
```

Note: Use absolute paths matching your system and replace credentials accordingly.

Available tools

litefarm_list_farms

List all farms managed in LiteFarm.

litefarm_get_farm

Fetch detailed information about a specific farm.

litefarm_create_farm

Create a new farm with given properties.

litefarm_update_farm

Update details of an existing farm.

litefarm_list_tasks

List tasks associated with farms.

litefarm_create_task

Create a new task linked to a farm or crop.

litefarm_complete_task

Mark a task as completed.

litefarm_list_crops

List all crops available in LiteFarm.

litefarm_get_crop

Get details for a specific crop.

db_get_schema

Inspect the database schema used by the SQL Logic Sandbox.

db_execute_sql

Execute SQL statements directly against the sandbox with auto-rollback on errors.