Plantos MCP Server

Plantos MCP Server

Enables AI assistants to analyze farm locations, retrieve soil and weather data, access commodity market prices, and chat with an agricultural advisor for farming recommendations.

Category
访问服务器

README

Plantos MCP Server

Model Context Protocol (MCP) server that exposes the Plantos agricultural intelligence API as tools for Claude and other AI assistants.

Overview

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

Available Tools

1. analyze_farm_location

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

2. get_soil_data

Get detailed soil properties using SSURGO database.

Inputs:

  • latitude (number): Latitude coordinate
  • longitude (number): Longitude coordinate

Returns: Soil texture, drainage, pH, organic matter, composition

3. get_weather_data

Get current weather data from NOAA Weather.gov API.

Inputs:

  • latitude (number): Latitude coordinate
  • longitude (number): Longitude coordinate

Returns: Temperature, precipitation, humidity, growing degree days, wind data

4. get_market_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 adjustments
  • longitude (number, optional): For regional price adjustments

Returns: Current prices, futures prices, price trends

5. get_market_summary

Get comprehensive market summary with location-based insights.

Inputs:

  • latitude (number, optional): For regional context
  • longitude (number, optional): For regional context

Returns: Market overview, trends, regional context

6. chat_with_agricultural_advisor

Ask questions to an AI agricultural advisor powered by RAG.

Inputs:

  • message (string): Your question
  • context (object, optional): Location, soil, weather, crop, and economic data

Returns: Evidence-based answer with source citations

7. get_api_health

Check API health status and database connection.

Returns: API status, database connectivity, timestamp

Installation

Prerequisites

  • Python 3.10 or higher
  • Running Plantos API instance
  • API key for Plantos API

Setup

  1. Install dependencies:
cd mcp-server
pip install -r requirements.txt
  1. Configure environment:
cp .env.example .env
# Edit .env with your settings:
# PLANTOS_API_URL=http://localhost:8000
# PLANTOS_API_KEY=your-api-key-here
  1. Test the server:
python src/plantos_mcp_server.py

Integration with Claude Desktop

Add 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.

Restart Claude Desktop

After adding the configuration, restart Claude Desktop. You should see the Plantos tools available in the tools menu.

Usage Examples

Example 1: Analyze a Farm Location

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

Example 2: Get Market Insights

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

Example 3: Chat with Agricultural Advisor

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

Example 4: Complete Farm Planning

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

Architecture

┌─────────────────┐
│  Claude Desktop │
└────────┬────────┘
         │ MCP Protocol
         │
┌────────▼────────┐
│  Plantos MCP    │
│     Server      │
└────────┬────────┘
         │ HTTP/REST
         │
┌────────▼────────┐
│  Plantos API    │
│   (FastAPI)     │
└────────┬────────┘
         │
    ┌────┴────┬──────────┬───────────┐
    │         │          │           │
┌───▼───┐ ┌──▼──┐  ┌────▼────┐ ┌───▼───┐
│ SSURGO│ │NOAA │  │  USDA   │ │  ML   │
│  Soil │ │ API │  │  MARS   │ │ Model │
└───────┘ └─────┘  └─────────┘ └───────┘

Development

Project Structure

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

Testing

  1. Start your Plantos API:
cd farming-advisor-api
python run.py
  1. Run the MCP server:
cd mcp-server
python src/plantos_mcp_server.py
  1. Test in Claude Desktop:
    • Add configuration to claude_desktop_config.json
    • Restart Claude Desktop
    • Try asking Claude to use Plantos tools

Debugging

Enable debug logging:

export MCP_DEBUG=1
python src/plantos_mcp_server.py

Check Claude Desktop logs:

  • macOS: ~/Library/Logs/Claude/mcp*.log
  • Windows: %APPDATA%\Claude\Logs\mcp*.log

Security

  • 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

Troubleshooting

"Connection refused" errors

  • Ensure Plantos API is running on the configured URL
  • Check PLANTOS_API_URL in your configuration
  • Verify firewall settings

"Authentication failed" errors

  • Verify PLANTOS_API_KEY is correct
  • Check API key is active in Plantos database
  • Ensure API key has proper permissions

Tools not appearing in Claude Desktop

  • Verify claude_desktop_config.json syntax
  • Check file paths are absolute, not relative
  • Restart Claude Desktop completely
  • Check Claude Desktop logs for errors

"No data available" responses

  • Verify location coordinates are valid
  • Check Plantos API has data for that region
  • Try a different location (e.g., Iowa farmland)

Performance

  • Tool calls typically complete in 2-5 seconds
  • Weather data cached by NOAA API
  • Market data updates every 15 minutes
  • Concurrent tool calls supported

Limitations

  • 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

Future Enhancements

  • [ ] 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

Support

For issues or questions:

  • API Issues: Check farming-advisor-api logs
  • MCP Issues: Check Claude Desktop logs
  • Documentation: See Plantos main README

License

Same license as Plantos project.

Credits

Built on:

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选