Skip to main content

GitHub Events Monitor with FastAPI and MCP server

Project description

GitHub Events Monitor

A Python-based service that monitors GitHub Events (WatchEvent, PullRequestEvent, IssuesEvent), stores them in SQLite, exposes data through an MCP server (each tool = API endpoint), and publishes interactive visualizations to a GitHub Pages site from the docs/ folder.

Architecture (C4 L1)

[Person: Dashboard User] → [Container: GitHub Pages (docs/)] ← [Container: Data Exporter] ← [Container: Events DB (SQLite)] ← [Container: Event Monitor Service] ← [External System: GitHub API /events] [Person: API Consumer] → [Container: MCP Server] → [Container: Events DB (SQLite)]

Components

  • Event Monitor: Polls https://api.github.com/events, filters target types, stores to SQLite, computes PR metrics.
  • MCP Server: Tools to retrieve metrics/data directly from the DB.
  • Data Exporter: Builds docs/data.json and Plotly HTML charts in docs/.
  • GitHub Pages: Static dashboard served from docs/.

Setup

  1. Python env
  • python -m venv venv
  • source venv/bin/activate
  • pip install -r requirements.txt
  1. Initialize DB
  • sqlite3 database/events.db < database/schema.sql
  1. Run monitor
  • python service/github_monitor.py # continuous
  • python service/github_monitor.py --once # single cycle (useful in CI) Optional: export GITHUB_TOKEN for higher limits.
  1. Export dashboard data
  • python service/data_exporter.py
  1. MCP server
  • python mcp/server.py

GitHub Pages

  • Push to main branch.
  • Enable Pages from Settings → Pages → Deploy from a branch → main → /docs.

Notes

  • created_at_ts (epoch) enables correct time filtering and SQLite date ops.
  • For production, consider PostgreSQL, containerization, and a retention policy for events.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_events_monitor-1.0.1.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_events_monitor-1.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file github_events_monitor-1.0.1.tar.gz.

File metadata

File hashes

Hashes for github_events_monitor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e4b7cb2b12a327d43174129f61f7c8c373f677524c279d5e5e6e7af636056ccb
MD5 c87c1c5ae2fa05490d75daf6d2d56abe
BLAKE2b-256 b8f02fdf98106803ee3297d3d4b84bb3174ea8e748f5a6567bd2f5ebe477ecd2

See more details on using hashes here.

File details

Details for the file github_events_monitor-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_events_monitor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ffb4226255cc82a23ad8dd523cffb3ce6f2ae59891338bf6dacad6c9afb3f909
MD5 852b6801173bf901d56e29ee52ad2b76
BLAKE2b-256 7c05f4e6e31040afab84c20754c7f9702ed427886d3a1d7fc8095b2d5aa6c21f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page