MCPcopy Index your code
hub / github.com/brianlovin/github-stars-notion-sync

github.com/brianlovin/github-stars-notion-sync @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
101 symbols 239 edges 15 files 1 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Screen Shot 2026-05-22 at 16 11 18@2x

GitHub Stars → Notion

Sync your GitHub starred repos into a Notion database. Every starred repo becomes a Notion page with rich metadata (description, stars, topics, languages, license, owner avatar) and the README rendered into the page body — fully searchable inside Notion. A daily delta sync picks up newly-starred repos automatically.

The worker also exposes two tools so a Notion AI agent can star and unstar repos on your behalf — useful for prompts like "unstar every archived repo" or "unstar all repos from owner X".

Runs on Notion Workers — no server, no cron.

Setup

Install the Notion CLI:

curl -fsSL https://ntn.dev | bash
ntn login

Clone and run setup:

git clone https://github.com/brianlovin/github-stars-notion-sync.git
cd github-stars-notion-sync && npm install && npm run setup

Setup asks for a Notion Personal Access Token, walks you through registering a GitHub OAuth app, creates the GitHub Stars database (with views for All Repos / Active / Archived / By Owner / By Language), deploys the worker, then runs an initial backfill of every starred repo.

For the GitHub OAuth app at github.com/settings/applications/new, the only field that matters is the Authorization callback URL: https://www.notion.so/workers/oauth/callback.

Worker tools

After deploy, two tools are available to any Notion AI agent connected to the worker:

  • Star a GitHub repository — adds a star
  • Unstar a GitHub repository — removes a star

Pair the agent with the GitHub Stars database and try prompts like:

  • "Unstar every repo where Archived is true."
  • "Unstar all repos from owner {owner}."
  • "Star {owner/repo}."

The agent finds candidates in Notion and calls the tools. Each action goes through GitHub's API using the same OAuth grant the sync uses.

Maintenance

npm run backfill                              # idempotent full re-sync
npm run dedup                                 # archive duplicate rows (recovery only)
ntn workers sync trigger githubStarsDelta     # force a delta sync now
ntn workers sync status                       # health check
ntn workers runs list                         # recent runs + audit detail

Change schedule: "1d" in src/index.ts (valid 5m7d) and run ntn workers deploy to adjust the cadence.

Development

npm run check    # type-check (no emit)
npm test         # unit tests (~200ms, no network)

License

MIT — see LICENSE.

Extension points exported contracts — how you extend this code

DeltaState (Interface)
(no doc)
src/index.ts
RewriteOptions (Interface)
(no doc)
src/markdown.ts
GitHubClientOptions (Interface)
(no doc)
src/github.ts
Row (Interface)
(no doc)
src/query.ts
UpsertOptions (Interface)
(no doc)
src/upsert.ts
BackfillConfig (Interface)
(no doc)
scripts/backfill.ts
DatabaseHandles (Interface)
(no doc)
scripts/setup.ts
RecordedCall (Interface)
(no doc)
tests/upsert.test.ts

Core symbols most depended-on inside this repo

rewriteRelativeUrls
called by 13
src/markdown.ts
ok
called by 11
scripts/lib.ts
bail
called by 9
scripts/lib.ts
buildRepoProps
called by 7
src/repo-props.ts
githubRequest
called by 6
src/github.ts
step
called by 6
scripts/lib.ts
runNtn
called by 6
scripts/lib.ts
archiveDuplicates
called by 5
src/upsert.ts

Shape

Function 74
Interface 17
Method 6
Class 4

Languages

TypeScript100%

Modules by API surface

scripts/lib.ts20 symbols
src/github.ts19 symbols
src/repo-props.ts11 symbols
scripts/backfill.ts11 symbols
scripts/setup.ts9 symbols
src/upsert.ts7 symbols
src/markdown.ts7 symbols
tests/upsert.test.ts5 symbols
src/index.ts4 symbols
src/tools.ts3 symbols
src/repos-schema.ts2 symbols
src/query.ts2 symbols

For agents

$ claude mcp add github-stars-notion-sync \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact