Smart Irrigation MCP Server
Integrates with Google's Gemini API via the google-genai SDK to enable AI-powered agronomic reasoning for irrigation and soil health decisions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
The-Automated-Smart-Irrigation-and-Soil-Health-Pipeline
An MCP-Driven Agronomic Intelligence System with Built-In Hardware Safety Guardrails An intelligent, closed-loop environmental agent architecture designed to optimize agricultural water consumption and audit crop soil conditions. Built for the Agents for Good track of the Kaggle AI Agents: Intensive Vibe Coding Capstone Project.
π Project Overview & Problem Statement
Traditional agricultural automation systems rely on rigid, static threshold rules (e.g., if moisture < 30%, turn on water). These configurations break down when confronting complex real-world variables, such as ignoring predictive weather APIs or blindly trusting inaccurate rain forecasts while crops actively suffer from dehydration stress.
This project implements an adaptive multi-agent reasoning framework powered by Gemini 2.5 Flash and structured using the Model Context Protocol (MCP). The pipeline evaluates live sensor data, detects logical conflicts between atmospheric forecasts and ground truth metrics, automatically accounts for rain-induced nutrient leaching, and actuates irrigation hardware safely through integrated operational guardrails.
Related MCP server: Jeltz
π οΈ Key Concepts Applied
This project demonstrates three core course concepts to satisfy the capstone technical evaluation matrix:
Agent / Multi-agent System (ADK): Powered by the
google-genaiSDK, our agent processes complex telemetry and makes contextual agronomic decisions (balancing temperature, moisture, and weather trends) instead of relying on brittle, hardcodedif/elselogic loops.MCP Server Integration: Built a local FastAPI server acting as an MCP host. It standardizes data access by exposing real-time sensor metrics as an MCP Resource stream and standardizes farm hardware control by exposing valve actuators as an executable MCP Tool.
Security Features (Deterministic Guardrails): Implemented an operational physical safety gate directly into the pipeline code. If soil moisture exceeds 50% (soggy/wet conditions), the script instantly trips a safety gate, bypassing the LLM entirely to defend against root rot and unnecessary resource spend.
Antigravity 2.0 [ MCP Server Resource ] ----> [ Validated Data Schema ] ----> [ Hardware Guardrail ] (Simulated Telemetry) (Moisture, Temp, Forecast, pH) (Max 50% Moisture Check) [ Executable MCP Tool ] <==== [ AI Agent Decision Loop ] <========
π§ͺ Advanced Agronomic Reasoning: The Leaching Feedback Loop
A standout feature of this agent is its ability to handle multi-variable environmental relationships:
The Problem: Heavy rainfall washes basic, alkaline nutrients (Calcium, Magnesium) deep into the subsoil, causing permanent chemical changes that lower soil pH (acidification).
The Agent Solution: If the incoming weather feed signals heavy rain while the physical soil pH drops below 6.0, the agent dynamically calculates a High Leaching Risk. Rather than just managing water, it halts irrigation and triggers a Critical ACUP (Acidic Concentration Update) diagnostic alert, instructing the farmer on soil chemical remediation steps.
π Project Structure
smart-irrigation-pipeline/
βββ src/
β βββ __init__.py
β βββ schema.py # Pydantic data schemas verifying telemetry integrity
β βββ mcp_server.py # FastAPI application exposing MCP resources and tools
β βββ agent.py # Core ADK agent containing logic and guardrails
βββ requirements.txt # Project dependencies
βββ README.md # Project report and setup instructions
β‘ Getting Started & Setup Instructions
1. Install Dependencies
Ensure you are running within an isolated Python virtual environment, then install the required packages:
pip install -r requirements.txt
2. Configure Your Environment Workspace
Set up your Gemini authorization key within your local environment terminal:
export GEMINI_API_KEY="your_actual_gemini_api_key_here"
3. Launch the MCP Server
Start up the FastAPI server to begin exposing live telemetry resource feeds on port 8000:
python -m uvicorn src.mcp_server:app --reload --port 8000
4. Execute the Pipeline Agent
In a separate terminal window, execute the smart agent to run a diagnostics loop and actuate hardware tasks:
python src/agent.py
=====+ (Passed if safe)
(Actuate Irrigation) (Gemini 2.5 Flash Reasoning)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
One MCP URL for all your connectors β scoped writes, enforced constraints, and a full audit trail.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables management and monitoring of farm operations including field and crop tracking, livestock monitoring, equipment management, and sensor readings through a Model Context Protocol interface built with FastMCP.11-
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to physical devices via MCP, enabling LLMs to reason about sensor data, perform cross-device correlation, and interpret anomalies.4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server for the CultivarIA platform, enabling AI assistants to query real-time and historical telemetry from cultivation modules, analyze plant health, and control actuators like irrigation and climate systems via standardized tools and resources.MIT
- AlicenseAqualityDmaintenanceExposes digital twin device data capabilities as MCP tools, allowing MCP clients to query device status, read real-time metrics, fetch time-series data, and check alerts. Includes a simulated PLC driver with a clean interface for connecting real devices via OPC-UA, Modbus, or gateway APIs.6MIT