Farmerconnect-mcp
Plan fieldwork with location-based weather insights and quick place lookups. Calculate land area, plant density, yield estimates, and perform unit conversions. Explore crop information and time utilities to support daily farm decisions.
Ask AI about Farmerconnect-mcp
Powered by Claude · Grounded in docs
I know everything about Farmerconnect-mcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
FarmerConnect MCP
A Model Context Protocol (MCP) service that provides agricultural calculations and location-based weather data for AI agents to assist farmers.
Features
-
Agricultural Calculations
- Land area computation
- Plant density calculations
- Yield estimations
- Unit conversions (weight and length)
-
Weather Services
- Current weather data (temperature and precipitation)
- Location-based weather information
-
Crop Information
- Get encyclopedic information about a crop.
-
Geolocation Services
- Forward geocoding (place name to coordinates)
- Reverse geocoding (coordinates to place name)
- Location caching for improved performance
Installation
# Clone the repository
git clone https://github.com/yourusername/FarmerConnect-MCP.git
cd FarmerConnect-MCP
# Create and activate virtual environment
python -m venv env
.\env\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
Configuration
Create a .env file in the root directory with the following variables:
LOCATIONIQ_API_KEY=your_locationiq_api_key
Usage
Start the MCP server:
python main.py
Available Tools
1. calculate_agro_metric
Performs basic agricultural calculations (land area, plant density, and yield estimate) and unit conversions (weight and length).
2. get_weather_now
Fetches the current weather (temperature and precipitation) for a given location.
lat(float): Latitude of the location.lng(float): Longitude of the location.
3. forward_geocode
Converts a place name into geographic coordinates (latitude and longitude).
place_name(str): The human-readable location name.
4. reverse_geocode
Converts geographic coordinates into a human-readable place name.
lat(float): Latitude.lng(float): Longitude.
5. get_current_datetime
Gets the server's current date and time.
6. get_crop_info
Provides encyclopedic information about a specific crop in a given location.
crop_name(str): The common name of the crop (e.g., 'maize', 'cassava').location(str): The location (e.g., 'Kenya', 'Nigeria') to provide context.
API Dependencies
- Open-Meteo API (weather data)
- LocationIQ API (geocoding services)
- Wikipedia API (for crop information)
Caching
The service implements request caching for location queries:
- Cache duration: 30 days for LocationIQ requests
- Cache storage: SQLite backend
- Cached methods: GET requests only
License
This project is licensed under the MIT License - see the LICENSE file for details.
For more information about Model Context Protocol, visit the official MCP documentation.
