DB2ST MCP
A horizontally scalable Model Context Protocol server for exposing shipment tracking (and other data sources) as authenticated MCP tools, starting with DB Schenker's public tracking endpoint.
README
DB2ST MCP
Database-to-Structured-Tools MCP server. A horizontally scalable Model Context Protocol server that exposes shipment tracking (and, by design, other data sources) as authenticated MCP tools. Built in Python, deployable as a Knative Function.
The first tool wraps DB Schenker's public shipment tracking endpoint. The shape of the codebase is built so additional carriers, databases, or third-party endpoints slot in behind the same transport, auth, and scaling primitives.
Quickstart
uv sync --group dev # install deps
cp .env.example .env # configure
uv run db2st-mcp serve # start HTTP server on :8080
uv run pytest # unit suite (integration tests deselected)
uv run pytest -m integration # live upstream — needs unblocked egress IP
uv run pytest tests/e2e --report # E2E + Markdown report
Use as a local Claude Code MCP
# from the repo root
uv sync --group dev --extra fallback # extra installs Playwright
uv run playwright install chromium # download the browser driver
claude mcp add db2st-mcp -s user \
-e TOKEN_STORE=memory \
-e DB2ST_HTML_FALLBACK=1 \
-- uv --directory "$(pwd)" run db2st-mcp stdio
# verify
claude mcp list | grep db2st-mcp # should show: ✓ Connected
DB2ST_HTML_FALLBACK=1 enables the Playwright-based SPA scrape that
takes over when the upstream JSON path is rate-limited — which it
usually is from a fresh egress IP. Without the fallback, expect
shipment not found on most first-call attempts. The [fallback]
extra is what installs Playwright; see
CONTRIBUTING.md
for the full list of optional extras.
Then ask Claude Code to track a shipment, e.g. track DSV shipment 1806203236.
Two MCP tools are registered:
| Tool | Returns |
|---|---|
track_shipment |
Full structured shipment (sender, receiver, package, history). |
track_shipment_events |
Just the chronological events timeline — lighter for poll-style clients. |
Claude Code caches the MCP tool list per session. If you added this MCP before both tools were registered, restart Claude Code (or
claude mcp remove db2st-mcp -s userand re-add) so the second tool is exposed. The same applies after pulling new code: the stdio subprocess holds whatever was on disk atclaude mcp addtime, so source changes (bug fixes, new tools) don't propagate until the next add.
Want to see the raw JSON-RPC handshake + a tools/call exchange without
involving Claude Code? Run the example client:
uv run python scripts/example_call.py 1806203236
Use with other MCP clients
db2st-mcp is a vanilla stdio Model Context Protocol server, so any
MCP-compatible client can run it. The package is on PyPI, which means
the launch command across every client is the same:
uvx --from "db2st-mcp[fallback]" db2st-mcp stdio
This uses uv to download the package
on first run, install the optional [fallback] extra (Playwright,
needed when the upstream JSON API is rate-limited), and start the
stdio transport. The first run will also need a one-time
uvx playwright install chromium to download the browser driver.
If you don't want uv, swap uvx --from "db2st-mcp[fallback]" for
pipx run --spec "db2st-mcp[fallback]" or any other tool runner.
The two environment variables the server respects are:
| Var | Effect |
|---|---|
TOKEN_STORE=memory |
Skip the bearer-token check (suitable for local stdio; HTTP deployments should use the default upstash store + minted tokens). |
DB2ST_HTML_FALLBACK=1 |
Engage the Playwright SPA fallback when the upstream JSON API 429s. Strongly recommended for local use. |
Claude Desktop
Edit the config file (create it if missing):
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"db2st-mcp": {
"command": "uvx",
"args": ["--from", "db2st-mcp[fallback]", "db2st-mcp", "stdio"],
"env": {
"TOKEN_STORE": "memory",
"DB2ST_HTML_FALLBACK": "1"
}
}
}
}
Restart Claude Desktop to pick up the change.
Cursor
Per-project: .cursor/mcp.json in the repo root.
Global: ~/.cursor/mcp.json.
Same JSON shape as Claude Desktop (the mcpServers object above).
VS Code (GitHub Copilot Agent)
VS Code uses a different schema — servers (not mcpServers) and a
mandatory type field. Create .vscode/mcp.json:
{
"servers": {
"db2st-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "db2st-mcp[fallback]", "db2st-mcp", "stdio"],
"env": {
"TOKEN_STORE": "memory",
"DB2ST_HTML_FALLBACK": "1"
}
}
}
}
Continue (VS Code / JetBrains)
Create .continue/mcpServers/db2st-mcp.yaml in the workspace:
mcpServers:
- name: db2st-mcp
type: stdio
command: uvx
args:
- "--from"
- "db2st-mcp[fallback]"
- "db2st-mcp"
- "stdio"
env:
TOKEN_STORE: memory
DB2ST_HTML_FALLBACK: "1"
MCP tools are exposed in Agent mode only.
Cline (VS Code extension)
Open the Cline panel → MCP Servers icon → Configure MCP Servers.
That opens cline_mcp_settings.json (under VS Code's global extension
storage). Add the same mcpServers block as Claude Desktop, plus
Cline-specific keys if you want auto-approval:
{
"mcpServers": {
"db2st-mcp": {
"command": "uvx",
"args": ["--from", "db2st-mcp[fallback]", "db2st-mcp", "stdio"],
"env": { "TOKEN_STORE": "memory", "DB2ST_HTML_FALLBACK": "1" },
"disabled": false,
"alwaysAllow": []
}
}
}
Zed
Zed keys MCP servers under context_servers (not mcpServers).
Edit ~/.config/zed/settings.json:
{
"context_servers": {
"db2st-mcp": {
"command": {
"path": "uvx",
"args": ["--from", "db2st-mcp[fallback]", "db2st-mcp", "stdio"]
},
"env": {
"TOKEN_STORE": "memory",
"DB2ST_HTML_FALLBACK": "1"
}
}
}
}
Windsurf
Edit ~/.codeium/windsurf/mcp_config.json (Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json). Same JSON shape
as Claude Desktop.
Remote / HTTP-only clients
If your client doesn't speak stdio, point it at the deployed HTTP
transport instead (see the next section for how to start one + mint
a token). Most clients accept the same url + headers shape:
{
"mcpServers": {
"db2st-mcp": {
"url": "https://your-host/mcp/",
"headers": { "Authorization": "Bearer <token>" }
}
}
}
Programmatic / custom clients
Any MCP SDK can drive db2st-mcp directly — there's nothing
Claude-specific about the wire protocol. The tools/list →
tools/call flow is plain JSON-RPC 2.0, and
scripts/example_call.py is a 50-line
reference implementation of a stdio client doing the handshake +
calling track_shipment. Adapt that pattern for any agent framework
(LangChain MCP adapter, LlamaIndex tools, your own runner) — the
SDK choice is the consumer's; the server side stays unchanged.
Use as a deployed MCP (HTTP + auth)
# 1. start the server
uv run db2st-mcp serve
# 2. mint a token (one-time, secret is shown once)
uv run db2st-mcp mint --plan pro --limit 10000
# 3. call the MCP transport at /mcp with the bearer token.
# Streamable HTTP requires the Accept header to list both types.
# 3a. Full shipment record:
curl https://your-host/mcp/ \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"track_shipment","arguments":{"reference":"1806203236"}}}'
# 3b. Events timeline only (lighter — for poll-style clients):
curl https://your-host/mcp/ \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"track_shipment_events","arguments":{"reference":"1806203236"}}}'
Architecture
See ARCHITECTURE.md for system architecture and domain documentation.
Testing
See docs/TESTING.md for the unit/integration/e2e split, coverage gates, and CI workflows.
Contributing
See CONTRIBUTING.md and CLAUDE.md.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。