Skip to main content
Glama
github-stars-mcp

github-stars-mcp

by SalAkBuK

GitHub Stars MCP (github-stars-mcp)

License: MIT Node.js Version Model Context Protocol Tests Catalog

A production-grade, context-window-aware Model Context Protocol (MCP) server that organizes your GitHub starred repositories using AI agents, creates curated markdown catalogs with non-destructive merge, and synchronizes directly with native GitHub Star Lists.


💡 Why This Exists: The "Star Graveyard"

Most developers have dozens or hundreds of starred repositories on GitHub that sit completely unused:

  • No Search by Concept: GitHub search only matches exact words. Searching for "local embedding model" won't find a repo titled "fast-sentence-bert".

  • Context Window Exhaustion: Trying to feed 70+ full README files directly into an LLM blows past context limits and incurs heavy token costs.

  • Data Loss on Updates: Re-running generic organization scripts often wipes personal notes, destroys custom tags, or creates duplicate lists.

  • Rate-Limiting & Drift: Fast concurrent API calls hit GitHub secondary rate limits (HTTP 403/429) or suffer from index drift when new stars are added mid-run.

GitHub Stars MCP solves all of these problems with an enterprise-grade, resilient Map-Reduce pipeline.


Related MCP server: star-knowledge-base

⚡ Key Features

  • 🔍 Local Concept & Problem-to-Solution Search Engine: Zero-dependency local hybrid BM25 with multi-field weighted scoring (name 1.5x, tags 2.0x, category 1.2x, elevator_pitch 1.8x, distilled_readme 1.0x) and phrase boost. Discovers repositories by conceptual need (e.g. "fast decision engine" -> NandhaKishorM/laya, "screen tracker" -> codetesla51/screentime) in < 5ms completely offline.

  • 🩺 Repository Health & Staleness Audit Engine: Comprehensive freshness categorization (ACTIVE <60d, SLOW 60-180d, STALE 180-365d, DEAD_ABANDONED >1y, ARCHIVED), legal licensing assessment (Permissive, Copyleft, Unlicensed), and composite 0-100 normalized Health Score.

  • 🤖 AI Agent Tech-Stack Recommender: Ingests task descriptions or project briefs, filters out archived/dead tools, and outputs tailored recommendations with copy-paste installation commands (go install, pip install, cargo add, npm install) and rationale.

  • 💻 Unified Standalone Terminal CLI (github-stars): Run github-stars search, github-stars audit, github-stars recommend, github-stars sync, and github-stars catalog directly in your terminal with colored dashboards and JSON piping.

  • 🧠 Multi-Agent Map-Reduce Pipeline: Freezes an immutable snapshot of all starred repos at initialization (github_orchestrate_workers), slices them into deterministic worker chunks (github_get_worker_chunk), and collects results into a unified session (github_submit_worker_digest) with zero pagination drift.

  • 🧹 Semantic README Distillation: Cleanses raw documentation by stripping badges, images, SVGs, license blocks, and tables while strictly preserving centered hero text, elevator pitches, and core architectural concepts.

  • ⚡ Two-Tier Caching (Memory + Disk): L1 in-memory + L2 disk cache. Incremental runs process newly starred repositories in milliseconds, consuming zero API rate limits for existing stars.

  • 🛡️ Non-Destructive Smart Merge: Automatically detects existing GITHUB_STARS.md files. Appends new stars, updates table-of-contents badges, and strictly preserves user manual notes (> **User Note:**) and custom annotations.

  • 🔄 Live GitHub Star Lists Synchronization: Directly interacts with GitHub's GraphQL API to create canonical category lists on github.com/stars/<user>/lists and assign repositories to them with atomic batch mutations.

  • 🛡️ Production Resilience Layer:

    • Exponential Backoff with Jitter: Automatically catches and retries transient HTTP 403, 429, and socket reset errors.

    • Empty / Missing README Fallback: Synthesizes structured context from repository descriptions, languages, and topics if a repository lacks a README.

    • Windows Atomic File Writes: Uses temporary files with atomic rename and retry backoff to eliminate Windows EBUSY file locking errors under concurrent sub-agent access.

    • Security Hardening: Strict workspace sandboxing (CWE-22 path traversal defense) and prototype collision protection (CWE-1321).


