USDA MCP Server
USDA MCP-Server
MCP-Server, der die APIs von USDA NASS QuickStats und AMS Market News mit jedem MCP-kompatiblen KI-Modell verbindet. Dies ermöglicht Landwirten, Forschern und USDA-Mitarbeitern, Fragen zu US-Agrardaten in natürlicher Sprache zu stellen und präzise, datengestützte Antworten zu erhalten.
Entwickelt für den Challenge X Hackathon – 28. Februar bis 18. April 2026. Team: Root Access
Was dieses Tool leistet
Landwirte, Forscher und USDA-Mitarbeiter können Fragen zu US-Agrardaten in natürlicher Sprache stellen und erhalten präzise, datengestützte Antworten – ohne wissen zu müssen, was eine API ist oder wie man die Daten selbst findet.
Historische Daten (NASS QuickStats)
"Wie hoch war der Maisertrag in Iowa im Jahr 2022?"
"Wie hat sich die Sojaproduktion in Illinois von 2018 bis 2022 entwickelt?"
"Wie viele Hektar Weizen wurden 2021 in Kansas gepflanzt?"
"Welchen Preis erhielten Landwirte in Iowa für Mais im Jahr 2022?"
"Wie hoch war die nationale Maisproduktion im Jahr 2022?"
Aktuelle Marktpreise (AMS Market News)
"Was ist der aktuelle Maispreis in Iowa?"
"Was ist der heutige Sojapreis in Illinois?"
"Wo sollte ich mein Soja verkaufen – Iowa, Illinois oder Nebraska?"
"Was ist der aktuelle Weizenpreis in Kansas?"
Related MCP server: USDA NASS MCP Server
Tools
Der Server stellt 4 MCP-Tools bereit:
Tool | Datenquelle | Funktion |
| NASS QuickStats | Schnelle Abfrage von Mais- und Sojaertrag, Anbaufläche, Produktion und erhaltenem Preis für jedes Bundesland und Jahr |
| NASS QuickStats | Jede Kultur, jede Statistik, mehrjährige Trends, Daten auf nationaler oder County-Ebene |
| AMS Market News | Aktuelle Getreidepreise nach Standort |
| AMS Market News | Vergleich aktueller Preise über mehrere Bundesstaaten hinweg, um den besten Markt zu finden |
Projektstruktur
usda-mcp/
├── clients/
│ ├── nass_client.py # NASS QuickStats API wrapper
│ └── ams_client.py # AMS Market News API wrapper
├── server/
│ ├── main.py # MCP server — 4 tools
│ ├── security.py # OWASP MCP Top 10 mitigations
│ └── tools/
│ └── __init__.py
├── tests/
│ └── qa_log.csv # Q&A evaluation log
├── demo/
│ └── app.py # Demo interface (planned)
├── logs/
│ └── usda_nass_server.log # Auto-generated server log
├── .env # API keys (never committed)
├── .env.example # Template for API keys
├── requirements.txt # Pinned dependencies
├── SECURITY.md # OWASP MCP Top 10 documentation
└── README.mdEinrichtung
1. Repository klonen
git clone https://github.com/RolakeOkans/usda-mcp.git
cd usda-mcp2. Virtuelle Umgebung erstellen
python -m venv .venv
source .venv/bin/activate3. Abhängigkeiten installieren
pip install -r requirements.txt4. Eine .env-Datei im Stammverzeichnis erstellen
NASS_API_KEY=your_nass_key_here
AMS_API_KEY=your_ams_key_here5. API-Schlüssel abrufen
NASS: Registrierung unter https://www.nass.usda.gov/developer/index.php
AMS: Registrierung unter https://mymarketnews.ams.usda.gov
Beide sind kostenlos und werden innerhalb weniger Minuten ausgestellt.
Verbindung zu Claude Desktop
Fügen Sie dies zu ~/Library/Application Support/Claude/claude_desktop_config.json hinzu:
{
"mcpServers": {
"usda-nass": {
"command": "/path/to/your/python",
"args": ["/path/to/usda-mcp/server/main.py"],
"env": {
"NASS_API_KEY": "your_key_here",
"AMS_API_KEY": "your_key_here"
}
}
}
}Ersetzen Sie die Pfade durch Ihre tatsächlichen Python- und Projektpfade.
Verifizierte Daten — NASS QuickStats
Alle Abfragen wurden für Iowa, 2022, getestet und bestätigt.
Ware | Statistik | Ergebnis Iowa 2022 |
Mais | Anbaufläche | 12.900.000 ACRES |
Mais | Ertrag | 200 BU / ACRE |
Mais | Produktion | 2.470.000.000 BU |
Mais | Erhaltener Preis | $6.62 / BU |
Soja | Anbaufläche | 10.100.000 ACRES |
Soja | Ertrag | 58.5 BU / ACRE |
Soja | Produktion | 586.755.000 BU |
Soja | Erhaltener Preis | $14.20 / BU |
Verifizierte Daten — AMS Market News
Aktuelle Preise bestätigt, Stand 2. April 2026.
Ware | Standort | Preis |
Mais | Minneapolis | $4.08 / bu |
Soja | Minneapolis | $11.10 / bu |
Mais | Iowa | $4.12 / bu |
Mais | Texas | $4.90 / bu |
Soja | Illinois | $11.76 / bu |
Weizen | Kansas | $5.34 / bu |
Datenquellen
Quelle | Abdeckung | Status |
NASS QuickStats | Anbaufläche, Ertrag, Produktion, erhaltener Preis — jede Kultur, jedes Bundesland, jedes Jahr | Funktioniert |
AMS Market News | Aktuelle Getreidepreise an Silos — 19 Bundesstaaten + dynamische Suche | Funktioniert |
AMS Socrata | Transportkosten und -volumina | Zielvorgabe |
ERS | Preisprognosen | Zielvorgabe |
Funktionsweise
User asks a plain English question
↓
AI model reads the question and decides which tool to call
↓
MCP server validates and sanitizes the input
↓
NASS or AMS API returns the raw data
↓
Server scans response for security issues
↓
AI model interprets the data and returns a plain English answer
↓
All tool calls logged to logs/usda_nass_server.logSicherheit
Dieser Server adressiert alle 10 OWASP MCP Top 10 Risiken. Siehe SECURITY.md für vollständige Details.
Zusammenfassung:
API-Schlüssel werden in
.envgespeichert, niemals committet und aus allen Protokollen entferntNur-Lese-Server — nur GET-Anfragen, kein Schreibzugriff auf USDA-Systeme
Eingabesanitisierung bei allen Tool-Argumenten
Ratenbegrenzung auf 30 Anfragen pro Minute und Tool
Erkennung von Prompt-Injection bei allen API-Antworten
Vollständige Audit-Protokollierung jedes Tool-Aufrufs
Committen Sie niemals Ihre .env-Datei. Sie ist in .gitignore aufgeführt.
Team — Root Access
Rolle | Inhaber | Verantwortlichkeiten |
Daten / APIs | Morolake | API-Recherche, NASS-Client, AMS-Client, MCP-Server, Sicherheit |
MCP / KI-Ebene | [Gabriela] | KI-Ebene, Demo-UI |
Evaluierung / Sicherheit | [Neyssa] | Q&A-Tests, Genauigkeitsmetriken |
Hackathon
Challenge X+ USDA Zeitplan: 28. Februar bis 18. April 2026 Präsentation: 18. April 2026
This server cannot be deployed
Maintenance
Related MCP Connectors
USDA farm data for AI agents: grain, fertilizer, WASDE, export sales. 27 tools, free, no key.
USDA farmland values and county cash rents for AI agents. NASS data, 3 tools, free, no key.
AI-powered commodity price forecasts and Brazil trade intelligence via MCP. Access Brazilian exports and imports from MDIC/ComexStat since 2000, by HS4, HS6 and NCM code, partner country, USD FOB and kilograms — plus crop production, supply & demand, climate data and production forecasts for major commodities including soybeans, coffee, corn, beef and cocoa. Compare trade flows, markets, countries and time periods with like-for-like windows. Every answer identifies the measurement period and data source. 15 read-only tools. Metered in credits. Connect directly via Streamable HTTP — no installation required: https://mcp.kyrodata.com/mcp Authentication: Bearer key or OAuth 2.1 (PKCE). Official MCP registry: com.kyrodata/kyrodata
- PampaIA.arOAuthar.pampaia
Official Argentina farm data: crops, cattle, grain prices, agro exports, weather. With sources.
Related MCP Servers
AlicenseNot gradedqualityFmaintenanceEnables AI assistants to analyze farm locations, retrieve soil and weather data, access commodity market prices, and chat with an agricultural advisor for farming recommendations.MIT- FlicenseNot gradedqualityDmaintenanceEnables access to USDA NASS agricultural statistics data through natural language queries, supporting full dataset retrieval, record counts, and parameter discovery.4-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access free, open agronomic data for field briefings, spray windows, water balance, pest pressure, and more, using only public data sources without API keys.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables querying iCrop farm management data including farms, crops, fields, soil types, and cultivation methods through natural language.-