star-knowledge-base
Serves an agent-searchable knowledge base built from your GitHub starred repositories, so agents can search projects semantically or by keyword, fetch full details for a repo (README summary, topics, language, star count, category, DeepWiki/Zread deep-reading links, personal pinned notes), and list facet distributions across languages, categories and topics instead of Googling for a library.
Acts as the zero-backend data source for the MCP server: the star knowledge base (data.json) is published to GitHub Pages and the server pulls it over HTTP from a configured STAR_DATA_URL, caching it and refreshing periodically, so the agent always queries an up-to-date index without any server-side infrastructure.
Optional OpenAI-compatible LLM endpoint used for semantic search: keyword pre-filtering followed by LLM re-ranking of candidate starred projects at query time, and for generating Chinese summaries, scenario tags and quality scores during data sync. Works with any OpenAI-compatible base URL, so free providers such as Zhipu GLM, Groq or DeepSeek can be plugged in.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Star Knowledge Base
让你的 GitHub Stars 从收藏夹变成 agent 可检索的个人代码工具箱。
项目定位
通过 GitHub Pages 部署你的 star 项目知识库,本地 agent 通过 MCP server 接入,迅速获取合适的项目。一句话定位:Google 之前先问 agent。
Related MCP server: GitHub Stars MCP Server
核心痛点
开发者 star 项目后往往会遗忘。star 500+ 个项目,三个月后能记住的不到 10%。当需要某个库时,习惯性 Google 搜索,找到新库后发现其实自己 star 过。这个工具让 agent 帮你从 star 列表中做语义推荐,省去重复搜索的时间。
零摩擦设计
本项目遵循零摩擦原则,不配任何 LLM API key 也能跑:
模式 | 元数据生成 | 搜索方式 | 适用场景 |
启发式模式(默认,零门槛) | description + README 第一段 + topics + star 数评分 | 加权关键词匹配 | clone 即可跑,适合快速试用 |
LLM 增强模式(推荐) | LLM 生成中文摘要、场景标签、质量评分 | 关键词预筛 + LLM 语义精排 | 配了 LLM key 后自动启用,质量大幅提升 |
如需启用 LLM 增强模式,可选用以下任意 OpenAI 兼容的 LLM 渠道(排名不分先后,按个人需求选择):
LLM API 渠道参考
渠道 | 费用 | OpenAI 兼容 | 国内访问 | base_url | model |
智谱 GLM-4.7-Flash | 永久免费 | 是 | 稳定 |
|
|
Groq | 免费速率限制 | 是 | 需代理 |
|
|
DeepSeek | 付费 | 是 | 稳定 |
|
|
OpenAI 官方 | 付费 | - | 需代理 | 留空 |
|
Anthropic Claude | 付费 | - | 需代理 | 留空 |
|
注:智谱 GLM-4.5-Flash 已于 2026-01-30 下线,当前免费模型为 GLM-4.7-Flash。
关于 DeepWiki/Zread:它们是"按需实时生成文档"的工具,没有批量预计算摘要的 API,不能替代 sync 阶段的 LLM。本项目通过 deepwiki_url / zread_url 字段让 agent 在查询时实时调用它们的 MCP,做深度理解(多跳推理),职责分离。
架构
GitHub Actions(定时)→ 拉 star 数据 + LLM 生成元数据 → JSON
↓
push 到 gh-pages
↓
GitHub Pages: data.json + 搜索页
↓
┌─────────────────────┴──────────────────┐
↓ ↓
浏览器访问 本地 MCP server
(人类用搜索页) (HTTP 拉 JSON,agent 用)技术栈
组件 | 技术方案 | 说明 |
数据获取 | GitHub starred API + Actions | 定时拉取 starred 数据 |
元数据推断 | LLM 从 README/topics 生成 | 摘要、场景标签、质量评分,零摩擦 |
部署托管 | GitHub Pages | JSON + 静态搜索页,零后端 |
Agent 数据访问 | MCP server | HTTP 拉取 Pages 上的 JSON |
行为引导 | Agent Skill | 教 agent 优先查 star 知识库 |
深度文档 | DeepWiki / Zread 外链 | 项目卡片加深度阅读按钮 |
语义匹配 | LLM 实时匹配 | 无需向量数据库,随模型升级自动变好 |
MCP + Skill 双接入
机制 | 定位 | 跨平台 | 功能 |
MCP server | 集成层(数据访问) | 是 | 运行时搜索 star JSON |
Agent Skill | 知识层(行为引导) | 是 | 教 agent 优先查 star 而非 Google |
两者都跨平台(Claude Code / Cursor / Trae / Codex / OpenCode 等 40+ 工具支持)。MCP 是数据管道,Skill 是行为习惯。
项目结构
star-knowledge-base/
├── .github/
│ └── workflows/
│ ├── deploy.yml # GitHub Actions: 推送前端变更到 gh-pages(保留 data.json)
│ ├── sync-stars.yml # GitHub Actions: 定时拉取 star 数据并增量生成元数据
│ └── test.yml # GitHub Actions: Python 与前端自动化单测
├── public/ # GitHub Pages 静态文件
│ ├── index.html # 搜索页结构(零构建静态站)
│ ├── styles.css # 样式系统(编辑级极简主义 + 高密度表格)
│ ├── app.js # 前端交互逻辑(中英文检索、星图视图、URL 同步、本地备注)
│ ├── data.json # star 数据(Actions 自动生成,gitignore)
│ └── data.example.json # 数据结构示例(schema v1.1)
├── skills/
│ └── star-first-habit/
│ └── SKILL.md # Agent Skill: 教 agent 优先查 star 知识库
├── src/
│ ├── llm_client.py # LLM 客户端抽象(OpenAI / Anthropic 可配置)
│ ├── sync_stars.py # Actions 脚本: 拉数据 + 增量缓存/并发 LLM 元数据推断
│ └── mcp_server.py # MCP server: 暴露 search_starred / get_project_details / list_facets
├── tests/ # 后端与前端单元测试
├── notes.json # 可选:仓库级个人置顶与备注(sync 时自动合并进 data.json)
├── .env.example # 环境变量模板
├── .gitignore
├── requirements.txt # Python 依赖
└── README.md使用方式
1. Fork 或 Clone 仓库
git clone https://github.com/<your-username>/star-knowledge-base.git
cd star-knowledge-base2. 配置 GitHub Actions Secrets
在仓库 Settings → Secrets and variables → Actions 中添加以下 Secrets:
Secret 名称 | 必填 | 说明 | 示例 |
| 是 | 要拉取 starred 的 GitHub 用户名 |
|
| 否 | LLM 提供商,不配则启发式模式 |
|
| 否 | LLM API 密钥,不配则启发式模式 | 智谱免费 key |
| 否 | LLM API 基础 URL(OpenAI 兼容接口用) |
|
| 否 | 模型名称(不配用默认值) |
|
| 否 | LLM 并发线程数(默认 3,上限 8) |
|
| 否 | 单次最多用 LLM 处理的新仓库数(默认 0 不限) |
|
增量同步说明:
Sync Stars运行前会自动拉取gh-pages分支上期产出的data.json作为缓存种子,只对新增仓库或之前由heuristic降级生成的条目调用 LLM(配置了LLM_API_KEY后会自动分批或全量升级),不会重复消耗 token。
3.5 个人置顶与备注(可选)
浏览器内即用:在网页展开任意项目即可点击「置顶」或填写「一句话备注」,默认保存在浏览器
localStorage;通过⌘K命令面板可随时导出或导入notes.json。仓库级同步:若将导出的
notes.json放到仓库根目录(格式{"owner/repo": {"pinned": true, "note": "备注"}}),sync_stars.py会在同步时自动合并进data.json,同时供网页与 MCP Agent 使用。
零门槛快速试用:只配 STAR_GITHUB_USERNAME 就能跑,sync 会用启发式模式生成元数据。
推荐配置(智谱免费 API):
LLM_PROVIDER=openai
LLM_API_KEY=(你在 https://open.bigmodel.cn/ 注册拿到的 key)
LLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4
LLM_MODEL=glm-4.7-flashGITHUB_TOKEN 由 Actions 自动注入,无需手动配置。
3. 启用 GitHub Pages
在仓库 Settings → Pages → Build and deployment → Source 选择 Deploy from a branch,分支选 gh-pages,目录选 / (root)。首次 Actions 运行后会自动创建 gh-pages 分支。
4. 手动触发首次同步
进入仓库 Actions 页面,选择 Sync Stars workflow,点击 Run workflow 即可手动触发首次同步。之后每天 UTC 02:00(北京时间 10:00)自动运行。
5. 本地配置 MCP server
在你的 agent(Trae / Cursor / Claude Code / Codex 等)的 MCP 配置中加入:
{
"mcpServers": {
"star-knowledge": {
"command": "python",
"args": ["/absolute/path/to/star-knowledge-base/src/mcp_server.py"],
"env": {
"STAR_DATA_URL": "https://<your-username>.github.io/star-knowledge-base/data.json"
}
}
}
}零门槛配置:只配 STAR_DATA_URL 就能用,搜索会走关键词匹配模式。
推荐增强配置(智谱免费 API):
{
"mcpServers": {
"star-knowledge": {
"command": "python",
"args": ["/absolute/path/to/star-knowledge-base/src/mcp_server.py"],
"env": {
"STAR_DATA_URL": "https://<your-username>.github.io/star-knowledge-base/data.json",
"LLM_PROVIDER": "openai",
"LLM_API_KEY": "你的智谱 key",
"LLM_BASE_URL": "https://open.bigmodel.cn/api/paas/v4",
"LLM_MODEL": "glm-4.7-flash"
}
}
}
}环境变量说明:
变量 | 必填 | 说明 |
| 二选一 | data.json 的 URL(生产环境) |
| 二选一 | 本地 data.json 路径(开发调试) |
| 否 | 数据刷新间隔,默认 3600 |
| 否 |
|
| 否 | LLM API 密钥,不配则关键词匹配模式 |
| 否 | OpenAI 兼容接口的基础 URL |
| 否 | 模型名称,有默认值 |
6. 安装 Agent Skill(可选)
star-first-habit Skill 教 agent 在需要某个库时优先查 star 知识库,而非 Google:
npx skills add <your-username>/star-knowledge-base --skill star-first-habitSkill 跨平台支持 Claude Code / Cursor / Trae / Codex / OpenCode 等 40+ 工具。
MCP 工具列表
search_starred(query, limit, language, topic, category, min_stars, include_archived, sort_by):支持中英文分词 + 可选 LLM 语义精排,并支持语言(传"__none__"查无语言文档项目)、Topic、大类、最小 Star、归档过滤与排序get_project_details(repo):大小写不敏感查找详情(支持owner/repo、GitHub URL 或唯一短名)list_facets(top_n):查看语言、规范大类、高频 Topic 分布及置顶列表
7. 本地开发调试
# 安装依赖
pip install -r requirements.txt
# 本地测试 sync_stars(会自动加载项目根目录 .env)
cp .env.example .env # 编辑后填入真实配置
python src/sync_stars.py
# 本地测试 MCP server(指向本地生成的 data.json)
export STAR_DATA_LOCAL=./public/data.json
python src/mcp_server.py
# 本地预览 Pages
cd public && python -m http.server 8000
# 浏览器打开 http://localhost:8000
# 运行单元测试
python -m unittest discover -s tests -v
node --check public/app.js && node tests/test_frontend.js环境变量速查
Actions(部署时)
变量 | 来源 | 用途 |
| Actions 自动注入 | 调用 GitHub starred API + push 到 gh-pages |
| 用户配置 | 指定要拉取的用户 |
| 用户配置 | LLM 提供商选择 |
| 用户配置 | LLM 鉴权 |
| 用户配置 | OpenAI 兼容接口地址 |
| 用户配置 | 模型名称 |
| workflow_dispatch 输入 | 强制重新生成所有元数据 |
MCP server(运行时)
详见上文「本地配置 MCP server」章节。
适合人群
star 项目较多、难以靠记忆定位的开发者。star 数量较少时手动翻阅也能解决,本工具的价值随 star 数量增长而提升。
圆桌讨论
本项目的可行性经过 6 轮圆桌讨论验证,参与角色:
Pieter Levels - 独立开发者视角,MVP 范围和落地速度
Andrej Karpathy - Agent 架构视角,MCP 协议和技术深度
资深开发者工具产品经理 - 用户需求和验证指标
完整讨论报告见 docs/decisions/ 目录。
License
MIT
author: fxbin
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
AI bookmark manager for X, Instagram and TikTok saves, searchable by your agent.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search and retrieve context from GitHub issues, pull requests, releases, and documentation using hybrid semantic search and time-ordered activity scans.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables natural language search and querying of your GitHub starred repositories.119Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables managing GitHub starred repositories with semantic search and RAG-based Q&A, along with optional Gitea backup.-
- AlicenseBqualityCmaintenanceEnables AI agents to interact with GitHub (search repos, read files, issues, PRs), analyze code for quality and issues, and manage tasks with priority sorting.7MIT