📐 Architecture & Flow

flowchart TD
    subgraph GitHub["GitHub Platform"]
        G1["User Starred Repositories"]
        G2["Live GitHub Star Lists (GraphQL)"]
    end

    subgraph Server["github-stars-mcp Server"]
        S1["fetchAllStarsSnapshot()"]
        S2["Two-Tier Cache (L1 Memory / L2 Disk)"]
        S3["Semantic Distiller (distillReadme)"]
        S4["Multi-Agent Orchestrator"]
        S5["Taxonomy Normalizer (Sørensen-Dice)"]
        S6["Smart Merge Exporter"]
    end

    subgraph Agents["AI Agent Layer (Antigravity / Claude / Cursor)"]
        A1["Primary Planner Agent"]
        A2["Worker Sub-Agent 1"]
        A3["Worker Sub-Agent 2"]
        A4["Worker Sub-Agent N"]
    end

    subgraph Output["Artifacts"]
        O1["GITHUB_STARS.md (Dual TOC Anchors)"]
    end

    G1 --> S1
    S1 --> S2
    S2 -- Miss --> S3
    S3 --> S4
    S4 --> A1
    A1 --> A2 & A3 & A4
    A2 & A3 & A4 --> S5
    S5 --> S6
    S6 --> O1
    S6 --> G2

🚀 Quickstart & Installation

1. Prerequisites

  • Node.js: v18.0.0 or higher

  • GitHub Authentication: Either the GitHub CLI (gh) authenticated with user scope:

    gh auth login -s user,repo

    OR a personal access token set in your environment:

    export GITHUB_PERSONAL_ACCESS_TOKEN="ghp_yourTokenHere"
    # On Windows PowerShell:
    $env:GITHUB_PERSONAL_ACCESS_TOKEN="ghp_yourTokenHere"

2. Clone and Install Dependencies

git clone https://github.com/SalAkBuK/github-stars-mcp.git
cd github-stars-mcp
npm install

🔌 Connecting to AI Coding Assistants

Claude Desktop

Add this to your claude_desktop_config.json (%APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "github-stars": {
      "command": "node",
      "args": ["/absolute/path/to/github-stars-mcp/index.js"]
    }
  }
}

Antigravity / Cursor / Cline (mcp_config.json)

{
  "mcpServers": {
    "github-stars": {
      "command": "node",
      "args": ["/absolute/path/to/github-stars-mcp/index.js"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourTokenHere"
      }
    }
  }
}

🛠️ MCP Tool Reference

Tool Name

Type

Description

github_search_stars

Search

Instant offline concept & problem-to-solution discovery (< 5ms) via local hybrid BM25 and weighted field scoring.

github_audit_stars_health

Audit

Analyzes repository freshness (active/slow/stale/abandoned/archived), license safety, and calculates composite 0-100 Health Score.

github_recommend_stack

Recommendation

AI Agent Stack Recommender: matches project briefs to vetted starred tools with copy-paste install commands.

github_orchestrate_workers

Orchestration

Freezes a static star snapshot, computes optimal chunk sizes, and returns prompt plans for parallel workers.

github_get_worker_chunk

Worker

Returns an assigned slice of repositories with pre-distilled READMEs and token budgets.

github_submit_worker_digest

Worker

Ingests analyzed repositories, normalizes category names, and updates the orchestration session.

github_get_orchestration_status

Monitoring

Checks completion status, active worker state machines, and catalog progress.

github_force_reduce_session

Resilience

Reassigns failed workers or forces compilation from completed chunks if a worker times out.

github_export_catalog

Catalog

Generates or merges GITHUB_STARS.md with Table of Contents, tags, and preserved notes.

github_get_user_lists

Live Sync

Fetches native user star lists from github.com/stars/<user>/lists.

github_create_user_list

Live Sync

Creates a new native GitHub Star List via GraphQL mutation.

github_assign_repo_to_lists

Live Sync

Assigns repositories to one or more GitHub Star Lists on github.com.

github_batch_get_starred_with_readme

Batch Read

Fetches a batch of starred repos with distilled READMEs for single-agent workflows.

github_get_readme

Read

Fetches and distills a single repository's README.

github_list_starred

Read

Lists starred repositories with pagination, stars count, and topics.

github_get_user_info

Info

Returns authenticated username and total star count.

github_clear_cache

Maintenance

Flushes in-memory and disk caches.


💻 Standalone Terminal CLI (github-stars)

You can use github-stars as a fast terminal tool completely independent of an active AI assistant:

# Instant conceptual search (< 5ms offline)
npx github-stars search "fast decision engine"
npx github-stars search "screen tracker" --limit 5

# Repository health and license audit
npx github-stars audit
npx github-stars audit --filter stale
npx github-stars audit --filter unlicensed --json

# AI agent tech-stack recommendation
npx github-stars recommend "screen time tracker daemon in Go" --language Go

# Live synchronization with GitHub Star Lists
npx github-stars sync

# Catalog export and merge
npx github-stars catalog --mode merge

CLI Options Reference

Option

Command(s)

Description

--category <name>

search

Filter search scope to a specific category.

--limit <number>

search, recommend

Maximum number of results to return (default: 10 for search, 5 for recommend).

--min-score <number>

search

Minimum BM25 similarity score threshold (default: 0.1).

--filter <type>

audit

Filter audit report: all, stale (>180d or dead), archived, or unlicensed.

--min-health <number>

audit

Minimum composite health score threshold (0-100).

--language <name>

recommend

Constrain stack recommendations by programming language (e.g. Go, Rust, Python, TypeScript).

--mode <merge|overwrite>

catalog

Export mode: merge (preserves manual notes and merges new repos) or overwrite.

--file <path>

All

Path to custom GITHUB_STARS.md catalog file.

--refresh

audit

Refresh live repository metadata from GitHub API into local cache.

--json

All

Output results in clean, machine-readable JSON format.


📂 Canonical Baseline Taxonomy

The default taxonomy is calibrated to cover software development domains without category explosion:

  1. AI & Agent Infrastructure: Agent harnesses, LLM toolkits, MCP servers, and prompt frameworks.

  2. Developer Tools & CLI: Terminals, build tools, editors, and modern developer utilities.

  3. System Design & Backend Architecture: Distributed systems, network proxies, games, and backend engines.

  4. Frontend & UI Libraries: Component libraries, design systems, icons, and UI primitives.

  5. Databases & Data Engineering: Embedded databases, SQL engines, and analytical storage.

  6. Security & Reverse Engineering: Decompilers, secret scanners, static analyzers, and offensive tooling.

  7. Educational & Roadmaps: CS fundamentals, interview guides, and engineering primers.

  8. Inspiration & Creative Ideas: Creative experiments, hardware drivers, and retro simulators.


🧪 Running the Test Suite

The repository includes comprehensive unit and integration test batteries covering regression fixes, rate limiting, and atomic disk writes:

# Run core regression & audit suites
npm test

# Run multi-agent resilience & concurrency tests
npm run test:resilience

# Test live GitHub list sync script
npm run sync

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

Available Tools

17 tools
github_assign_repo_to_listsA

Assign or update a repository's membership in native GitHub Star Lists (requires token with 'user' scope).

Inputs: list_ids (required), repo_node_id (required).

github_audit_stars_healthA

Audit health, maintenance freshness, and licensing safety across starred repositories. Detects dead abandonware, stale projects, and unmaintained dependencies with composite 0-100 health scoring.

Inputs: filter, refresh, min_health_score.

github_batch_get_starred_with_readmeB

High-performance batch tool: fetches starred repositories + distilled READMEs with dynamic token budgeting, local caching, and speculative next-batch prefetching.

Inputs: page, sort, distill, profile, +5 more.

github_clear_cacheB

Clear memory and disk caches for GitHub stars and READMEs.

Inputs: no named parameters.

github_create_user_listA

Create a new native GitHub Star List on github.com (requires token with 'user' scope).

Inputs: name (required), is_private, description.

