The Model Context Protocol (MCP) Command Center for Global Infrastructure
In modern logistics, "latency kills." When a natural disaster or geopolitical event occurs, information is scattered across news feeds, weather maps, and internal databases. Operators lose precious minutes switching between tabs, trying to piece together a complete picture of the crisis.
Context-switching fatigue costs millions in delayed response times.
Valkyrie uses the Model Context Protocol (MCP) to turn Notion into a living, breathing Command Center. It bridges real-time external "Threat Data" with internal "Asset Data," allowing an AI Agent to autonomously stage response plans for human approval.
| Feature | Description |
|---|---|
| Autonomous Threat Monitoring | Periodically scans global feeds for risks near assets listed in Notion |
| Instant Incident Staging | Automatically generates Notion pages with threat analysis and proposed response |
| Relational Integrity | Links incidents to affected assets using Notion's relation properties |
| Human-in-the-Loop | AI proposes solutions; humans approve and execute |
High-Level Core MCP Connection - The MCP Server as the Intelligence Hub
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Python Mock ββββββΆβ MCP Server ββββββΆβ Notion β
β Threat API β β (TypeScript) β β Workspace β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β² β β
β βΌ βΌ
Simulated AI Agent (IDE) Operations Dashboard
Crisis Data via MCP Client & Logistics DB
Technical Component Stack - Docker containers for MCP Server and Mock API
- MCP Server: TypeScript with
@modelcontextprotocol/sdk - Notion API: v2022-06-28 with block children for rich content
- Threat Simulator: Python FastAPI for realistic demo scenarios
- Deployment: Docker Compose + GitHub Actions CI/CD
| Tool | Description |
|---|---|
analyze_global_threats |
Check specific asset for threats, stage incident if detected |
scan_all_assets |
Scan all assets in Logistics database for threats |
get_asset_details |
Retrieve full details of a specific asset |
list_all_assets |
List all tracked assets with risk levels |
find_nearest_safe_asset |
Find nearest stable asset for rerouting |
- Node.js 20+
- Python 3.11+
- Notion account with integration access
git clone https://github.com/kanyingidickson-dev/valkyrie-mcp-server.git
cd valkyrie-mcp-server
npm install- Go to Notion Integrations
- Create a new integration called "Valkyrie Engine"
- Copy the integration token
Operations Dashboard Database:
| Property | Type |
|---|---|
| Incident Name | Title |
| Status | Status (Draft, Awaiting Approval, In Progress, Resolved) |
| Threat Level | Select (Critical (Red), Elevated (Yellow), Stable (Green)) |
| Affected Assets | Relation β Logistics DB |
| AI Assessments | Rich Text |
Global Assets & Logistics Database:
| Property | Type |
|---|---|
| Asset Name | Title |
| Coordinates | Text |
| Risk Sensitivity | Number (1-10) |
| Status | Select (Active, Inactive, Maintenance) |
| Facility Type | Select (Distribution Hub, Transport Node, Data Center) |
| Primary Contact | Text |
| Primary Phone | Phone |
| Primary Email | |
| Facility Manager | Text |
| Last Audit | Date |
On each database: Click ... β Add connections β Select "Valkyrie Engine"
cp .env.example .env
# Edit .env with your Notion token and database IDsEnsure the following env vars are set in your .env (examples in .env.example):
NOTION_TOKEN,DASHBOARD_DB_ID,LOGISTICS_DB_IDMOCK_API_URL(development)WEBHOOK_PORT,WEBHOOK_ACTION_TOKEN(webhook security)- Optional notifications:
SLACK_WEBHOOK_URL,SLACK_SIGNING_SECRET,EMAIL_SMTP_*,ALERT_RECIPIENT
The repository includes auxiliary scripts for local testing and orchestration:
- Start the webhook server (handles Slack interactive actions and link buttons):
npm run start:webhook- Start the Notion watcher (polls the Operations Dashboard for status changes):
npm run start:watcher- Start the scheduler (periodic
scan_and_stageruns):
npm run start:schedulerNotifications will only be sent if SLACK_WEBHOOK_URL and/or SMTP env vars are configured. The webhook action token must be set to enable secure action links.
pip install -r scripts/requirements.txt
python scripts/seed_assets.pypip install -r mock-api/requirements.txt
python mock-api/valkyrie_mock_api.pynpm run build
npm startAdd to your MCP client settings (Windsurf, Cursor, etc.):
{
"mcpServers": {
"valkyrie": {
"command": "node",
"args": ["/path/to/valkyrie-mcp-server/dist/index.js"],
"env": {
"NOTION_TOKEN": "secret_xxx",
"DASHBOARD_DB_ID": "xxx",
"LOGISTICS_DB_ID": "xxx"
}
}
}
}
Data Flow & Human-in-the-Loop Sequence - From threat detection to human approval
- Detection: Ask AI: "Valkyrie, check for threats near our Singapore Hub"
- Autonomous Action: AI fetches threat data via MCP, identifies seismic event
- Staging: AI creates Notion page with status "Awaiting Approval"
- Human Intervention: Operator reviews, changes status to "In Progress"
- Execution: Crisis Response Playbook is triggered
# Run each command on its own line
npm test
npm run lint
npm run format
npm run type-check
npm run build
npm start| Diagram | Description |
|---|---|
| Logical Overview | MCP Server as the Intelligence Hub |
| Deployment Overview | Docker containers & technical stack |
| Demo Workflow | Human-in-the-loop sequence |
# Health check
curl http://localhost:8000/health
# Check specific location
curl http://localhost:8000/status/Singapore%20Hub
# Force a threat (for demo)
curl http://localhost:8000/trigger/Singapore%20Hub
# Batch scan
curl http://localhost:8000/batch/scandocker-compose up -d
docker-compose logs -fvalkyrie-mcp-server/
βββ src/ # MCP server source code
β βββ index.ts # MCP server entry point
β βββ config.ts # Configuration management
β βββ lib/ # Core libraries
β β βββ assets.ts # Asset data utilities
β β βββ assets.d.ts # Type definitions
β βββ tools/ # MCP tool implementations
β β βββ index.ts # Tool exports
β β βββ analyze-threats.ts # analyze_global_threats tool
β β βββ scan-assets.ts # scan_all_assets tool
β β βββ get-asset-details.ts # get_asset_details tool
β β βββ list-assets.ts # list_all_assets tool
β β βββ find-nearest-safe.ts # find_nearest_safe_asset tool
β βββ types/ # Type definitions
βββ mock-api/ # Threat simulator API
β βββ valkyrie_mock_api.py # FastAPI threat simulator
β βββ requirements.txt
β βββ Dockerfile
βββ scripts/ # Orchestration & utility scripts
β βββ seed_assets.py # Populate Notion logistics DB
β βββ clean_duplicates.py # Remove duplicate assets
β βββ scan_and_stage.js # Scan assets and stage incidents
β βββ trigger_and_stage.js # Trigger threats and stage incidents
β βββ notion_watcher.js # Poll Notion for status changes
β βββ webhook_server.js # Handle Slack actions
β βββ scheduler.js # Periodic scan scheduler
β βββ notify.js # Notification utilities
β βββ requirements.txt
βββ tests/ # Test files
βββ docs/ # Documentation assets
β βββ logical-overview.png
β βββ deployment-overview.png
β βββ demo-workflow.png
βββ .github/ # CI/CD workflows
β βββ workflows/
β βββ valkyrie-deploy.yml
βββ .data/ # Local data storage
βββ .husky/ # Git hooks
βββ dist/ # Compiled output
βββ package.json # Dependencies & scripts
βββ tsconfig.json # TypeScript config
βββ jest.config.cjs # Jest test config
βββ .eslintrc.json # ESLint config
βββ .prettierrc # Prettier config
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile # MCP server container
βββ .env.example # Environment template
βββ MCP_INSTRUCTIONS.md # MCP usage guide
βββ LICENSE
βββ README.md
MIT License: See License