Supply Chain Disruption Monitor
MCP server that exposes tools for monitoring supply chain disruptions, including vessel positions, port weather, congestion, and news. Includes an AI agent that synthesizes these sources to assess route risks.
README
Supply Chain Disruption Monitor
An MCP server exposing supply chain intelligence tools, with a PydanticAI agent that synthesizes them to answer disruption questions.
Demo scenario: "What disruptions could affect shipments from Shanghai to Rotterdam right now?"
The agent calls multiple tools, synthesizes the results, and produces a structured risk assessment — demonstrating that the value is in the reasoning across sources, not any single data lookup.
Built as a self-training project and portfolio artifact.
Tech stack
| Layer | Choice | Notes |
|---|---|---|
| MCP server | Python MCP SDK (mcp) |
FastMCP decorator API, stdio transport |
| Agent framework | PydanticAI | MCPToolset + StdioTransport to wire agent → server |
| LLM | qwen2.5:7b via Ollama | Local, reliable tool calling |
| Vessel data | AISStream.io | Free WebSocket AIS feed |
| Weather | Open-Meteo | Free, no API key |
| News | NewsAPI | Free tier (100 req/day) |
| Port congestion | Mocked | Realistic synthetic data |
Setup
1. Prerequisites
2. Install dependencies
cd supply-chain-disruption-monitor
uv sync
3. Pull the model
ollama pull qwen2.5:7b
4. Configure API keys
cp .env.example .env
Edit .env and fill in:
- AISSTREAM_API_KEY — Free at aisstream.io. Provides real-time vessel positions via WebSocket AIS feed.
- NEWS_API_KEY — Free at newsapi.org. 100 requests/day on the free tier.
The weather tool (Open-Meteo) needs no key.
Running
MCP server (standalone — for development / MCP Inspector)
uv run mcp dev server.py
This opens the MCP Inspector in your browser so you can call tools interactively.
Agent only
Note:
agent.pyis a sample MCP client, not part of the server itself. It plays the same role Claude Desktop, Codex, or any other MCP client would — it launchesserver.pyover stdio, runs the agent loop against a local model (Ollama), and synthesizes the tool results. The server is the deliverable; the agent is just one interchangeable consumer of it. It imports nothing fromserver.pyand talks to it purely over the MCP protocol, so you can swap in any other MCP client without touching the server.
# Default query: Shanghai to Rotterdam risk assessment
uv run agent.py
# Custom query
uv run agent.py "What risks affect container ships transiting the Red Sea?"
Full demo (tool outputs + agent synthesis)
uv run demo.py # tools + agent
uv run demo.py --tools-only # just raw tool outputs
uv run demo.py --agent-only # just the agent synthesis
MCP tools
| Tool | Source | Returns |
|---|---|---|
list_major_ports(region) |
Static | Major ports by region — use this first to identify route waypoints |
get_port_weather(port_name) |
Open-Meteo | Current conditions + 24h forecast, wind speed in knots, operational impact |
get_vessel_positions(region) |
AISStream.io | Live vessel snapshot: MMSI, name, position, speed, nav status |
search_disruption_news(query, days) |
NewsAPI | Recent headlines + high-signal flag (strikes, attacks, blockages) |
get_port_congestion(port_name) |
Mocked | Utilization %, queue depth, wait hours, trend, advisory |
The agent synthesizes across all five — there is no single assess_route_risk tool. The multi-tool reasoning is the point.
Add this server to Claude Desktop
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"supply-chain-monitor": {
"command": "uv",
"args": ["run", "--directory", "/path/to/supply-chain-disruption-monitor", "python", "server.py"],
"env": {
"AISSTREAM_API_KEY": "your_key_here",
"NEWS_API_KEY": "your_key_here"
}
}
}
}
Project structure
supply-chain-disruption-monitor/
├── server.py # FastMCP server — all 5 tools
├── agent.py # Sample MCP client (PydanticAI) — interchangeable with Claude Desktop, Codex, etc.
├── demo.py # Demo script (tool outputs + agent synthesis)
├── tools/
│ ├── ports.py # Static port data + coordinates (27 major ports)
│ ├── weather.py # Open-Meteo integration
│ ├── vessels.py # AISStream.io WebSocket integration
│ ├── news.py # NewsAPI integration
│ └── congestion.py # Mocked port congestion (realistic synthetic data)
├── pyproject.toml
├── .env.example
└── README.md
Design notes
Why mock port congestion? Live data (MarineTraffic, FreightWaves) requires enterprise subscriptions (£100+/month). Mocking gives full demo control — a "Shanghai congestion spike" can be shown without paywall friction. The tool interface is identical to what a real API would return.
Why AISStream.io? It's a free, real-time WebSocket AIS feed. A vessel actually moving through the South China Sea is a better demo moment than a static mock.
Why qwen2.5:7b? Reliable tool-calling behavior at a size that runs well on consumer hardware (16 GB RAM). Swap in any model with Ollama support by changing OLLAMA_MODEL in .env.
Why PydanticAI? PydanticAI co-maintains the official Python MCP SDK, so using their stack is thematically coherent. MCPServerStdio is the native path for agent → MCP server wiring.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。