# Shansong Swift Delivery MCP

> Shansong Swift Delivery MCP Server connects your AI agent directly into Shansong's P2P logistics network. It lets you estimate delivery routes, dispatch riders instantly, and track live GPS locations for any order. Use it to manage the entire last-mile process without touching a dashboard.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** shansong, delivery, logistics, tracking, gps, instant-delivery, swift-delivery

## Description

Shansong Swift Delivery MCP Server connects your AI agent straight into Shansong’s Point-to-Point logistics network. It handles the whole last mile—you don't gotta touch any dashboards, you just tell your agent what needs doing. You can manage everything from figuring out costs to tracking where that rider is right now.

To get started, you first need to know where Shansong operates; use `query_city_list` to pull up every active city they service. When you're planning a route, you gotta check the local stops; running `query_store_list` lets your agent list all available stores within a specific area for precise routing purposes. Before generating anything, you run `calculate_fee` to determine the final cost of a delivery route. This confirms the budget before you commit.

Ready to send it out? You use `create_order` to generate and submit a brand new delivery order payload into the Shansong network. Once that's done, your agent can mark the goods as officially picked up from the origin point by executing `confirm_goods`. If things change fast—say, you need to stop the dispatch for some reason—you hit `cancel_order` to halt a live delivery immediately.

While it's en route, you keep tabs on everything. You can get real-time GPS coordinates of the assigned Shansong rider using `query_rider_position`. For any existing order ID, running `query_order_info` gives your agent the current status and all the live details about that package. If the rider needs extra motivation to pick up an order faster, you can add a monetary tip directly with `add_tip`. If something goes wrong—maybe the service is bad or the delivery was botched—you submit an official complaint against the assigned rider using `submit_complaint`.

This setup gives your agent total control over the entire logistics lifecycle. You initiate the process by establishing the order, monitor it minute-by-minute with live tracking and status checks, and you can intervene immediately whether that means canceling a job, confirming pickup, or making sure the driver gets the incentive they need.

## Tools

### add_tip
Adds a monetary tip to encourage a driver to pick up an order faster.

### calculate_fee
Determines the final cost of a delivery route before placing an official order.

### cancel_order
Stops a live delivery dispatch that needs to be canceled for any reason.

### confirm_goods
Marks the shipment as successfully picked up from the origin location.

### create_order
Generates and submits a brand new delivery order into the Shansong network.

### query_city_list
Fetches a list of all active cities where Shansong currently operates services.

### query_order_info
Retrieves the current, live status and details for an existing order ID.

### query_rider_position
Gets real-time GPS coordinates of the assigned Shansong rider.

### query_store_list
Lists all available stores within a specific city for routing purposes.

### submit_complaint
Submits an official complaint against the assigned rider through the system.

## Prompt Examples

**Prompt:** 
```
Where is the rider for order SS991024?
```

**Response:** 
```
According to the `query_rider_position` API, the assigned rider is actively streaming GPS data at Latitude 34.221, Longitude 116.480.
```

**Prompt:** 
```
Tip the Shansong driver on order SS111 around 50 cents.
```

**Response:** 
```
Done! I pushed a 50 cents tip payload directly against order SS111 successfully augmenting the delivery priority index.
```

## Capabilities

### Track Rider Location
Gets live GPS coordinates of the Shansong rider assigned to an order.

### Estimate Delivery Costs
Calculates the total fee for a delivery route before dispatching an order.

### Create New Deliveries
Submits a complete, actionable new Shansong delivery order payload.

### Manage Order Status
Retrieves the live status details for any existing order ID.

### Dispatch Commands
Can cancel a dispatch, confirm goods pickup, or add tips to incentivize the rider.

## Use Cases

### Handling a delayed shipment query
A customer texts, 'What's wrong with order SS991024?' The agent immediately calls `query_order_info` to confirm the status. Then, it uses `query_rider_position` to give the customer live GPS data, confirming exactly where the rider is right now.

