awesome-lite-mcp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Verchiel666
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,76 @@
1
- # Temporary Holding Version
1
+ # awesome-lite-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 离线检索整个 **awesome 清单生态**的 MCP 服务 + CLI。零依赖,一个 index.json 装下 9,000+ 条精选资源。
4
+
5
+ > 起因:awesome([sindresorhus/awesome](https://github.com/sindresorhus/awesome),53 万 star)是「清单的清单」,
6
+ > 但它的用法是「开浏览器 → 点 awesome.re → 上一页页翻」。这个项目把它变成**可检索、可离线、能被 AI 调用的索引**。
7
+
8
+ ## 装
9
+
10
+ ```bash
11
+ npx -y awesome-lite-mcp # 直接起 MCP 服务(stdio)
12
+ npm i -g awesome-lite-mcp # 或者全局装 CLI:awesome-lite search "mcp server"
13
+ ```
14
+
15
+ MCP 客户端(Cursor / Claude Desktop / DSH / 自研 Agent)配置:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "awesomelite": { "command": "npx", "args": ["-y", "awesome-lite-mcp"] }
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## 5 个工具
26
+
27
+ | 工具 | 干什么 |
28
+ |---|---|
29
+ | `awesome_search` | 跨清单按相关度检索(name > desc > category 加权) |
30
+ | `awesome_lists` | 列出已索引的 12 张清单、条目数、为什么收录 |
31
+ | `awesome_cat` | 按清单 / 分类摊开一份清单 |
32
+ | `awesome_sync` | 从 GitHub 重新抓 README 重建索引(支持深抓分册) |
33
+ | `awesome_stats` | 索引统计 |
34
+
35
+ ## CLI
36
+
37
+ ```bash
38
+ awesome-lite lists
39
+ awesome-lite search "android reverse engineering" --limit=8
40
+ awesome-lite search "python" --list=vinta/awesome-python --all
41
+ awesome-lite cat EbookFoundation/free-programming-books "Books / Chinese" --limit=20
42
+ awesome-lite sync [repo...] [--force]
43
+ awesome-lite stats
44
+ ```
45
+
46
+ ## 索引里有什么(随包附带,开箱即用)
47
+
48
+ `index.json`:**9,317 条 / 12 张清单**,含
49
+
50
+ - 总目录 `sindresorhus/awesome`(28 类)
51
+ - `codecrafters-io/build-your-own-x`(亲手造 Redis/Git/Docker,GitHub star 第一)
52
+ - `EbookFoundation/free-programming-books`(含 119 个语言分册;本项目默认深抓 30 个、中文优先 → 中文 379 条)
53
+ - `vinta/awesome-python` / `sindresorhus/awesome-nodejs` / `awesome-selfhosted` / `public-apis`
54
+ - `punkpeye/awesome-mcp-servers`(97k star)/ `wtsxDev/reverse-engineering` / `JStumpp/awesome-android`
55
+ - `e2b-dev/awesome-ai-agents` / `Hannibal046/Awesome-LLM`
56
+
57
+ ## 刷新索引
58
+
59
+ ```bash
60
+ AWESOME_GH_TOKEN=ghp_xxx awesome-lite sync # 有 token:5000 次/时;无 token:60 次/时
61
+ AWESOME_LITE_HOME=/some/writable/dir awesome-lite sync # 数据目录(默认包目录)
62
+ ```
63
+
64
+ 抓取走 `api.github.com/repos/{owner}/{repo}/readme`(`Accept: application/vnd.github.raw`)——
65
+ `raw.githubusercontent.com` 在很多网络环境(含蜂窝网络/企业网)是被墙的,这条不会。
66
+
67
+ ## 已知边界
68
+
69
+ - 只解析 `- [名](url) - 说明` 与 markdown 表格两种条目写法;内联 HTML 卡片式的清单会漏。
70
+ - 分册(如 free-programming-books 的 119 个语言文件)默认只抓 30 个,`--deep` 可调。
71
+ - 清单里的项目不保证在你的平台上能用。实测:`any-cli-mcp-server` 在 Android 上把 toybox 命令的
72
+ 合体 `--help` 解析成 0 个参数——「清单收了」≠「你机器上能跑」。
73
+
74
+ ## License
75
+
76
+ MIT。索引内容版权归各清单原作者(awesome 主清单为 CC0-1.0)。
package/cli.mjs ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { sync, loadIndex, search, stats, loadLists } from './src/store.mjs';
3
+ const [, , cmd = 'help', ...rest] = process.argv;
4
+ const opt = Object.fromEntries(rest.filter(a => a.startsWith('--')).map(a => { const [k, ...v] = a.slice(2).split('='); return [k, v.join('=') || true]; }));
5
+ const args = rest.filter(a => !a.startsWith('--'));
6
+ const out = (s) => process.stdout.write(s + '\n');
7
+
8
+ const tag = (repo) => (loadLists().find(l => l.repo === repo) || {}).tag || '';
9
+ const line = (e) => ` ${e.name} [${tag(e.list) || e.list}${e.category ? ' / ' + e.category : ''}] score=${e.score ?? '-'}\n ${e.url}\n ${(e.desc || '').slice(0, 160)}`;
10
+
11
+ if (cmd === 'sync') {
12
+ const idx = await sync({ force: !!opt.force, only: args.length ? args : [], log: out });
13
+ out(`\n索引: ${idx.entries.length} 条 / ${idx.lists.length} 清单,写入 index.json`);
14
+ } else if (cmd === 'lists') {
15
+ const idx = loadIndex();
16
+ out(`索引时间 ${idx.builtAt || '(未建)'},共 ${idx.entries.length} 条\n`);
17
+ for (const l of idx.lists) out(`${String(l.entries).padStart(5)} ${(l.tag || '').padEnd(7)} ${l.repo.padEnd(42)} ${l.categories} 类 ${(l.why || '')}`);
18
+ } else if (cmd === 'cat') {
19
+ const idx = loadIndex();
20
+ const repo = args[0];
21
+ const cat = args[1];
22
+ const rows = idx.entries.filter(e => (!repo || e.list === repo) && (!cat || (e.category || '').toLowerCase().includes(cat.toLowerCase())));
23
+ out(`${repo || '全部'}${cat ? ' / ' + cat : ''}: ${rows.length} 条`);
24
+ for (const e of rows.slice(0, Number(opt.limit || 40))) out(line(e));
25
+ } else if (cmd === 'search') {
26
+ const idx = loadIndex();
27
+ const q = args.join(' ');
28
+ if (!q) { out('用法: node cli.mjs search <关键词> [--limit=10] [--list=repo] [--all]'); process.exit(1); }
29
+ const hits = search(idx, q, { limit: Number(opt.limit || 12), list: opt.list || '', all: !!opt.all });
30
+ out(`「${q}」命中 ${hits.length} 条`);
31
+ for (const e of hits) out(line(e));
32
+ } else if (cmd === 'stats') {
33
+ out(JSON.stringify(stats(loadIndex()), null, 1));
34
+ } else {
35
+ out(`awesome-lite CLI
36
+ sync [repo...] [--force] 抓取并重建索引
37
+ lists 已索引清单与条目数
38
+ cat <repo> [分类] [--limit] 列条目
39
+ search <关键词> [--list=] [--all] [--limit=] 检索
40
+ stats 统计`);
41
+ }