home / mcp / litefarm mcp server
Local MCP server enabling Claude Desktop to manage LiteFarm data and perform SQL Sandbox operations.
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.
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.
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.
# 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.{
"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.List all farms managed in LiteFarm.
Fetch detailed information about a specific farm.
Create a new farm with given properties.
Update details of an existing farm.
List tasks associated with farms.
Create a new task linked to a farm or crop.
Mark a task as completed.
List all crops available in LiteFarm.
Get details for a specific crop.
Inspect the database schema used by the SQL Logic Sandbox.
Execute SQL statements directly against the sandbox with auto-rollback on errors.