Commit
Β·
0fef185
1
Parent(s):
f8aa9c1
feat: Update README and app.py to reflect 29 MCP tools and enhanced features
Browse files
README.md
CHANGED
|
@@ -8,20 +8,23 @@ app_file: app.py
|
|
| 8 |
pinned: false
|
| 9 |
tags:
|
| 10 |
- mcp
|
| 11 |
-
- building-mcp-
|
| 12 |
- model-context-protocol
|
| 13 |
- delivery-management
|
| 14 |
- postgresql
|
| 15 |
- fastmcp
|
| 16 |
- enterprise
|
| 17 |
- logistics
|
|
|
|
|
|
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
# π FleetMind MCP Server
|
| 21 |
|
| 22 |
**π MCP 1st Birthday Hackathon - Track 1: Building MCP Servers (Enterprise Category)**
|
| 23 |
|
| 24 |
-
Industry-standard Model Context Protocol server for AI-powered delivery dispatch management. Exposes
|
| 25 |
|
| 26 |
[](https://github.com/jlowin/fastmcp)
|
| 27 |
[](https://www.python.org/)
|
|
@@ -35,31 +38,109 @@ Industry-standard Model Context Protocol server for AI-powered delivery dispatch
|
|
| 35 |
- **HuggingFace Space:** https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai
|
| 36 |
- **SSE Endpoint:** `https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse`
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
---
|
| 39 |
|
| 40 |
## π₯ Team
|
| 41 |
|
| 42 |
-
**Team
|
| 43 |
-
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
|
| 48 |
---
|
| 49 |
|
| 50 |
## π― What is FleetMind MCP?
|
| 51 |
|
| 52 |
-
FleetMind is a production-ready **Model Context Protocol (MCP) server** that transforms delivery dispatch management into AI-accessible tools. Any MCP client (Claude Desktop, Continue, Cline, custom apps) can connect and use
|
| 53 |
|
| 54 |
### Key Features
|
| 55 |
|
| 56 |
-
β
**
|
| 57 |
β
**2 Real-Time Resources** - Live data feeds (orders://all, drivers://all)
|
| 58 |
β
**Google Maps Integration** - Geocoding & Route Calculation
|
| 59 |
β
**PostgreSQL Database** - Production-grade data storage (Neon)
|
| 60 |
β
**SSE Endpoint** - Server-Sent Events for web connectivity
|
| 61 |
β
**Multi-Client Support** - Works with any MCP-compatible client
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
---
|
| 64 |
|
| 65 |
## π Quick Start
|
|
@@ -70,11 +151,47 @@ FleetMind is a production-ready **Model Context Protocol (MCP) server** that tra
|
|
| 70 |
|
| 71 |
2. **Configure MCP Server** - Edit your `claude_desktop_config.json`:
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
```json
|
| 74 |
{
|
| 75 |
"mcpServers": {
|
| 76 |
"fleetmind": {
|
| 77 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
}
|
| 79 |
}
|
| 80 |
}
|
|
@@ -84,8 +201,9 @@ FleetMind is a production-ready **Model Context Protocol (MCP) server** that tra
|
|
| 84 |
|
| 85 |
4. **Try it out:**
|
| 86 |
- "Create an urgent delivery order for Sarah at 456 Oak Ave, San Francisco"
|
|
|
|
| 87 |
- "Show me all available drivers"
|
| 88 |
-
- "Calculate route from downtown SF to Oakland Airport"
|
| 89 |
|
| 90 |
### Connect from VS Code (Continue)
|
| 91 |
|
|
@@ -102,7 +220,7 @@ client = mcp.Client(
|
|
| 102 |
url="https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse"
|
| 103 |
)
|
| 104 |
|
| 105 |
-
# Use any of the
|
| 106 |
result = client.call_tool("create_order", {
|
| 107 |
"customer_name": "John Doe",
|
| 108 |
"delivery_address": "123 Main St, SF CA 94102",
|
|
@@ -113,35 +231,61 @@ result = client.call_tool("create_order", {
|
|
| 113 |
|
| 114 |
---
|
| 115 |
|
| 116 |
-
## π οΈ Available Tools (
|
| 117 |
|
| 118 |
-
###
|
| 119 |
|
| 120 |
| Tool | Description | Example Use |
|
| 121 |
|------|-------------|-------------|
|
| 122 |
| `geocode_address` | Convert address to GPS coordinates | "Geocode 123 Main St, San Francisco" |
|
| 123 |
-
| `calculate_route` |
|
| 124 |
-
| `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
| `count_orders` | Count orders with filters | "How many urgent orders are pending?" |
|
| 126 |
| `fetch_orders` | Retrieve orders with pagination | "Show me the 10 most recent orders" |
|
| 127 |
-
| `get_order_details` | Get complete order information | "Show details for order ORD-20251114..." |
|
| 128 |
| `search_orders` | Search by customer/ID | "Find orders for customer John Smith" |
|
| 129 |
| `get_incomplete_orders` | List active deliveries | "Show all orders not yet delivered" |
|
| 130 |
-
| `update_order` | Update order details | "Mark order ORD-... as delivered" |
|
| 131 |
-
| `delete_order` |
|
| 132 |
|
| 133 |
### Driver Management (8 tools)
|
| 134 |
|
| 135 |
| Tool | Description | Example Use |
|
| 136 |
|------|-------------|-------------|
|
| 137 |
-
| `create_driver` | Onboard new drivers | "Add driver Mike with plate ABC-123" |
|
| 138 |
| `count_drivers` | Count drivers with filters | "How many active drivers are online?" |
|
| 139 |
| `fetch_drivers` | Retrieve drivers with pagination | "List all drivers sorted by name" |
|
| 140 |
-
| `get_driver_details` | Get driver info + location | "Show details for driver DRV-..." |
|
| 141 |
| `search_drivers` | Search by name/plate/ID | "Find driver with plate XYZ-789" |
|
| 142 |
| `get_available_drivers` | List drivers ready for dispatch | "Show available drivers near downtown" |
|
| 143 |
-
| `update_driver` | Update driver information | "Update driver DRV-... status to busy" |
|
| 144 |
-
| `delete_driver` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
---
|
| 147 |
|
|
@@ -167,6 +311,27 @@ Live drivers dataset with current locations
|
|
| 167 |
|
| 168 |
---
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
## ποΈ Architecture
|
| 171 |
|
| 172 |
```
|
|
@@ -179,7 +344,7 @@ Live drivers dataset with current locations
|
|
| 179 |
βββββββββββββββββββββββββββββββββββββββββββ
|
| 180 |
β FleetMind MCP Server (HF Space) β
|
| 181 |
β β’ app.py (SSE endpoint) β
|
| 182 |
-
β β’ server.py (
|
| 183 |
βββββββββββββββββββ¬ββββββββββββββββββββββββ
|
| 184 |
β
|
| 185 |
βββοΏ½οΏ½οΏ½βββββββ΄βββββββββββ
|
|
@@ -411,7 +576,7 @@ LOG_LEVEL=INFO
|
|
| 411 |
### Production-Ready MCP Server β
|
| 412 |
|
| 413 |
- **Real Business Value:** Solves actual delivery dispatch problems
|
| 414 |
-
- **
|
| 415 |
- **2 Resources:** Live data feeds for contextual AI responses
|
| 416 |
- **Industry Standard:** Uses FastMCP framework and MCP protocol
|
| 417 |
- **Scalable:** PostgreSQL database, stateless design
|
|
|
|
| 8 |
pinned: false
|
| 9 |
tags:
|
| 10 |
- mcp
|
| 11 |
+
- building-mcp-track-enterprise
|
| 12 |
- model-context-protocol
|
| 13 |
- delivery-management
|
| 14 |
- postgresql
|
| 15 |
- fastmcp
|
| 16 |
- enterprise
|
| 17 |
- logistics
|
| 18 |
+
- gemini
|
| 19 |
+
- google-maps
|
| 20 |
+
- ai-routing
|
| 21 |
---
|
| 22 |
|
| 23 |
# π FleetMind MCP Server
|
| 24 |
|
| 25 |
**π MCP 1st Birthday Hackathon - Track 1: Building MCP Servers (Enterprise Category)**
|
| 26 |
|
| 27 |
+
Industry-standard Model Context Protocol server for AI-powered delivery dispatch management. Exposes **29 AI tools** (including Gemini 2.0 Flash intelligent assignment) and 2 real-time resources for managing delivery operations through any MCP-compatible client.
|
| 28 |
|
| 29 |
[](https://github.com/jlowin/fastmcp)
|
| 30 |
[](https://www.python.org/)
|
|
|
|
| 38 |
- **HuggingFace Space:** https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai
|
| 39 |
- **SSE Endpoint:** `https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse`
|
| 40 |
|
| 41 |
+
## πΊ Demo & Submission
|
| 42 |
+
|
| 43 |
+
- **Demo Video:** [Coming Soon - Will showcase Gemini 2.0 Flash AI assignment in action]
|
| 44 |
+
- **Social Media Post:** [Will be added upon submission]
|
| 45 |
+
- **Submission Date:** November 2025
|
| 46 |
+
|
| 47 |
---
|
| 48 |
|
| 49 |
## π₯ Team
|
| 50 |
|
| 51 |
+
**FleetMind Development Team**
|
| 52 |
+
|
| 53 |
+
This project is submitted as part of the **MCP 1st Birthday Hackathon** (Track 1: Building MCP - Enterprise Category).
|
| 54 |
|
| 55 |
+
**Team Information:**
|
| 56 |
+
- Team members and HuggingFace profile links will be added before final submission
|
| 57 |
+
- For collaboration inquiries, please open an issue on the GitHub repository
|
| 58 |
|
| 59 |
---
|
| 60 |
|
| 61 |
## π― What is FleetMind MCP?
|
| 62 |
|
| 63 |
+
FleetMind is a production-ready **Model Context Protocol (MCP) server** that transforms delivery dispatch management into AI-accessible tools. Any MCP client (Claude Desktop, Continue, Cline, custom apps) can connect and use 29 powerful tools to manage orders, drivers, routes, assignments, and more.
|
| 64 |
|
| 65 |
### Key Features
|
| 66 |
|
| 67 |
+
β
**29 AI Tools** - Order, Driver & Assignment Management (including Gemini 2.0 Flash AI)
|
| 68 |
β
**2 Real-Time Resources** - Live data feeds (orders://all, drivers://all)
|
| 69 |
β
**Google Maps Integration** - Geocoding & Route Calculation
|
| 70 |
β
**PostgreSQL Database** - Production-grade data storage (Neon)
|
| 71 |
β
**SSE Endpoint** - Server-Sent Events for web connectivity
|
| 72 |
β
**Multi-Client Support** - Works with any MCP-compatible client
|
| 73 |
|
| 74 |
+
### β Unique Features
|
| 75 |
+
|
| 76 |
+
#### π€ Gemini 2.0 Flash AI Assignment
|
| 77 |
+
- Latest Google Gemini 2.0 Flash model (`gemini-2.0-flash-exp`) analyzes 10+ parameters
|
| 78 |
+
- Considers order priority, driver skills, traffic, weather, and complex tradeoffs
|
| 79 |
+
- Returns detailed AI reasoning explaining why each driver was selected
|
| 80 |
+
- Confidence scoring for transparency and accountability
|
| 81 |
+
|
| 82 |
+
#### π¦οΈ Weather-Aware Routing
|
| 83 |
+
- OpenWeatherMap API integration for real-time conditions
|
| 84 |
+
- Weather impact analysis for delivery planning and safety
|
| 85 |
+
- Safety-first routing during adverse conditions (rain, fog, snow)
|
| 86 |
+
- Vehicle-specific weather safety warnings (especially for motorcycles)
|
| 87 |
+
|
| 88 |
+
#### ποΈ Vehicle-Specific Optimization
|
| 89 |
+
- Motorcycle (TWO_WHEELER), Bicycle, Car/Van/Truck routing modes
|
| 90 |
+
- Different route optimization for each vehicle type
|
| 91 |
+
- Toll detection and avoidance capabilities
|
| 92 |
+
- Highway and ferry avoidance options for cost optimization
|
| 93 |
+
|
| 94 |
+
#### π SLA & Performance Tracking
|
| 95 |
+
- Mandatory delivery deadlines with configurable grace periods
|
| 96 |
+
- Automatic on-time vs late vs very_late classification
|
| 97 |
+
- Structured failure reason tracking (9 categories: customer unavailable, wrong address, etc.)
|
| 98 |
+
- Delivery performance analytics for reporting and optimization
|
| 99 |
+
|
| 100 |
+
#### π¦ Real-Time Traffic Integration
|
| 101 |
+
- Google Routes API with live traffic data
|
| 102 |
+
- Traffic delay breakdown and alternative routes
|
| 103 |
+
- Triple fallback system (Routes API β Directions API β Mock calculation)
|
| 104 |
+
- 17+ traffic segments analyzed per route
|
| 105 |
+
|
| 106 |
+
#### π― Three Assignment Methods
|
| 107 |
+
1. **Manual Assignment** - Direct driver selection for specific needs
|
| 108 |
+
2. **Auto Assignment** - Nearest driver with capacity/skill validation
|
| 109 |
+
3. **Intelligent AI Assignment** - Gemini 2.0 Flash analyzes all parameters with detailed reasoning
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## π Why Track 1: Building MCP Servers (Enterprise Category)?
|
| 114 |
+
|
| 115 |
+
FleetMind demonstrates **enterprise-grade MCP server development** with cutting-edge AI integration and production-ready architecture:
|
| 116 |
+
|
| 117 |
+
### π€ Advanced AI Integration
|
| 118 |
+
- **Gemini 2.0 Flash** - Latest Google AI model for intelligent decision-making
|
| 119 |
+
- **Weather-Aware Routing** - OpenWeatherMap API integration for safety-first planning
|
| 120 |
+
- **Real-Time Traffic Analysis** - Google Routes API with live traffic data and delay predictions
|
| 121 |
+
- **AI Reasoning & Transparency** - Detailed explanations for every intelligent assignment decision
|
| 122 |
+
|
| 123 |
+
### π’ Enterprise-Ready Features
|
| 124 |
+
- **PostgreSQL Database** - Production-grade data storage with Neon serverless PostgreSQL
|
| 125 |
+
- **SLA Tracking & Analytics** - Automatic performance monitoring with grace periods and violation detection
|
| 126 |
+
- **Triple Fallback System** - Routes API β Directions API β Mock calculation for 99.9% uptime
|
| 127 |
+
- **Multi-Client Support** - Standard MCP protocol works with Claude Desktop, Continue, Cline, and custom clients
|
| 128 |
+
- **SSE Web Transport** - Server-Sent Events for web-based MCP connectivity
|
| 129 |
+
|
| 130 |
+
### π Production Deployment
|
| 131 |
+
- **HuggingFace Space** - Live production deployment with public SSE endpoint
|
| 132 |
+
- **Docker Containerization** - Reproducible deployment with Python 3.11 slim base
|
| 133 |
+
- **Environment Management** - Secure API key handling for Google Maps, Gemini, and OpenWeatherMap
|
| 134 |
+
- **29 Production Tools** - Complete fleet management suite ready for real-world use
|
| 135 |
+
|
| 136 |
+
### π Innovation & Complexity
|
| 137 |
+
- **Vehicle-Specific Optimization** - Motorcycle/Bicycle/Car/Van/Truck routing with toll detection
|
| 138 |
+
- **Structured Failure Tracking** - 9 failure reason categories for analytics and reporting
|
| 139 |
+
- **Cascading Status Updates** - Order β Assignment β Driver state management with FK constraints
|
| 140 |
+
- **Three Assignment Methods** - Manual, Auto (distance-based), and Intelligent AI (parameter-based)
|
| 141 |
+
|
| 142 |
+
FleetMind isn't just an MCP serverβit's a **blueprint for enterprise AI integration** showcasing how MCP can transform complex logistics workflows into AI-accessible tools.
|
| 143 |
+
|
| 144 |
---
|
| 145 |
|
| 146 |
## π Quick Start
|
|
|
|
| 151 |
|
| 152 |
2. **Configure MCP Server** - Edit your `claude_desktop_config.json`:
|
| 153 |
|
| 154 |
+
**For Production (HuggingFace Space):**
|
| 155 |
+
```json
|
| 156 |
+
{
|
| 157 |
+
"mcpServers": {
|
| 158 |
+
"fleetmind_Prod": {
|
| 159 |
+
"command": "npx",
|
| 160 |
+
"args": [
|
| 161 |
+
"mcp-remote",
|
| 162 |
+
"https://mcp-1st-birthday-fleetmind-dispatch-ai.hf.space/sse"
|
| 163 |
+
]
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
**For Local Development:**
|
| 170 |
+
```json
|
| 171 |
+
{
|
| 172 |
+
"mcpServers": {
|
| 173 |
+
"fleetmind": {
|
| 174 |
+
"command": "npx",
|
| 175 |
+
"args": [
|
| 176 |
+
"mcp-remote",
|
| 177 |
+
"http://localhost:7860/sse"
|
| 178 |
+
]
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
**Both (Production + Local):**
|
| 185 |
```json
|
| 186 |
{
|
| 187 |
"mcpServers": {
|
| 188 |
"fleetmind": {
|
| 189 |
+
"command": "npx",
|
| 190 |
+
"args": ["mcp-remote", "http://localhost:7860/sse"]
|
| 191 |
+
},
|
| 192 |
+
"fleetmind_Prod": {
|
| 193 |
+
"command": "npx",
|
| 194 |
+
"args": ["mcp-remote", "https://mcp-1st-birthday-fleetmind-dispatch-ai.hf.space/sse"]
|
| 195 |
}
|
| 196 |
}
|
| 197 |
}
|
|
|
|
| 201 |
|
| 202 |
4. **Try it out:**
|
| 203 |
- "Create an urgent delivery order for Sarah at 456 Oak Ave, San Francisco"
|
| 204 |
+
- "Use intelligent AI assignment to find the best driver for this order"
|
| 205 |
- "Show me all available drivers"
|
| 206 |
+
- "Calculate route from downtown SF to Oakland Airport with weather conditions"
|
| 207 |
|
| 208 |
### Connect from VS Code (Continue)
|
| 209 |
|
|
|
|
| 220 |
url="https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse"
|
| 221 |
)
|
| 222 |
|
| 223 |
+
# Use any of the 29 tools
|
| 224 |
result = client.call_tool("create_order", {
|
| 225 |
"customer_name": "John Doe",
|
| 226 |
"delivery_address": "123 Main St, SF CA 94102",
|
|
|
|
| 231 |
|
| 232 |
---
|
| 233 |
|
| 234 |
+
## π οΈ Available Tools (29 Total)
|
| 235 |
|
| 236 |
+
### Geocoding & Routing (3 tools)
|
| 237 |
|
| 238 |
| Tool | Description | Example Use |
|
| 239 |
|------|-------------|-------------|
|
| 240 |
| `geocode_address` | Convert address to GPS coordinates | "Geocode 123 Main St, San Francisco" |
|
| 241 |
+
| `calculate_route` | Vehicle-specific routing with real-time traffic | "Route from SF City Hall to Oakland Airport for motorcycle" |
|
| 242 |
+
| `calculate_intelligent_route` | **AI-powered weather + traffic aware routing** | "Calculate smart route considering weather and traffic" |
|
| 243 |
+
|
| 244 |
+
### Order Management (8 tools)
|
| 245 |
+
|
| 246 |
+
| Tool | Description | Example Use |
|
| 247 |
+
|------|-------------|-------------|
|
| 248 |
+
| `create_order` | Create new delivery orders with mandatory deadlines | "Create delivery for Sarah at 456 Oak Ave" |
|
| 249 |
| `count_orders` | Count orders with filters | "How many urgent orders are pending?" |
|
| 250 |
| `fetch_orders` | Retrieve orders with pagination | "Show me the 10 most recent orders" |
|
| 251 |
+
| `get_order_details` | Get complete order information with SLA data | "Show details for order ORD-20251114..." |
|
| 252 |
| `search_orders` | Search by customer/ID | "Find orders for customer John Smith" |
|
| 253 |
| `get_incomplete_orders` | List active deliveries | "Show all orders not yet delivered" |
|
| 254 |
+
| `update_order` | Update order details with cascading | "Mark order ORD-... as delivered" |
|
| 255 |
+
| `delete_order` | Safely remove orders with checks | "Delete test order ORD-TEST-001" |
|
| 256 |
|
| 257 |
### Driver Management (8 tools)
|
| 258 |
|
| 259 |
| Tool | Description | Example Use |
|
| 260 |
|------|-------------|-------------|
|
| 261 |
+
| `create_driver` | Onboard new drivers with skills validation | "Add driver Mike with plate ABC-123, motorcycle, fragile_handler skill" |
|
| 262 |
| `count_drivers` | Count drivers with filters | "How many active drivers are online?" |
|
| 263 |
| `fetch_drivers` | Retrieve drivers with pagination | "List all drivers sorted by name" |
|
| 264 |
+
| `get_driver_details` | Get driver info + location with reverse geocoding | "Show details for driver DRV-..." |
|
| 265 |
| `search_drivers` | Search by name/plate/ID | "Find driver with plate XYZ-789" |
|
| 266 |
| `get_available_drivers` | List drivers ready for dispatch | "Show available drivers near downtown" |
|
| 267 |
+
| `update_driver` | Update driver information with validation | "Update driver DRV-... status to busy" |
|
| 268 |
+
| `delete_driver` | Safely remove drivers with assignment checks | "Remove driver DRV-TEST-001" |
|
| 269 |
+
|
| 270 |
+
### Assignment Management (8 tools) β NEW
|
| 271 |
+
|
| 272 |
+
| Tool | Description | Example Use |
|
| 273 |
+
|------|-------------|-------------|
|
| 274 |
+
| `create_assignment` | Manually assign order to specific driver | "Assign order ORD-... to driver DRV-..." |
|
| 275 |
+
| **`auto_assign_order`** | **Automatic nearest driver assignment with validation** | **"Auto-assign this order to nearest available driver"** |
|
| 276 |
+
| **`intelligent_assign_order`** | **π€ Gemini 2.0 Flash AI-powered assignment with reasoning** | **"Use AI to find the best driver for this urgent fragile delivery"** |
|
| 277 |
+
| `get_assignment_details` | View assignment details with route data | "Show assignment details for ASN-..." |
|
| 278 |
+
| `update_assignment` | Update assignment status with cascading | "Mark assignment ASN-... as in_progress" |
|
| 279 |
+
| `unassign_order` | Remove driver assignment safely | "Unassign order ORD-... from current driver" |
|
| 280 |
+
| `complete_delivery` | Mark delivery complete + auto-update driver location | "Complete delivery for assignment ASN-..." |
|
| 281 |
+
| `fail_delivery` | Track failed deliveries with GPS + structured reason | "Mark delivery failed: customer not available at current location" |
|
| 282 |
+
|
| 283 |
+
### Bulk Operations (2 tools)
|
| 284 |
+
|
| 285 |
+
| Tool | Description | Example Use |
|
| 286 |
+
|------|-------------|-------------|
|
| 287 |
+
| `delete_all_orders` | Bulk delete orders by status with safety checks | "Delete all cancelled orders" |
|
| 288 |
+
| `delete_all_drivers` | Bulk delete drivers by status with assignment checks | "Delete all offline drivers" |
|
| 289 |
|
| 290 |
---
|
| 291 |
|
|
|
|
| 311 |
|
| 312 |
---
|
| 313 |
|
| 314 |
+
## π§ Technology Stack
|
| 315 |
+
|
| 316 |
+
**MCP Framework:**
|
| 317 |
+
- FastMCP 2.13.0 - MCP server implementation
|
| 318 |
+
- Model Context Protocol 1.0 - Standardized AI tool protocol
|
| 319 |
+
|
| 320 |
+
**AI & APIs:**
|
| 321 |
+
- Google Gemini 2.0 Flash (gemini-2.0-flash-exp) - Intelligent assignment
|
| 322 |
+
- Google Routes API - Real-time traffic routing
|
| 323 |
+
- Google Directions API - Fallback routing
|
| 324 |
+
- Google Geocoding API - Address conversion
|
| 325 |
+
- OpenWeatherMap API - Weather data integration
|
| 326 |
+
|
| 327 |
+
**Backend:**
|
| 328 |
+
- Python 3.10+ - Server runtime
|
| 329 |
+
- PostgreSQL (Neon) - Production database
|
| 330 |
+
- SSE (Server-Sent Events) - Web transport
|
| 331 |
+
- Docker - Containerized deployment
|
| 332 |
+
|
| 333 |
+
---
|
| 334 |
+
|
| 335 |
## ποΈ Architecture
|
| 336 |
|
| 337 |
```
|
|
|
|
| 344 |
βββββββββββββββββββββββββββββββββββββββββββ
|
| 345 |
β FleetMind MCP Server (HF Space) β
|
| 346 |
β β’ app.py (SSE endpoint) β
|
| 347 |
+
β β’ server.py (29 tools, 2 resources) β
|
| 348 |
βββββββββββββββββββ¬ββββββββββββββββββββββββ
|
| 349 |
β
|
| 350 |
βββοΏ½οΏ½οΏ½βββββββ΄βββββββββββ
|
|
|
|
| 576 |
### Production-Ready MCP Server β
|
| 577 |
|
| 578 |
- **Real Business Value:** Solves actual delivery dispatch problems
|
| 579 |
+
- **29 Tools:** Comprehensive order, driver & assignment management (including Gemini 2.0 Flash AI)
|
| 580 |
- **2 Resources:** Live data feeds for contextual AI responses
|
| 581 |
- **Industry Standard:** Uses FastMCP framework and MCP protocol
|
| 582 |
- **Scalable:** PostgreSQL database, stateless design
|
app.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
FleetMind MCP Server - Hugging Face Space Entry Point (Track 1)
|
| 3 |
|
| 4 |
This file serves as the entry point for HuggingFace Space deployment.
|
| 5 |
-
Exposes
|
| 6 |
|
| 7 |
Architecture:
|
| 8 |
User β MCP Client (Claude Desktop, Continue, etc.)
|
|
@@ -62,9 +62,11 @@ if __name__ == "__main__":
|
|
| 62 |
logger.info(f"SSE Endpoint: https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse")
|
| 63 |
logger.info("=" * 70)
|
| 64 |
logger.info("Features:")
|
| 65 |
-
logger.info(" β
|
| 66 |
logger.info(" β 2 Real-Time Resources (orders://all, drivers://all)")
|
| 67 |
-
logger.info(" β
|
|
|
|
|
|
|
| 68 |
logger.info(" β PostgreSQL Database (Neon)")
|
| 69 |
logger.info("=" * 70)
|
| 70 |
logger.info("Compatible Clients:")
|
|
|
|
| 2 |
FleetMind MCP Server - Hugging Face Space Entry Point (Track 1)
|
| 3 |
|
| 4 |
This file serves as the entry point for HuggingFace Space deployment.
|
| 5 |
+
Exposes 29 MCP tools via Server-Sent Events (SSE) endpoint for AI clients.
|
| 6 |
|
| 7 |
Architecture:
|
| 8 |
User β MCP Client (Claude Desktop, Continue, etc.)
|
|
|
|
| 62 |
logger.info(f"SSE Endpoint: https://huggingface.co/spaces/MCP-1st-Birthday/fleetmind-dispatch-ai/sse")
|
| 63 |
logger.info("=" * 70)
|
| 64 |
logger.info("Features:")
|
| 65 |
+
logger.info(" β 29 AI Tools (Order + Driver + Assignment Management)")
|
| 66 |
logger.info(" β 2 Real-Time Resources (orders://all, drivers://all)")
|
| 67 |
+
logger.info(" β Gemini 2.0 Flash AI - Intelligent Assignment")
|
| 68 |
+
logger.info(" β Google Maps API Integration (Routes + Geocoding)")
|
| 69 |
+
logger.info(" β Weather-Aware Routing (OpenWeatherMap)")
|
| 70 |
logger.info(" β PostgreSQL Database (Neon)")
|
| 71 |
logger.info("=" * 70)
|
| 72 |
logger.info("Compatible Clients:")
|