ShipSmart MCP Server

ShipSmart MCP Server

Enables AI assistants to manage logistics operations including orders, shipments, tracking, and warehouse management through standardized MCP tools.

Category
访问服务器

README

🚚 ShipSmart MCP Server

ShipSmart is a sample Logistics AI Backend that demonstrates how to expose an existing FastAPI application as an MCP (Model Context Protocol) Server.

The project simulates a logistics company that manages customer orders, shipments, warehouses, and package tracking. A FastAPI backend exposes REST APIs, while an MCP server wraps those APIs so AI assistants (such as Claude Desktop, Cursor, or MCP Inspector) can interact with the logistics system using standardized MCP tools.

This project demonstrates how to build AI-ready applications without modifying existing business logic.

🏗️ Architecture

Architecture diagram

The MCP server does not access the database directly. Instead, it communicates with the FastAPI backend over HTTP, demonstrating how existing applications can be made AI-accessible without changing their internal architecture.

✨ Features

  • FastAPI REST backend
  • SQLite database using SQLAlchemy ORM
  • MCP Server built using FastMCP
  • AI-accessible logistics operations
  • Sample logistics dataset
  • Layered architecture (API → Services → Database)
  • MCP Tools
  • MCP Resources
  • MCP Prompt

📁 Project Structure

logistics-mcp-server/
│
├── app/
│ ├── api/                      # FastAPI routes
│ ├── database/                 # Database connection, models and seed script
│ ├── mcp_server/
│ │ ├── api_client.py           # Calls FastAPI endpoints
│ │ ├── server_v1.py            # MCP Server using official MCP SDK
│ │ └── server_v2.py            # MCP Server using FastMCP package
│ ├── schemas/                  # Pydantic models
│ └── services/                 # Business logic
│
├── client/
│ └── streamlit_app.py          # Streamlit client application connecting to MCP Server
│
├── requirements.txt
├── .env
└── README.md

🛠 MCP Tools

The following tools are exposed through the MCP Server.

Tool Description
get_order_details Retrieve complete order information
search_orders Search orders by customer, city or status
track_package Retrieve shipment tracking details
cancel_order Cancel an order
reschedule_delivery Update the estimated delivery date
find_warehouse Find warehouse serving a city

📄 MCP Resources

The project also exposes static resources.

Resource Description
company://shipping-policy Company shipping policy
company://supported-couriers Supported courier partners
company://warehouse-locations Warehouse locations

💬 MCP Prompt

Prompt Description
summarize_tracking Generates a professional customer-friendly shipment update from tracking information

🗄 Database

The project uses SQLite for simplicity.

Main entities:

  • Customer
  • Order
  • OrderItem
  • Shipment
  • TrackingHistory
  • Warehouse

🚀 Running the Project

1. Clone the repository

git clone <repository-url>
cd logistics-mcp-server

2. Create a virtual environment

Windows

python -m venv .venv
.venv\Scripts\activate

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Create the database

python -m app.database.create_db

5. Seed sample data

python -m app.database.seed

This populates the database with sample:

  • Customers
  • Orders
  • Shipments
  • Tracking history
  • Warehouses

6. Start the FastAPI server

uvicorn app.api.main:app --reload

Swagger UI

http://localhost:8000/docs

7. Start the MCP Server

ShipSmart MCP Server contains two implementations:

MCP Server Implementations

File Implementation Import Used Usage
server_v1.py Official MCP SDK FastMCP from mcp.server.fastmcp import FastMCP Basic MCP server implementation
server_v2.py FastMCP package from fastmcp import FastMCP Used with the Streamlit + Gemini client

The Streamlit application connects to server_v2.py.

Running servers

To start the MCP server:

python -m app.mcp_server.server_v1
#OR
python -m app.mcp_server.server_v2

Testing MCP Tools

You can test the MCP servers independently using the MCP Inspector:

mcp dev app/mcp_server/sever_v1.py
#OR
fastmcp dev inspector app/mcp_server/server_v2.py

<img width="1881" height="907" alt="mcp_inspector" src="https://github.com/user-attachments/assets/4f171960-c399-4cea-8f2e-b60566f4c18f" />

The MCP Inspector allows you to test the available tools and verify that the server is exposing the expected MCP functionality.

8. Start the Streamlit Client

The Streamlit application acts as an MCP client and connects to server_v2.py.

Run:

streamlit run client/streamlit_app.py

<img width="1256" height="816" alt="streamlit_app" src="https://github.com/user-attachments/assets/2b5fda46-9b26-4fa9-ade5-73bbbd12d94c" />

💡 Example Questions for an AI Assistant

Once connected to the MCP Server, an AI assistant can answer questions like:

  • Where is my order ORD-1001?
  • Show me the tracking history for ORD-1002.
  • Cancel order ORD-1003.
  • Reschedule delivery for ORD-1004 to next Monday.
  • Find the warehouse responsible for Pune.
  • Search all delivered orders for Alice.

🧠 Why MCP?

Without MCP, every AI application would need custom integration code for each backend service.

MCP provides a standard interface that allows AI assistants to discover and invoke application capabilities through Tools, Resources, and Prompts.

This enables existing business applications to become AI-accessible with minimal changes.

🛠 Tech Stack

  • Python
  • FastAPI
  • SQLAlchemy
  • SQLite
  • Pydantic
  • HTTPX
  • FastMCP (Model Context Protocol)
  • Faker

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选