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
- Python env
- python -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
- Initialize DB
- sqlite3 database/events.db < database/schema.sql
- 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.
- Export dashboard data
- python service/data_exporter.py
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file github_events_monitor-1.0.1.tar.gz.
File metadata
- Download URL: github_events_monitor-1.0.1.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4b7cb2b12a327d43174129f61f7c8c373f677524c279d5e5e6e7af636056ccb
|
|
| MD5 |
c87c1c5ae2fa05490d75daf6d2d56abe
|
|
| BLAKE2b-256 |
b8f02fdf98106803ee3297d3d4b84bb3174ea8e748f5a6567bd2f5ebe477ecd2
|
File details
Details for the file github_events_monitor-1.0.1-py3-none-any.whl.
File metadata
- Download URL: github_events_monitor-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffb4226255cc82a23ad8dd523cffb3ce6f2ae59891338bf6dacad6c9afb3f909
|
|
| MD5 |
852b6801173bf901d56e29ee52ad2b76
|
|
| BLAKE2b-256 |
7c05f4e6e31040afab84c20754c7f9702ed427886d3a1d7fc8095b2d5aa6c21f
|