@ancientwhispers54/leafengines-mcp-server 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -217
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -176
- package/dist/index.js.map +1 -1
- package/package.json +5 -15
package/README.md
CHANGED
|
@@ -1,154 +1,44 @@
|
|
|
1
|
+
# LeafEngines MCP Server — Agricultural Intelligence for AI Agents
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
**Patent-protected soil analysis, crop recommendations, and environmental intelligence** via Model Context Protocol. 1,092+ downloads. Works with Claude Desktop, Cursor, OpenClaw, and any MCP-compatible client.
|
|
3
4
|
|
|
4
|
-
##
|
|
5
|
+
## ⚡ Get Started Now
|
|
5
6
|
|
|
6
|
-
**
|
|
7
|
+
**Free tier — no signup, no credit card:**
|
|
8
|
+
- **Test key:** `leaf-test-370df0a2e62e` (paste into config, works immediately)
|
|
9
|
+
- **Free header:** `x-free-tier: true` (no key needed at all)
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
**Ready for production? Founder pricing ends June 1, 2026:**
|
|
12
|
+
- [Starter — $10/mo → lifetime $49/mo lock →](https://buy.stripe.com/14A7sL30y8bR2F4fbgaMU02)
|
|
13
|
+
- [Pro — $49/mo → lifetime $149/mo lock →](https://buy.stripe.com/cNi3cv1WuajZcfE7IOaMU03)
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
2. **Immediate access** to all features
|
|
12
|
-
3. **No forms, no waiting, no approval**
|
|
13
|
-
4. **Works across all platforms**
|
|
14
|
-
|
|
15
|
-
**Test key gives you:**n- Full soil analysis capabilitiesn- Crop recommendationsn- Weather datan- Environmental impact assessmentn- All free tier features
|
|
15
|
+
**Get a professional soil report (no coding required):** [soilcertify.com →](https://soilcertify.com)
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
**Plugin ID:** 4987 (LeafEngines Agricultural Intelligence)
|
|
22
|
-
**Version:** 1.0.2 Experimental
|
|
23
|
-
**Status:** ✅ **PUBLICLY AVAILABLE**
|
|
24
|
-
**Download:** https://plugins.qgis.org/plugins/qgis_leafengines/version/1.0.2/download/
|
|
25
|
-
|
|
26
|
-
### Key Features:
|
|
27
|
-
- **USDA soil data** - Soil composition, pH, N/P/K recommendations
|
|
28
|
-
- **EPA water quality** - Water quality metrics and analysis
|
|
29
|
-
- **NOAA climate data** - Historical weather patterns and agricultural forecasting
|
|
30
|
-
- **Satellite vegetation indices** - NDVI, water-stress overlays from NASA MODIS
|
|
31
|
-
- **AI-powered crop recommendations** - Tailored to exact field polygons
|
|
32
|
-
- **Carbon credit calculations** - Environmental impact scoring for regulatory compliance
|
|
33
|
-
- **Offline-first architecture** - Works in remote/"deep canopy" areas
|
|
34
|
-
- **GPS-denied capabilities** - Military-proven algorithms for contested environments
|
|
35
|
-
|
|
36
|
-
### Strategic Advantages for Partners:
|
|
37
|
-
1. **Pre-vetted, low-risk integration** - Officially approved by QGIS after rigorous review
|
|
38
|
-
2. **Seamless future-proofing** - Aligns with QGIS release cycles (QGIS 4.0.0+ ready)
|
|
39
|
-
3. **Instant credibility** - Discoverable by 500,000+ QGIS users in agriculture sector
|
|
40
|
-
4. **Regulatory advantage** - Preferred for government/EPA/USDA-related procurements
|
|
41
|
-
5. **Ecosystem power** - Integrates with thousands of complementary QGIS plugins
|
|
42
|
-
|
|
43
|
-
### For OEM Partners:
|
|
44
|
-
Embed LeafEngines agricultural intelligence directly into your hardware or software platforms with confidence. The official QGIS approval eliminates weeks of custom validation, security audits, and compatibility testing.
|
|
45
|
-
|
|
46
|
-
*Approved: April 14, 2026*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# @ancientwhispers54/leafengines-mcp-server
|
|
50
|
-
|
|
51
|
-
LeafEngines MCP Server - Agricultural intelligence for AI agents
|
|
52
|
-
|
|
53
|
-
## 🎯 What is MCP?
|
|
54
|
-
|
|
55
|
-
**Model Context Protocol (MCP)** is a standard for co
|
|
56
|
-
|
|
57
|
-
ecting AI assistants to external data sources and tools. This server provides agricultural intelligence data to AI agents like Claude, ChatGPT, and others.
|
|
58
|
-
|
|
59
|
-
## ✨ Features
|
|
60
|
-
|
|
61
|
-
- **Soil Intelligence:** USDA soil data analysis
|
|
62
|
-
- **Water Quality:** EPA monitoring data
|
|
63
|
-
- **Climate Insights:** NOAA historical records
|
|
64
|
-
- **Agricultural Recommendations:** Location-specific advice
|
|
65
|
-
- **AI-Native:** Built specifically for AI agent consumption
|
|
66
|
-
|
|
67
|
-
## 🚀 v2.0.0 Enhanced Experience
|
|
19
|
+
## 🌾 What It Does
|
|
68
20
|
|
|
69
|
-
|
|
21
|
+
LeafEngines gives AI agents real-time agricultural intelligence from USDA, EPA, and NOAA data:
|
|
70
22
|
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
23
|
+
- **Soil Analysis** — pH, nutrients, organic matter, drainage, recommendations for any US county
|
|
24
|
+
- **Crop Recommendations** — Location-specific planting advice based on soil and climate
|
|
25
|
+
- **Environmental Impact** — Carbon credits, sustainability scoring, compliance data
|
|
26
|
+
- **Water Quality** — EPA monitoring data and contamination risk assessment
|
|
27
|
+
- **Climate Insights** — NOAA historical records and agricultural forecasting
|
|
28
|
+
- **TurboQuant Check** — Hardware optimization for edge/offline deployment (always free)
|
|
76
29
|
|
|
77
|
-
|
|
78
|
-
- Detailed error explanations with solutions
|
|
79
|
-
- Context-aware troubleshooting
|
|
80
|
-
- Links to relevant documentation
|
|
81
|
-
- Reduced debugging time by 70%
|
|
82
|
-
|
|
83
|
-
**✨ 30% Performance Boost**
|
|
84
|
-
- Optimized data processing pipeline
|
|
85
|
-
- Reduced latency for common queries
|
|
86
|
-
- Better caching strategies
|
|
87
|
-
- Smoother user experience
|
|
88
|
-
|
|
89
|
-
**✨ Enhanced Free Tier**
|
|
90
|
-
- 50% more free requests per month
|
|
91
|
-
- Extended rate limits
|
|
92
|
-
- Additional data sources available
|
|
93
|
-
- Better onboarding experience
|
|
94
|
-
|
|
95
|
-
### 🛠️ Infrastructure Improvements
|
|
96
|
-
- **New dedicated support:** support@soilsidekickpro.com (24-hour response)
|
|
97
|
-
- **Enhanced documentation:** Comprehensive guides and examples
|
|
98
|
-
- **Improved reliability:** 99.9% uptime monitoring
|
|
99
|
-
|
|
100
|
-
### 💰 Extended Founder Pricing
|
|
101
|
-
Due to community feedback, we're extending founder pricing through **June 1, 2026**:
|
|
102
|
-
- **Starter:** $10/mo → $49/mo lifetime lock (Save $100/mo)
|
|
103
|
-
- **Pro:** $49/mo → $149/mo lifetime lock (Save $350/mo)
|
|
104
|
-
- **Limited to first 100 founders** - lock in lifetime savings!
|
|
105
|
-
|
|
106
|
-
🔗 **Get Started:**
|
|
107
|
-
- **Enhanced Free Tier:** Try the new features
|
|
108
|
-
- **Starter Plan:** https://buy.stripe.com/14A7sL30y8bR2F4fbgaMU02
|
|
109
|
-
- **Pro Plan:** https://buy.stripe.com/cNi3cv1WuajZcfE7IOaMU03
|
|
110
|
-
|
|
111
|
-
## 📦 Installation
|
|
112
|
-
|
|
113
|
-
### Prerequisites
|
|
114
|
-
- Node.js 18 or higher
|
|
115
|
-
- An MCP-compatible AI assistant (Claude Desktop, Cursor, etc.)
|
|
30
|
+
## 🚀 Quick Start
|
|
116
31
|
|
|
117
|
-
###
|
|
32
|
+
### Step 1: Install
|
|
118
33
|
|
|
119
34
|
```bash
|
|
120
35
|
npm install -g @ancientwhispers54/leafengines-mcp-server
|
|
121
36
|
```
|
|
122
37
|
|
|
123
|
-
###
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npm install @ancientwhispers54/leafengines-mcp-server
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## 🚀 Quick Start
|
|
130
|
-
|
|
131
|
-
### 1. Get Your API Key
|
|
132
|
-
|
|
133
|
-
#### **Test API (Try Now):**
|
|
134
|
-
Use test key: `leaf-test-370df0a2e62e`
|
|
135
|
-
|
|
136
|
-
**Works with just county_fips:**
|
|
137
|
-
```json
|
|
138
|
-
{
|
|
139
|
-
"county_fips": "12086"
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
#### **Free Tier (No API Key):**
|
|
144
|
-
Use header: `x-free-tier: true`
|
|
38
|
+
### Step 2: Configure
|
|
145
39
|
|
|
146
|
-
|
|
147
|
-
Request at: https://soilsidekickpro.com/api-docs
|
|
40
|
+
**For Claude Desktop** — add to `~/.config/claude-desktop/mcp.json`:
|
|
148
41
|
|
|
149
|
-
### 2. Configure Your AI Assistant
|
|
150
|
-
|
|
151
|
-
**For Claude Desktop:**
|
|
152
42
|
```json
|
|
153
43
|
{
|
|
154
44
|
"mcpServers": {
|
|
@@ -163,122 +53,171 @@ Request at: https://soilsidekickpro.com/api-docs
|
|
|
163
53
|
}
|
|
164
54
|
```
|
|
165
55
|
|
|
166
|
-
**For Cursor
|
|
167
|
-
Add to your Cursor MCP configuration with API key.
|
|
56
|
+
**For Cursor** — add to your Cursor MCP configuration with the same API key.
|
|
168
57
|
|
|
169
|
-
### 3
|
|
58
|
+
### Step 3: Ask
|
|
170
59
|
|
|
171
|
-
|
|
172
|
-
- Soil analysis tools (USDA data)
|
|
173
|
-
- Water quality data (EPA monitoring)
|
|
174
|
-
- Climate information (NOAA records)
|
|
175
|
-
- Agricultural intelligence
|
|
60
|
+
> "What's the soil like in Fulton County, Georgia for corn planting?"
|
|
176
61
|
|
|
177
|
-
|
|
62
|
+
Your AI agent will use LeafEngines tools automatically to analyze soil, recommend crops, and provide environmental context.
|
|
178
63
|
|
|
179
|
-
|
|
180
|
-
Get comprehensive soil data for any US county.
|
|
181
|
-
|
|
182
|
-
**Parameters:**
|
|
183
|
-
- `county_fips` (string): 5-digit FIPS code (e.g., "12086" for Miami-Dade, FL)
|
|
64
|
+
## 🔧 Available Tools
|
|
184
65
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
66
|
+
| Tool | What It Returns | Tier |
|
|
67
|
+
|------|----------------|------|
|
|
68
|
+
| `get_soil_analysis` | USDA SSURGO soil composition, pH, NPK, drainage, recommendations | Commoditized |
|
|
69
|
+
| `county_lookup` | Resolve location names to FIPS codes | Commoditized |
|
|
70
|
+
| `territorial_water_quality` | EPA water quality and contamination risk scores | Commoditized |
|
|
71
|
+
| `agricultural_intelligence` | AI-powered agricultural insights and recommendations | Enhanced |
|
|
72
|
+
| `safe_identification` | Plant identification with toxic lookalike warnings | Enhanced |
|
|
73
|
+
| `carbon_credit_calculator` | Carbon credit potential using proprietary models | Proprietary |
|
|
74
|
+
| `generate_vrt_prescription` | Variable rate technology prescription maps | Proprietary |
|
|
75
|
+
| `environmental_impact_analysis` | Patent-pending Environmental Compatibility Score with satellite data fusion | Exclusive |
|
|
76
|
+
| `planting_optimization` | Multi-parameter phenology models for optimal planting windows | Exclusive |
|
|
77
|
+
| `turbo_quant_capabilities` | Hardware optimization check — **always free, no auth required** | Free |
|
|
78
|
+
|
|
79
|
+
## 💰 Pricing
|
|
80
|
+
|
|
81
|
+
### Free Tier — No Credit Card
|
|
82
|
+
- **Test key:** `leaf-test-370df0a2e62e` — works immediately
|
|
83
|
+
- **Free header:** `x-free-tier: true` — no key needed
|
|
84
|
+
- **Includes:** Basic soil analysis, county lookup, TurboQuant check
|
|
85
|
+
- [Start free →](https://soilcertify.com)
|
|
86
|
+
|
|
87
|
+
### Pay-As-You-Go
|
|
88
|
+
|
|
89
|
+
| Tier | Price | Per-Call Rate | What You Get | Buy |
|
|
90
|
+
|------|-------|--------------|--------------|-----|
|
|
91
|
+
| Commoditized | $0.50/bundle | $0.001/call | Basic soil/weather, county lookup | [Buy →](https://buy.stripe.com/3cIdR99oWajZdjI6EKaMU07) |
|
|
92
|
+
| Enhanced | $1.50/bundle | $0.003/call | Environmental impact, crop suitability, water quality | [Buy →](https://buy.stripe.com/7sY28reJg1NtenM8MSaMU0b) |
|
|
93
|
+
| Proprietary | $5.00/bundle | $0.010/call | Planting optimization, carbon credits, VRT | [Buy →](https://buy.stripe.com/3cIeVd9oW1NtgvU1kqaMU09) |
|
|
94
|
+
| Exclusive | $10.00/bundle | $0.020/call | Patent-pending environmental compatibility scoring | [Buy →](https://buy.stripe.com/6oU4gzbx40Jp6Vk1kqaMU0a) |
|
|
95
|
+
|
|
96
|
+
### Monthly Subscriptions
|
|
97
|
+
|
|
98
|
+
| Plan | Price | Included Calls | Best For | Subscribe |
|
|
99
|
+
|------|-------|---------------|----------|-----------|
|
|
100
|
+
| **Founder Starter** | $10/mo → lifetime $49/mo | 10,000/mo | Solo developers, prototyping | [Subscribe →](https://buy.stripe.com/14A7sL30y8bR2F4fbgaMU02) |
|
|
101
|
+
| **Founder Pro** | $49/mo → lifetime $149/mo | 35,000/mo | Production apps, teams | [Subscribe →](https://buy.stripe.com/cNi3cv1WuajZcfE7IOaMU03) |
|
|
102
|
+
| Starter | $149/mo | 10,000/mo | Solo developers, prototyping | [Subscribe →](https://buy.stripe.com/5kQ6oHcB88bR93s8MSaMU04) |
|
|
103
|
+
| Pro | $499/mo | 35,000/mo | Production apps, teams | [Subscribe →](https://buy.stripe.com/14A6oH7gO3VBcfE1kqaMU05) |
|
|
104
|
+
| Enterprise | $1,999/mo | 175,000+/mo | White-label, SLA, OEM | [Subscribe →](https://buy.stripe.com/eVqaEXfNkajZ6Vk0gmaMU06) |
|
|
105
|
+
| Enterprise Bundle | $3,499/mo | 685,000/mo | Large OEM, max volume | Contact: sales@leafengines.com |
|
|
106
|
+
|
|
107
|
+
> ⏰ **Founder pricing expires June 1, 2026.** First 100 customers lock lifetime rates.
|
|
108
|
+
|
|
109
|
+
### International Pricing
|
|
110
|
+
|
|
111
|
+
| Region | Starter | Pro | Local Payment Methods |
|
|
112
|
+
|--------|---------|-----|----------------------|
|
|
113
|
+
| **United States** | $49/mo | $149/mo | Card, Apple Pay, Google Pay, Affirm |
|
|
114
|
+
| **European Union** | €45/mo (VAT incl.) | €135/mo (VAT incl.) | Klarna, iDEAL, EPS, Apple/Google Pay |
|
|
115
|
+
| **United Kingdom** | £38/mo (VAT incl.) | £115/mo (VAT incl.) | Afterpay/Clearpay, Apple/Google Pay |
|
|
116
|
+
| **Australia** | AU$75/mo (GST incl.) | AU$225/mo (GST incl.) | Afterpay, Apple/Google Pay |
|
|
117
|
+
|
|
118
|
+
## 🔗 Integration Guides
|
|
119
|
+
|
|
120
|
+
### Claude Desktop
|
|
121
|
+
Add to `mcp.json` as shown in Quick Start above.
|
|
122
|
+
|
|
123
|
+
### OpenClaw
|
|
124
|
+
```yaml
|
|
125
|
+
skills:
|
|
126
|
+
leafengines:
|
|
127
|
+
enabled: true
|
|
128
|
+
config:
|
|
129
|
+
api_key: leaf-test-370df0a2e62e
|
|
130
|
+
base_url: https://app.soilsidekickpro.com/api-docs
|
|
190
131
|
```
|
|
191
|
-
- `depth` (string, optional): Soil depth (default: "0-30cm")
|
|
192
|
-
|
|
193
|
-
### `get_water_quality`
|
|
194
|
-
Retrieve EPA water quality data.
|
|
195
|
-
|
|
196
|
-
**Parameters:**
|
|
197
|
-
- `county` (string): County name
|
|
198
|
-
- `state` (string): State abbreviation
|
|
199
132
|
|
|
200
|
-
###
|
|
201
|
-
|
|
133
|
+
### Cursor
|
|
134
|
+
Add to your Cursor MCP configuration with the same API key.
|
|
202
135
|
|
|
203
|
-
|
|
204
|
-
- `
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
### `get_agricultural_recommendations`
|
|
208
|
-
Get farm-specific advice.
|
|
209
|
-
|
|
210
|
-
**Parameters:**
|
|
211
|
-
- `crop` (string): Crop type
|
|
212
|
-
- `location` (string): Growing location
|
|
213
|
-
- `season` (string): Planting season
|
|
136
|
+
### MCP Registry
|
|
137
|
+
- **Package:** `io.github.QWarranto/leafengines` version 1.1.5+
|
|
138
|
+
- **Registry:** [https://registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io)
|
|
214
139
|
|
|
215
140
|
## 📖 Examples
|
|
216
141
|
|
|
217
|
-
###
|
|
142
|
+
### Soil Analysis
|
|
218
143
|
```
|
|
219
|
-
User: "What's the soil like in
|
|
220
|
-
AI: [Uses get_soil_analysis] "The soil in
|
|
144
|
+
User: "What's the soil like in Travis County, Texas?"
|
|
145
|
+
AI: [Uses get_soil_analysis] "The soil in Travis County is primarily..."
|
|
221
146
|
```
|
|
222
147
|
|
|
223
|
-
###
|
|
224
|
-
|
|
225
|
-
ing
|
|
148
|
+
### Crop Planning
|
|
226
149
|
```
|
|
227
|
-
User: "I
|
|
150
|
+
User: "Should I plant corn or soybeans on my 100-acre field in Iowa?"
|
|
228
151
|
AI: [Uses multiple tools] "Based on soil analysis, water quality, and climate data..."
|
|
229
152
|
```
|
|
230
153
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
LEAFENGINES_API_KEY=your_api_key_here
|
|
236
|
-
MCP_PORT=3000 # Optional: Custom port
|
|
154
|
+
### Environmental Assessment
|
|
155
|
+
```
|
|
156
|
+
User: "What's the environmental impact of this property?"
|
|
157
|
+
AI: [Uses environmental_impact_analysis + carbon_credit_calculator] "Environmental Compatibility Score: 78/100..."
|
|
237
158
|
```
|
|
238
159
|
|
|
239
|
-
|
|
240
|
-
1. Sign up at [SoilSidekick Pro](https://soilsidekick.com)
|
|
241
|
-
2. Generate your API key
|
|
242
|
-
3. Set as environment variable
|
|
160
|
+
## 🎯 Use Cases
|
|
243
161
|
|
|
244
|
-
|
|
162
|
+
### For Agronomists & Soil Scientists
|
|
163
|
+
- **Field analysis** — USDA SSURGO data for any US county, instantly
|
|
164
|
+
- **Carbon credit assessment** — Proprietary models for compliance reporting
|
|
165
|
+
- **Environmental impact scoring** — Patent-pending satellite data fusion
|
|
166
|
+
- **Get professional reports without coding:** [soilcertify.com →](https://soilcertify.com)
|
|
245
167
|
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
168
|
+
### For Agricultural Consultants
|
|
169
|
+
- **Client-ready analysis** — Soil composition, drainage, NPK recommendations
|
|
170
|
+
- **Crop optimization** — Multi-parameter phenology for planting windows
|
|
171
|
+
- **Water quality assessment** — EPA data with contamination risk scores
|
|
172
|
+
- **Sell reports to clients:** [soilcertify.com →](https://soilcertify.com) (172%+ profit margin at $29/mo)
|
|
249
173
|
|
|
250
|
-
|
|
174
|
+
### For Developers & AI Engineers
|
|
175
|
+
- **MCP integration** — Works with Claude, Cursor, OpenClaw, any MCP client
|
|
176
|
+
- **TurboQuant optimization** — 6x memory compression for edge/offline deployment
|
|
177
|
+
- **Multi-agent orchestration** — 10 tools across 4 pricing tiers
|
|
178
|
+
- **API access** — Direct HTTP calls to Supabase edge functions
|
|
251
179
|
|
|
252
|
-
|
|
180
|
+
## 🛡️ Enterprise-Grade Governance
|
|
253
181
|
|
|
254
|
-
|
|
182
|
+
- ✅ **Complete audit logging** — Every tool call tracked with attribution
|
|
183
|
+
- ✅ **Operations dashboard** — Real-time monitoring and anomaly detection
|
|
184
|
+
- ✅ **PII protection** — Automatic sanitization of sensitive data
|
|
185
|
+
- ✅ **Compliance ready** — SOC 2 alignment, export capabilities
|
|
186
|
+
- ✅ **Session correlation** — Trace multi-step agent reasoning
|
|
255
187
|
|
|
256
|
-
##
|
|
188
|
+
## 🆓 Free Tier — No Commitment
|
|
257
189
|
|
|
258
|
-
|
|
190
|
+
**Two ways to test, zero friction:**
|
|
191
|
+
1. **Test key:** `leaf-test-370df0a2e62e` — paste into config, works immediately
|
|
192
|
+
2. **Free header:** `x-free-tier: true` — no API key needed at all
|
|
259
193
|
|
|
260
|
-
|
|
194
|
+
**What's included:**
|
|
195
|
+
- Basic soil analysis with county FIPS codes
|
|
196
|
+
- USDA soil data access
|
|
197
|
+
- TurboQuant capabilities check (always free)
|
|
198
|
+
- Enough requests for evaluation and prototyping
|
|
261
199
|
|
|
262
|
-
|
|
263
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
264
|
-
in the Software without restriction, including without limitation the rights
|
|
265
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
266
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
267
|
-
furnished to do so, subject to the following conditions:
|
|
200
|
+
## 🔗 Related Products
|
|
268
201
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
275
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
276
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
277
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
278
|
-
SOFTWARE.
|
|
202
|
+
- **[LeafEngines ClawHub Skill](https://github.com/QWarranto/leafengines-clawhub-skill)** — OpenClaw agent integration
|
|
203
|
+
- **[n8n Nodes](https://github.com/QWarranto/n8n-nodes-leafengines)** — n8n business automation
|
|
204
|
+
- **[Node-RED Nodes](https://github.com/QWarranto/node-red-contrib-leafengines)** — IoT/edge automation
|
|
205
|
+
- **[QGIS Plugin](https://plugins.qgis.org/plugins/qgis_leafengines/)** — 500,000+ QGIS users (Plugin ID 4987)
|
|
206
|
+
- **[SoilCertify](https://soilcertify.com)** — Professional soil reports, no coding required
|
|
279
207
|
|
|
280
208
|
## 📞 Support
|
|
281
209
|
|
|
282
|
-
- **Documentation:** [
|
|
283
|
-
- **
|
|
210
|
+
- **API Documentation:** [app.soilsidekickpro.com/api-docs](https://app.soilsidekickpro.com/api-docs)
|
|
211
|
+
- **MCP Documentation:** [app.soilsidekickpro.com/mcp](https://app.soilsidekickpro.com/mcp)
|
|
212
|
+
- **GitHub Issues:** [github.com/QWarranto/leafengines-claude-mcp/issues](https://github.com/QWarranto/leafengines-claude-mcp/issues)
|
|
284
213
|
- **Email:** support@soilsidekickpro.com
|
|
214
|
+
- **Partnerships:** partnerships@leafengines.com
|
|
215
|
+
|
|
216
|
+
## 📄 License
|
|
217
|
+
|
|
218
|
+
MIT License — integration code is open source. API service has commercial terms with free tier available. Core algorithms are patent-protected (U.S. #19/320,727, #19/544,827).
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
🌱 **LeafEngines™** | SoilSidekick Pro® | SoilCertify | SoilTech Suite, Inc.
|
|
223
|
+
*Space gives the picture. We give the truth.*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* LeafEngines MCP Server
|
|
3
|
+
* LeafEngines MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Agricultural intelligence MCP server with soil analysis, crop recommendations,
|
|
6
|
+
* weather forecasts, and environmental impact assessment.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Soil analysis and recommendations
|
|
10
|
+
* - Crop suitability scoring
|
|
11
|
+
* - Weather forecasting for agriculture
|
|
12
|
+
* - Environmental impact assessment
|
|
13
|
+
* - TurboQuant capabilities checking (FREE)
|
|
14
|
+
* - Anonymous usage analytics (opt-out available)
|
|
15
|
+
*
|
|
16
|
+
* API Documentation: https://app.soilsidekickpro.com/api-docs
|
|
17
|
+
* MCP Documentation: https://app.soilsidekickpro.com/mcp
|
|
4
18
|
*/
|
|
5
19
|
export {};
|
|
6
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
|
-
* LeafEngines MCP Server
|
|
4
|
+
* LeafEngines MCP Server
|
|
5
|
+
*
|
|
6
|
+
* Agricultural intelligence MCP server with soil analysis, crop recommendations,
|
|
7
|
+
* weather forecasts, and environmental impact assessment.
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Soil analysis and recommendations
|
|
11
|
+
* - Crop suitability scoring
|
|
12
|
+
* - Weather forecasting for agriculture
|
|
13
|
+
* - Environmental impact assessment
|
|
14
|
+
* - TurboQuant capabilities checking (FREE)
|
|
15
|
+
* - Anonymous usage analytics (opt-out available)
|
|
16
|
+
*
|
|
17
|
+
* API Documentation: https://app.soilsidekickpro.com/api-docs
|
|
18
|
+
* MCP Documentation: https://app.soilsidekickpro.com/mcp
|
|
5
19
|
*/
|
|
6
20
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -11,264 +25,227 @@ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
|
11
25
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
12
26
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
13
27
|
const axios_1 = __importDefault(require("axios"));
|
|
14
|
-
|
|
15
|
-
// Simple logging (will be replaced with Pino later)
|
|
16
|
-
const log = {
|
|
17
|
-
info: (message, data) => console.log(JSON.stringify({ level: 'INFO', message, ...data })),
|
|
18
|
-
error: (message, error, data) => console.error(JSON.stringify({ level: 'ERROR', message, error: error?.message, ...data })),
|
|
19
|
-
businessEvent: (event, data) => console.log(JSON.stringify({ level: 'INFO', event: 'business', type: event, ...data }))
|
|
20
|
-
};
|
|
21
|
-
// Telemetry configuration
|
|
22
|
-
const TELEMETRY_API_KEY = process.env.TELEMETRY_API_KEY || '';
|
|
23
|
-
const TELEMETRY_URL = process.env.TELEMETRY_URL || 'https://leafengines-telemetry.onrender.com/v1/usage';
|
|
24
|
-
const TELEMETRY_ENABLED = Boolean(TELEMETRY_API_KEY);
|
|
25
|
-
// Telemetry helper function
|
|
26
|
-
async function sendTelemetry(platform, version, feature, success, responseTimeMs, anonymousId, country) {
|
|
27
|
-
if (!TELEMETRY_ENABLED) {
|
|
28
|
-
return; // Telemetry disabled
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const telemetryData = {
|
|
32
|
-
platform,
|
|
33
|
-
version,
|
|
34
|
-
feature,
|
|
35
|
-
success,
|
|
36
|
-
response_time_ms: responseTimeMs,
|
|
37
|
-
anonymous_id: anonymousId,
|
|
38
|
-
country,
|
|
39
|
-
timestamp: new Date().toISOString()
|
|
40
|
-
};
|
|
41
|
-
// Send telemetry asynchronously (don't wait for response)
|
|
42
|
-
axios_1.default.post(TELEMETRY_URL, telemetryData, {
|
|
43
|
-
headers: {
|
|
44
|
-
'Content-Type': 'application/json',
|
|
45
|
-
'X-API-Key': TELEMETRY_API_KEY
|
|
46
|
-
},
|
|
47
|
-
timeout: 5000 // 5 second timeout
|
|
48
|
-
}).catch((error) => {
|
|
49
|
-
// Silently fail - telemetry shouldn't break MCP functionality
|
|
50
|
-
log.error('Telemetry send failed', error, { feature });
|
|
51
|
-
});
|
|
52
|
-
log.info('Telemetry sent', { feature, success, responseTimeMs });
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
// Silently fail - telemetry shouldn't break MCP functionality
|
|
56
|
-
log.error('Telemetry preparation failed', error, { feature });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// MCP Server
|
|
28
|
+
// MCP Server implementation
|
|
60
29
|
const server = new index_js_1.Server({
|
|
61
30
|
name: "leafengines",
|
|
62
|
-
version: "
|
|
31
|
+
version: "1.1.8",
|
|
63
32
|
}, {
|
|
64
33
|
capabilities: {
|
|
65
34
|
tools: {},
|
|
66
35
|
},
|
|
67
36
|
});
|
|
68
|
-
//
|
|
69
|
-
const
|
|
37
|
+
// Analytics tracking (anonymous, opt-out available via NO_ANALYTICS=1)
|
|
38
|
+
const ANALYTICS_ENDPOINT = "https://wzgnxkoeqzvueypwzvyn.supabase.co/functions/v1/analytics";
|
|
39
|
+
const ENABLE_ANALYTICS = process.env.NO_ANALYTICS !== "1";
|
|
40
|
+
// Track tool usage anonymously
|
|
41
|
+
async function trackToolUsage(toolName) {
|
|
42
|
+
if (!ENABLE_ANALYTICS)
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
await axios_1.default.post(ANALYTICS_ENDPOINT, {
|
|
46
|
+
event: "tool_used",
|
|
47
|
+
tool: toolName,
|
|
48
|
+
version: "1.1.8",
|
|
49
|
+
timestamp: new Date().toISOString(),
|
|
50
|
+
anonymous_id: `mcp_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
|
|
51
|
+
}, {
|
|
52
|
+
timeout: 1000 // Don't block on analytics
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// Silently fail - analytics should not affect functionality
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Community engagement message (shown on first run)
|
|
60
|
+
function getCommunityMessage() {
|
|
61
|
+
return `🌱 Welcome to LeafEngines MCP Server (v1.1.8)!
|
|
62
|
+
|
|
63
|
+
Join 750+ developers in our community:
|
|
64
|
+
• GitHub Discussions: https://github.com/QWarranto/leafengines-claude-mcp/discussions
|
|
65
|
+
• Upcoming Tutorial Videos: Agricultural AI MCP tips
|
|
66
|
+
• Twitter: @LeafEnginesAI for updates
|
|
67
|
+
|
|
68
|
+
Share your use case: What are you building with agricultural AI?`;
|
|
69
|
+
}
|
|
70
|
+
// Configuration
|
|
71
|
+
const MCP_SERVER_URL = "https://wzgnxkoeqzvueypwzvyn.supabase.co/functions/v1/mcp-server";
|
|
70
72
|
// Helper function to call LeafEngines API
|
|
71
|
-
async function callLeafEnginesAPI(
|
|
72
|
-
const startTime = Date.now();
|
|
73
|
-
const url = `${API_BASE_URL}${endpoint}`;
|
|
73
|
+
async function callLeafEnginesAPI(toolName, arguments_, apiKey, isFreeTool = false) {
|
|
74
74
|
try {
|
|
75
75
|
const headers = {
|
|
76
76
|
"Content-Type": "application/json",
|
|
77
|
+
"Accept": "application/json",
|
|
77
78
|
};
|
|
78
79
|
if (apiKey) {
|
|
79
80
|
headers["x-api-key"] = apiKey;
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
// Add x-free-tier header for free tools
|
|
83
|
+
if (isFreeTool) {
|
|
84
|
+
headers["x-free-tier"] = "true";
|
|
85
|
+
}
|
|
86
|
+
const response = await axios_1.default.post(MCP_SERVER_URL, {
|
|
87
|
+
jsonrpc: "2.0",
|
|
88
|
+
method: "tools/call",
|
|
89
|
+
params: {
|
|
90
|
+
name: toolName,
|
|
91
|
+
arguments: arguments_,
|
|
92
|
+
},
|
|
93
|
+
id: 1,
|
|
94
|
+
}, {
|
|
95
|
+
headers,
|
|
96
|
+
timeout: 30000,
|
|
88
97
|
});
|
|
89
98
|
return response.data;
|
|
90
99
|
}
|
|
91
100
|
catch (error) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
endpoint,
|
|
95
|
-
duration_ms: durationMs,
|
|
96
|
-
status_code: error.response?.status
|
|
97
|
-
});
|
|
98
|
-
if (error.response) {
|
|
99
|
-
throw new Error(`API Error (${error.response.status}): ${JSON.stringify(error.response.data)}`);
|
|
100
|
-
}
|
|
101
|
-
else if (error.request) {
|
|
102
|
-
throw new Error("Network error: No response received from API");
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
throw new Error(`Request setup error: ${error.message}`);
|
|
106
|
-
}
|
|
101
|
+
console.error(`LeafEngines API call failed: ${error.message}`);
|
|
102
|
+
throw error;
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
|
-
//
|
|
105
|
+
// Tool: TurboQuant Capabilities (FREE - no API key required)
|
|
110
106
|
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
111
|
-
log.businessEvent('tools_listed');
|
|
112
107
|
return {
|
|
113
108
|
tools: [
|
|
114
109
|
{
|
|
115
|
-
name: "
|
|
116
|
-
description: "
|
|
110
|
+
name: "get_soil_data",
|
|
111
|
+
description: "COMMODITIZED TIER ($0.001/call): Get USDA SSURGO soil analysis for any US county. Returns pH, nutrients, organic matter, drainage, and texture. Perfect for Claude when you need: agricultural planning, environmental assessments, land evaluation, or basic soil composition data. Optional: county_name and state_code (helpful if you have them from county_lookup).",
|
|
117
112
|
inputSchema: {
|
|
118
113
|
type: "object",
|
|
119
114
|
properties: {
|
|
120
115
|
county_fips: {
|
|
121
116
|
type: "string",
|
|
122
|
-
|
|
117
|
+
pattern: "^[0-9]{5}$",
|
|
118
|
+
description: "5-digit US county FIPS code"
|
|
123
119
|
},
|
|
124
|
-
|
|
120
|
+
county_name: {
|
|
125
121
|
type: "string",
|
|
126
|
-
description: "
|
|
122
|
+
description: "County name (optional, but recommended with state_code)"
|
|
123
|
+
},
|
|
124
|
+
state_code: {
|
|
125
|
+
type: "string",
|
|
126
|
+
pattern: "^[A-Z]{2}$",
|
|
127
|
+
description: "2-letter state code (optional, but recommended with county_name)"
|
|
127
128
|
}
|
|
128
129
|
},
|
|
129
130
|
required: ["county_fips"]
|
|
130
131
|
}
|
|
131
132
|
},
|
|
132
133
|
{
|
|
133
|
-
name: "
|
|
134
|
-
description: "
|
|
134
|
+
name: "county_lookup",
|
|
135
|
+
description: "COMMODITIZED TIER ($0.001/call): Resolve US location names to FIPS codes. Search by county name, state, or FIPS code. Returns county details needed for other LeafEngines tools.",
|
|
135
136
|
inputSchema: {
|
|
136
137
|
type: "object",
|
|
137
138
|
properties: {
|
|
138
|
-
|
|
139
|
+
term: {
|
|
139
140
|
type: "string",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
type: "string",
|
|
144
|
-
description: "Optional API key for paid features"
|
|
141
|
+
minLength: 2,
|
|
142
|
+
maxLength: 100,
|
|
143
|
+
description: "Search term — county name, state name, or partial FIPS code"
|
|
145
144
|
}
|
|
146
145
|
},
|
|
147
|
-
required: ["
|
|
146
|
+
required: ["term"]
|
|
148
147
|
}
|
|
149
148
|
},
|
|
150
149
|
{
|
|
151
|
-
name: "
|
|
152
|
-
description: "
|
|
150
|
+
name: "agricultural_intelligence",
|
|
151
|
+
description: "ENHANCED TIER ($0.003/call): AI-powered agricultural insights combining soil, climate, and crop science. Get planting recommendations, yield predictions, risk assessments, and sustainability scores.",
|
|
153
152
|
inputSchema: {
|
|
154
153
|
type: "object",
|
|
155
154
|
properties: {
|
|
156
155
|
county_fips: {
|
|
157
156
|
type: "string",
|
|
158
|
-
|
|
157
|
+
pattern: "^[0-9]{5}$",
|
|
158
|
+
description: "5-digit US county FIPS code"
|
|
159
|
+
},
|
|
160
|
+
crop_type: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "Crop to analyze"
|
|
163
|
+
},
|
|
164
|
+
question: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "Specific agricultural question to answer"
|
|
159
167
|
}
|
|
160
168
|
},
|
|
161
169
|
required: ["county_fips"]
|
|
162
170
|
}
|
|
163
|
-
}
|
|
164
|
-
]
|
|
171
|
+
},
|
|
172
|
+
],
|
|
165
173
|
};
|
|
166
174
|
});
|
|
167
175
|
// Handle tool execution
|
|
168
176
|
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
169
|
-
const startTime = Date.now();
|
|
170
177
|
const { name, arguments: args } = request.params;
|
|
178
|
+
// Track tool usage (anonymous analytics)
|
|
179
|
+
trackToolUsage(name);
|
|
180
|
+
// Get API key from environment variable
|
|
181
|
+
const apiKey = process.env.LEAFENGINES_API_KEY;
|
|
182
|
+
// Free tools: county_lookup and get_soil_data available without API key
|
|
183
|
+
const freeTools = ['county_lookup', 'get_soil_data'];
|
|
184
|
+
if (!apiKey && !freeTools.includes(name)) {
|
|
185
|
+
return {
|
|
186
|
+
content: [
|
|
187
|
+
{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: `API key required for ${name}. Free tools available without key: county_lookup, get_soil_data.\n\nGet full access:\n• Starter ($10/mo → $49/mo lifetime): https://buy.stripe.com/14A7sL30y8bR2F4fbgaMU02\n• Pro ($49/mo → $149/mo lifetime): https://buy.stripe.com/cNi3cv1WuajZcfE7IOaMU03\n\nFounder pricing — first 100 only.`,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
isError: true,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
171
195
|
try {
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
case "analyze_soil": {
|
|
176
|
-
const params = { county_fips: args?.county_fips };
|
|
177
|
-
result = await callLeafEnginesAPI("/soil/analyze", params, apiKey);
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
case "recommend_crop": {
|
|
181
|
-
const params = { county_fips: args?.county_fips };
|
|
182
|
-
result = await callLeafEnginesAPI("/crop/recommend", params, apiKey);
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
case "check_turboquant": {
|
|
186
|
-
const county_fips = args?.county_fips;
|
|
187
|
-
result = {
|
|
188
|
-
available: true,
|
|
189
|
-
message: "TurboQuant capabilities are available for this location.",
|
|
190
|
-
county_fips,
|
|
191
|
-
features: [
|
|
192
|
-
"High-performance soil analysis",
|
|
193
|
-
"Real-time environmental monitoring",
|
|
194
|
-
"Advanced crop modeling",
|
|
195
|
-
"Weather integration"
|
|
196
|
-
]
|
|
197
|
-
};
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
default:
|
|
201
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
202
|
-
}
|
|
203
|
-
const durationMs = Date.now() - startTime;
|
|
204
|
-
log.info(`Tool executed: ${name}`, {
|
|
205
|
-
success: true,
|
|
206
|
-
duration_ms: durationMs,
|
|
207
|
-
user_type: apiKey ? 'paid' : 'free'
|
|
208
|
-
});
|
|
209
|
-
// Send telemetry for successful execution
|
|
210
|
-
sendTelemetry('mcp', '2.0.0', name, true, durationMs, undefined, // anonymous_id
|
|
211
|
-
undefined // country
|
|
212
|
-
);
|
|
196
|
+
// Check if this is a free tool
|
|
197
|
+
const isFreeTool = freeTools.includes(name);
|
|
198
|
+
const result = await callLeafEnginesAPI(name, args, apiKey, isFreeTool);
|
|
213
199
|
return {
|
|
214
200
|
content: [
|
|
215
201
|
{
|
|
216
202
|
type: "text",
|
|
217
|
-
text: JSON.stringify(result, null, 2)
|
|
218
|
-
}
|
|
219
|
-
]
|
|
203
|
+
text: JSON.stringify(result, null, 2),
|
|
204
|
+
},
|
|
205
|
+
],
|
|
220
206
|
};
|
|
221
207
|
}
|
|
222
208
|
catch (error) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
209
|
+
// Check for specific error messages
|
|
210
|
+
if (error.response?.status === 401) {
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: "text",
|
|
215
|
+
text: `Authentication failed for ${name}. Please check your API key. Get API key from: https://app.soilsidekickpro.com/api-docs`,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
isError: true,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
231
221
|
return {
|
|
232
222
|
content: [
|
|
233
223
|
{
|
|
234
224
|
type: "text",
|
|
235
|
-
text: `Error: ${error.message}
|
|
236
|
-
}
|
|
225
|
+
text: `Error calling ${name}: ${error.message}`,
|
|
226
|
+
},
|
|
237
227
|
],
|
|
238
|
-
isError: true
|
|
228
|
+
isError: true,
|
|
239
229
|
};
|
|
240
230
|
}
|
|
241
231
|
});
|
|
232
|
+
// Error handling
|
|
233
|
+
server.onerror = (error) => {
|
|
234
|
+
console.error("[MCP Server Error]", error);
|
|
235
|
+
};
|
|
236
|
+
// Connection handling
|
|
237
|
+
process.on("SIGINT", async () => {
|
|
238
|
+
await server.close();
|
|
239
|
+
process.exit(0);
|
|
240
|
+
});
|
|
242
241
|
// Start server
|
|
243
242
|
async function main() {
|
|
244
|
-
log.info("LeafEngines MCP Server starting", {
|
|
245
|
-
version: "2.0.0",
|
|
246
|
-
environment: process.env.NODE_ENV || "production",
|
|
247
|
-
telemetry_enabled: TELEMETRY_ENABLED
|
|
248
|
-
});
|
|
249
243
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
250
|
-
// Register this client for notifications
|
|
251
|
-
(0, notifications_js_1.registerClient)(transport);
|
|
252
244
|
await server.connect(transport);
|
|
253
|
-
console.
|
|
254
|
-
console.log("📊 Structured logging enabled (JSON format)");
|
|
255
|
-
console.log("🔔 MCP Push Notifications active");
|
|
256
|
-
console.log("📈 Telemetry: " + (TELEMETRY_ENABLED ? "ENABLED" : "DISABLED (set TELEMETRY_API_KEY to enable)"));
|
|
257
|
-
console.log("🔧 Enhanced support: support@soilsidekickpro.com");
|
|
258
|
-
// Initialize notification system
|
|
259
|
-
(0, notifications_js_1.initializeNotifications)(server);
|
|
260
|
-
// Handle graceful shutdown
|
|
261
|
-
process.on('SIGINT', () => {
|
|
262
|
-
log.info("Server shutting down", { reason: 'SIGINT' });
|
|
263
|
-
process.exit(0);
|
|
264
|
-
});
|
|
265
|
-
process.on('SIGTERM', () => {
|
|
266
|
-
log.info("Server shutting down", { reason: 'SIGTERM' });
|
|
267
|
-
process.exit(0);
|
|
268
|
-
});
|
|
245
|
+
console.error("LeafEngines MCP server running on stdio");
|
|
269
246
|
}
|
|
270
247
|
main().catch((error) => {
|
|
271
|
-
|
|
248
|
+
console.error("Failed to start server:", error);
|
|
272
249
|
process.exit(1);
|
|
273
250
|
});
|
|
274
251
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;GAgBG;;;;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAC5C,kDAA0B;AAE1B,4BAA4B;AAC5B,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB;IACE,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,uEAAuE;AACvE,MAAM,kBAAkB,GAAG,iEAAiE,CAAC;AAC7F,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC;AAE1D,+BAA+B;AAC/B,KAAK,UAAU,cAAc,CAAC,QAAgB;IAC5C,IAAI,CAAC,gBAAgB;QAAE,OAAO;IAE9B,IAAI,CAAC;QACH,MAAM,eAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE;YACnC,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,YAAY,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;SAC7E,EAAE;YACD,OAAO,EAAE,IAAI,CAAC,2BAA2B;SAC1C,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4DAA4D;IAC9D,CAAC;AACH,CAAC;AAED,oDAAoD;AACpD,SAAS,mBAAmB;IAC1B,OAAO;;;;;;;iEAOwD,CAAC;AAClE,CAAC;AAED,gBAAgB;AAChB,MAAM,cAAc,GAAG,k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AC,CAAC;AAEH,iBAAiB;AACjB,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,sBAAsB;AACtB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,eAAe;AACf,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC3D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancientwhispers54/leafengines-mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"mcpName": "io.github.QWarranto/leafengines",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "LeafEngines MCP Server — Patent-protected agricultural intelligence for AI agents. 1,092+ downloads. Free tier with test key leaf-test-370df0a2e62e. Soil analysis, crop recommendations, environmental intelligence from USDA, EPA, NOAA data. Works with Claude Desktop, Cursor, OpenClaw.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"leafengines-mcp-server": "bin/leafengines-mcp-server.js"
|
|
@@ -15,34 +15,24 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/QWarranto/leafengines-claude-mcp
|
|
18
|
+
"url": "git+https://github.com/QWarranto/leafengines-claude-mcp.git#main"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"mcp",
|
|
22
22
|
"mcp-server",
|
|
23
|
-
"model-context-protocol",
|
|
24
23
|
"agriculture",
|
|
25
24
|
"soil-analysis",
|
|
26
25
|
"crop-recommendation",
|
|
27
26
|
"weather",
|
|
28
27
|
"environmental-impact",
|
|
29
|
-
"
|
|
30
|
-
"geospatial",
|
|
31
|
-
"offline-first",
|
|
32
|
-
"agronomic-ai",
|
|
33
|
-
"ai-agent",
|
|
34
|
-
"llm-tools",
|
|
28
|
+
"turboquant",
|
|
35
29
|
"leafengines"
|
|
36
30
|
],
|
|
37
31
|
"author": "QWarranto",
|
|
38
32
|
"license": "Apache-2.0",
|
|
39
33
|
"dependencies": {
|
|
40
34
|
"@modelcontextprotocol/sdk": "^0.6.0",
|
|
41
|
-
"axios": "^1.6.0"
|
|
42
|
-
"pino": "^9.0.0",
|
|
43
|
-
"pino-pretty": "^11.0.0",
|
|
44
|
-
"@sentry/node": "^8.0.0",
|
|
45
|
-
"prom-client": "^15.0.0"
|
|
35
|
+
"axios": "^1.6.0"
|
|
46
36
|
},
|
|
47
37
|
"devDependencies": {
|
|
48
38
|
"@types/node": "^20.0.0",
|