github_export_catalogB

Save or update an organized Markdown catalog file (e.g. GITHUB_STARS.md) grouping repositories by category with summaries and tags.

Inputs: mode, file_path, categories, catalog_title, +1 more.

github_force_reduce_sessionA

Resilience Tool: Force-reduces an orchestration session when a worker is orphaned, times out, or fails. Can proceed with available repos or reassign missing chunks.

Inputs: session_id (required), missing_worker_policy (required).

github_get_orchestration_statusB

Inspect current progress, completed workers, worker state machine, and compiled categories of an orchestration session.

Inputs: session_id (required).

github_get_readmeB

Fetch the README markdown for a repository with semantic distillation, ETag caching (24h TTL), and context budget controls.

Inputs: repo (required), owner (required), distill, profile, +2 more.

github_get_user_infoA

Get authenticated GitHub user details and total count of starred repositories (cached with 15min TTL).

Inputs: refresh.

github_get_user_listsB

Get all native GitHub Star Lists created by the authenticated user along with their current items and IDs.

Inputs: refresh.

github_get_worker_chunkA

Worker Tool: Fetches the exact frozen snapshot chunk assigned to this worker by session_id and worker_id, including pre-distilled READMEs.

Inputs: worker_id (required), session_id (required), profile.

github_list_starredB

Fetch a paginated list of starred repositories with details (cached with 10min TTL).

Inputs: page, sort, refresh, per_page, +1 more.

github_orchestrate_workersA

Map-Reduce Step 1: Takes an immutable frozen snapshot of all starred repos (eliminating mid-run mutation drift), extracts baseline taxonomy, and generates balanced worker chunk plans.

Inputs: profile, session_id, num_workers, custom_categories.

github_recommend_stackB

AI Agent Tech-Stack Recommender: recommends vetted starred tools and libraries for a project brief or task description, with copy-paste installation commands and rationale.

Inputs: task_description (required), language, max_recommendations.

github_search_starsB

Instant offline concept & problem-to-solution discovery across starred repositories. Powered by zero-dependency local hybrid BM25 and weighted field scoring (< 5ms).

Inputs: query (required), limit, category, min_score.

github_submit_worker_digestA

Map-Reduce Step 2: Allows sub-agents to submit their distilled category & pitch digest. Validates against baseline taxonomy, prevents reassigned worker race conditions, and handles GraphQL list sync fallback.

Inputs: worker_id (required), session_id (required), analyzed_repos (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have clear, distinct responsibilities, especially the orchestration pipeline steps. However, list_starred and batch_get_starred_with_readme overlap significantly in retrieving starred repos, and get_readme also overlaps with the batch tool's README fetching, creating potential confusion.

    Naming Consistency5/5

    All tools follow a consistent github_verb_noun pattern in snake_case. Even longer names like batch_get_starred_with_readme and assign_repo_to_lists fit the convention, making the set highly predictable.

    Tool Count4/5

    At 17 tools, the set is slightly above the ideal 3-15 range but each tool serves a defined purpose—the orchestration group alone accounts for 5. The count feels heavy but not bloated for the breadth of features offered.

    Completeness3/5

    The server covers star retrieval, README reading, list management, catalog export, health auditing, and search. Notable gaps include no way to remove a star/unstar, no delete or rename for user lists, and list membership only being add/update without explicit removal functionality.

    Maintenance

    ActivityStale
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to search and retrieve information from your GitHub starred repositories via semantic matching, turning your stars into a searchable personal code toolbox.
      1
      -
    • A
      license
      A
      quality
      B
      maintenance
      Exposes a locally indexed, Chinese-and-English searchable knowledge base of your starred GitHub repositories as MCP tools, letting agents search by what a project does, fetch full records, view statistics, sync new stars, and rebuild the index.
      3
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Exposes a local SQLite catalog of your GitHub stars — READMEs, licenses, topics, tags, notes, and fit scores — as fifteen read and write tools for a coding agent over stdio, with spend-limited live GitHub search, refresh, and sweep calls. It lets agents search and annotate the library and rescore repositories without ever acting on GitHub.
      -