Skip to content

lewisawe/risk-radar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 Risk Radar — Dependency & Risk Intelligence for Notion

Built for the Notion MCP Hackathon — zero direct API calls, 100% MCP.

The Problem

Project managers track risks mentally but never systematically. When a task slips, nobody knows which 8 downstream tasks just broke their deadlines. Single points of failure hide in plain sight — one person quietly blocking an entire workstream. By the time anyone notices, the cascade has already happened.

The Solution

Risk Radar reads your Notion project databases, builds a dependency graph, and surfaces risks that humans miss. It writes actionable risk reports back to Notion and automatically propagates deadline changes through the dependency chain.

Mark one task late → watch 8 downstream dates shift automatically.

Everything runs through the Model Context Protocol (MCP) — zero direct Notion API calls.

How It Works

  1. Read — Fetches all projects and tasks from Notion via MCP, including dependency relations
  2. Analyze — Builds a directed dependency graph and runs:
    • Critical path detection (longest dependency chain)
    • At-risk task identification (overdue, due soon but not started)
    • Single point of failure detection (one person blocking multiple downstream tasks)
    • Cascade impact calculation (if task X slips, what breaks?)
  3. Score — Calculates an overall risk score (0-100) based on overdue ratio, SPOF count, and cascade exposure
  4. Narrate — Gemini AI generates an executive summary referencing specific tasks, people, and numbers
  5. Write — Creates a formatted Risk Report page in Notion with all findings
  6. Track — Logs a health history entry for trend analysis over time
  7. Cascade — For overdue tasks, automatically pushes downstream deadlines forward via MCP

The Demo

  1. Show the Tasks database with dependencies linked
  2. Run npm run scan — a risk report appears in Notion with critical path, SPOFs, and cascade risks
  3. Mark a task as overdue
  4. Run scan again — watch downstream deadlines shift automatically
  5. Show Health History tracking risk scores over time

Technical Architecture

┌─────────────┐   mcp-remote   ┌──────────────────┐
│  Risk Radar  │◄──────────────►│  Notion MCP      │
│  Agent       │   (stdio→HTTP) │  mcp.notion.com  │
└──────┬───────┘                └────────┬─────────┘
       │                                 │
       ▼                                 ▼
┌──────────────┐              ┌──────────────────┐
│ Risk Engine  │              │  Notion Workspace │
│ - DAG build  │              │  - Projects DB    │
│ - Critical   │              │  - Tasks DB       │
│   path (DFS) │              │  - Reports DB     │
│ - SPOF scan  │              │  - Health DB      │
│ - Cascade    │              └──────────────────┘
│   propagation│
└──────┬───────┘
       │
       ▼
┌──────────────┐
│ Gemini 2.5   │
│ Flash (AI)   │
└──────────────┘

The agent uses 4 MCP tools: notion-search to query databases, notion-fetch to read pages and resolve relations, notion-create-pages to write reports and health entries, and notion-update-page to cascade deadline changes.

Risk Engine Algorithms

  • Critical Path — DFS with memoization to find the longest dependency chain from root tasks
  • Single Points of Failure — Recursive downstream traversal per owner, flagging anyone blocking ≥2 tasks
  • At-Risk Detection — Deadline analysis: overdue tasks, tasks due in <3 days but not started, tasks due tomorrow still in progress
  • Cascade Impact — BFS from each at-risk task through the dependency graph to find all affected downstream tasks
  • Risk Score — Weighted formula: overdue_ratio × 40 + spof_penalty (max 30) + cascade_penalty (max 30)

Notion Database Schema

Projects

Property Type
Project Name Title
Status Status (Active / On Hold / Complete)

Tasks

Property Type
Task Name Title
Owner People
Deadline Date
Status Status (Not started / In progress / Done)
Depends On Relation → Tasks (self-referencing)
Project Relation → Projects

Risk Reports

Property Type
Report Name Title
Risk Score Number
Date Date

Health History

Property Type
Project Title
Risk Score Number
Date Date
Status Select (Healthy / Warning / Critical)

Setup

cp .env.example .env
# Fill in GEMINI_API_KEY and all DB IDs

npm install

# Seed sample data (optional)
npx tsx src/seed.ts

# Run risk scan
npm run scan

# Manual cascade: simulate a task slipping by N days
npm run cascade -- "Design API Schema" 3

On first run, mcp-remote opens a browser for Notion OAuth. Credentials are cached after that.

Tech Stack

  • TypeScript + tsx
  • @modelcontextprotocol/sdk + mcp-remote (Notion MCP connection)
  • @google/generative-ai (Gemini 2.5 Flash for risk narratives)
  • Custom graph algorithms (critical path, cascade propagation, SPOF detection)
  • Notion as the entire data layer — no external database

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors