Model Context Protocol (MCP) server that exposes the Plantos agricultural intelligence API as tools for Claude and other AI assistants.
This MCP server wraps the Plantos API, allowing AI assistants to:
- Analyze farm locations for optimal crop selection
- Get real-time soil data from SSURGO database
- Fetch current weather data from NOAA
- Access live commodity market prices
- Chat with an agricultural advisor powered by RAG
- Generate economic analysis and farming recommendations
Comprehensive agricultural analysis for a specific location.
Inputs:
latitude(number): Latitude coordinate (-90 to 90)longitude(number): Longitude coordinate (-180 to 180)
Returns:
- Soil properties and insights
- Weather conditions
- Crop yield predictions (87% accuracy)
- Live market data
- Economic analysis (revenue, costs, ROI)
- AI-generated recommendations
Get detailed soil properties using SSURGO database.
Inputs:
latitude(number): Latitude coordinatelongitude(number): Longitude coordinate
Returns: Soil texture, drainage, pH, organic matter, composition
Get current weather data from NOAA Weather.gov API.
Inputs:
latitude(number): Latitude coordinatelongitude(number): Longitude coordinate
Returns: Temperature, precipitation, humidity, growing degree days, wind data
Get live commodity market prices from USDA and CME.
Inputs:
crops(string): Comma-separated crop types (e.g., "corn,soybeans,wheat")latitude(number, optional): For regional price adjustmentslongitude(number, optional): For regional price adjustments
Returns: Current prices, futures prices, price trends
Get comprehensive market summary with location-based insights.
Inputs:
latitude(number, optional): For regional contextlongitude(number, optional): For regional context
Returns: Market overview, trends, regional context
Ask questions to an AI agricultural advisor powered by RAG.
Inputs:
message(string): Your questioncontext(object, optional): Location, soil, weather, crop, and economic data
Returns: Evidence-based answer with source citations
Check API health status and database connection.
Returns: API status, database connectivity, timestamp
- Python 3.10 or higher
- Running Plantos API instance
- API key for Plantos API
- Install dependencies:
cd mcp-server
pip install -r requirements.txt- Configure environment:
cp .env.example .env
# Edit .env with your settings:
# PLANTOS_API_URL=http://localhost:8000
# PLANTOS_API_KEY=your-api-key-here- Test the server:
python src/plantos_mcp_server.pyAdd this configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"plantos": {
"command": "python",
"args": [
"/absolute/path/to/plantos/mcp-server/src/plantos_mcp_server.py"
],
"env": {
"PLANTOS_API_URL": "http://localhost:8000",
"PLANTOS_API_KEY": "your-api-key-here"
}
}
}
}Replace /absolute/path/to/plantos/ with the actual path to your installation.
After adding the configuration, restart Claude Desktop. You should see the Plantos tools available in the tools menu.
Ask Claude: "Analyze the farming potential for coordinates 42.3601, -71.0589"
Claude will use the analyze_farm_location tool and provide:
- Soil analysis
- Weather conditions
- Crop recommendations with predicted yields
- Market prices
- Economic analysis showing expected profits
Ask Claude: "What are the current prices for corn and soybeans in Iowa?"
Claude will use get_market_data with location context to provide:
- Current spot prices
- Futures prices
- Price trends
- Regional adjustments
Ask Claude: "What are the best practices for improving soil health in sandy soils?"
Claude will use chat_with_agricultural_advisor to provide:
- Evidence-based recommendations
- Source citations from agricultural research
- Practical implementation steps
Ask Claude: "I'm at 41.8781, -87.6298 and want to maximize profit.
What crops should I plant and what's the expected return?"
Claude will:
1. Use analyze_farm_location to get comprehensive data
2. Use chat_with_agricultural_advisor for strategic advice
3. Synthesize results into actionable recommendations
┌─────────────────┐
│ Claude Desktop │
└────────┬────────┘
│ MCP Protocol
│
┌────────▼────────┐
│ Plantos MCP │
│ Server │
└────────┬────────┘
│ HTTP/REST
│
┌────────▼────────┐
│ Plantos API │
│ (FastAPI) │
└────────┬────────┘
│
┌────┴────┬──────────┬───────────┐
│ │ │ │
┌───▼───┐ ┌──▼──┐ ┌────▼────┐ ┌───▼───┐
│ SSURGO│ │NOAA │ │ USDA │ │ ML │
│ Soil │ │ API │ │ MARS │ │ Model │
└───────┘ └─────┘ └─────────┘ └───────┘
mcp-server/
├── src/
│ └── plantos_mcp_server.py # Main MCP server implementation
├── pyproject.toml # Python project configuration
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── claude_desktop_config.json # Claude Desktop config example
└── README.md # This file
- Start your Plantos API:
cd farming-advisor-api
python run.py- Run the MCP server:
cd mcp-server
python src/plantos_mcp_server.py- Test in Claude Desktop:
- Add configuration to claude_desktop_config.json
- Restart Claude Desktop
- Try asking Claude to use Plantos tools
Enable debug logging:
export MCP_DEBUG=1
python src/plantos_mcp_server.pyCheck Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\Logs\mcp*.log
- Store API keys securely in environment variables
- Use HTTPS for production API endpoints
- Implement rate limiting on the API side
- Never commit .env files to version control
- Ensure Plantos API is running on the configured URL
- Check PLANTOS_API_URL in your configuration
- Verify firewall settings
- Verify PLANTOS_API_KEY is correct
- Check API key is active in Plantos database
- Ensure API key has proper permissions
- Verify claude_desktop_config.json syntax
- Check file paths are absolute, not relative
- Restart Claude Desktop completely
- Check Claude Desktop logs for errors
- Verify location coordinates are valid
- Check Plantos API has data for that region
- Try a different location (e.g., Iowa farmland)
- Tool calls typically complete in 2-5 seconds
- Weather data cached by NOAA API
- Market data updates every 15 minutes
- Concurrent tool calls supported
- Weather data only available for US locations (NOAA restriction)
- Soil data coverage limited to SSURGO database areas
- Market data may have slight delays (~15 minutes)
- RAG chat requires OpenAI API key or configured LLM
- Add real-time weather alerts
- Support international locations
- Add field boundary analysis
- Implement crop rotation planning
- Add pest and disease prediction
- Support multi-year planning
- Add irrigation optimization
For issues or questions:
- API Issues: Check farming-advisor-api logs
- MCP Issues: Check Claude Desktop logs
- Documentation: See Plantos main README
Same license as Plantos project.
Built on:
- Model Context Protocol by Anthropic
- Plantos API
- SSURGO soil database (USDA NRCS)
- NOAA Weather.gov API
- USDA MARS commodity data