### Setting up a new drop-off point
A coordinator needs to ship documents from Store A to Store B. The agent first calls `query_store_list` for both locations, then uses `calculate_fee` with the coordinates to confirm the price before finally calling `create_order`.

### Correcting a misassigned rider
The initial driver is struggling. The agent first calls `submit_complaint` against the assigned rider for poor performance, then uses `cancel_order` to pull the job, allowing dispatchers to reassign it immediately.

### Completing a tricky pickup
Goods were dropped off but the system hasn't logged them. The agent first calls `confirm_goods` and then uses `add_tip` on the successful delivery record to thank the rider for their help.

## Benefits

- Real-time location updates: Stop asking agents to manually check tracking sites. Using `query_rider_position` lets your agent stream the rider's exact coordinates directly into a chat response.
- Automated cost verification: Never guess shipping rates again. Before committing to an order, run `calculate_fee` to get the definitive price structure for the route.
- Full lifecycle control: Need to stop or change an order? Your agent handles it with `cancel_order`, submitting the payload instantly and keeping your workflow clean.
- Instant dispatching: From estimating costs to submitting the final request, you can execute a complete logistics flow—`calculate_fee` followed by `create_order`—in one sequence.
- Proactive support handling: Instead of waiting for customers to ask 'Where is it?', your agent can proactively call `query_order_info` and report status updates automatically.

## How It Works

The bottom line is, you get a direct API bridge into Shansong's operational systems, letting your AI client handle logistics tasks without needing human intervention on external websites.

1. First, sign up on the Shansong Open Platform and register your application. Get your Client ID, App Secret, and Shop ID.
2. Push these three variables into Vurb. The node extension generates the required 'Sign' string by converting your JSON payload to an MD5 Hash for their network.
3. Your AI agent can now use the tools—like `create_order` or `query_rider_position`—to interact with the live delivery system.

## Frequently Asked Questions

**How do I get live tracking using query_rider_position?**
You pass an order ID to `query_rider_position`. This tool returns the real-time GPS coordinates (Latitude and Longitude) of the assigned driver, allowing your agent to provide precise updates.

**Do I need to calculate fees before creating an order using calculate_fee?**
Yes. Always run `calculate_fee` first. This confirms the current rates and total cost for the route. It’s best practice to validate pricing before you call `create_order`.

**What if I need to cancel a delivery, what tool do I use?**
Use `cancel_order`. This tool sends the cancellation payload to Shansong's system. It handles stopping the dispatch and updating the status internally.

**How do I submit a complaint against a driver?**
Call the `submit_complaint` tool directly. You provide necessary details, and the server submits an official record of the issue to Shansong's system for review.

**How do I authenticate my agent to use the `create_order` tool?**
You must provide your Client ID, App Secret, and Shop ID. The Node extension handles authentication by generating a required MD5 Hash signature. This ensures that every dispatch request sent through your AI client is properly authenticated with Shansong's network.

**Before calling any dispatch tool, how can I check available cities using `query_city_list`?**
The tool returns a list of all active operating cities. Running this first step confirms that your agent targets a valid geographic area. This prevents errors when calculating fees or attempting to create an order in an unsupported region.

**If I need a detailed status update on an existing shipment, how does `query_order_info` work?**
This tool provides comprehensive details about the entire order lifecycle. It returns current statuses beyond just location, including key milestones like 'picked up' or 'out for delivery'. You get a full view of where the order stands.

**What process does `confirm_goods` handle after a successful pick-up?**
This action formally registers that the goods were successfully picked up at the source location. It completes the first critical leg of the journey, telling Shansong's system to move the order into the official dispatch queue for routing.

**How is the Shansong API payload encrypted?**
Instead of demanding complex LLM scripting to assemble `clientId`, JSON stringification, and MD5 encoding, this plugin seamlessly abstracts the `sign` variable creation. All HTTP form-data bounds are strictly governed locally on the proxy instance yielding instant results.