cc0-library-mcp 0.2.13 → 0.2.14
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/README.md +16 -2
- package/dist/http.js +5 -1
- package/dist/library.js +25 -0
- package/dist/risk.js +2 -1
- package/dist/server.js +31 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -138,6 +138,18 @@ npm install # also builds dist/ via the prepare script
|
|
|
138
138
|
claude mcp add cc0-library -- node "$PWD/dist/index.js"
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
+
### Agent skill (optional)
|
|
142
|
+
|
|
143
|
+
[`skills/cc0-assets/SKILL.md`](skills/cc0-assets/SKILL.md) tells an agent when to use these tools and in what order: search, prefer studio- and museum-declared items, skip items with `riskFlags`, then download with a `cc0.json` receipt. For Claude Code:
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
mkdir -p ~/.claude/skills/cc0-assets
|
|
147
|
+
curl -fsSL -o ~/.claude/skills/cc0-assets/SKILL.md \
|
|
148
|
+
https://raw.githubusercontent.com/sanghyoLe/cc0-library/main/skills/cc0-assets/SKILL.md
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Other agents that read `SKILL.md` files take the same file in their own skills folder.
|
|
152
|
+
|
|
141
153
|
## Tools
|
|
142
154
|
|
|
143
155
|
| Tool | Input | Returns |
|
|
@@ -145,7 +157,7 @@ claude mcp add cc0-library -- node "$PWD/dist/index.js"
|
|
|
145
157
|
| `search_assets` | `query`, `kind` (`image`·`audio`·`video`·`hdri`·`texture`·`model`·`artwork`·`collection`·`any`, default `any`; `any` excludes `collection`), `limit` 1–20, `page` 1–12, optional `providers` (e.g. `["iconify"]` for icons) | CC0 assets ranked by query words in title and tags, per-provider totals, per-provider errors, and `pending` sources that missed the 10 s deadline. Uploader-declared items that name a known franchise or brand, or say they are fan-made, carry `riskFlags` |
|
|
146
158
|
| `get_asset` | `id` from `search_assets` (`openverse:image:<uuid>`, `openverse:audio:<uuid>`, `polyhaven:<slug>`, `ambientcg:<assetId>`, `cleveland:<number>`, `met:<number>`, `commons:<pageid>`, `archive:<identifier>`, `sketchfab:<uid>`, `wpphotos:<number>`, `inaturalist:<n>`, `gbif:<n>`, `phylopic:<uuid>`, `iconify:<set>:<icon>`, `zenodo:<n>`, `blenderkit:<uuid>`, `github:<owner>/<repo>`, `huggingface:<owner>/<dataset>`) | Details plus download URLs (Poly Haven: up to 60 map/resolution/format files; Sketchfab: model page only, because downloads need the user's own login) |
|
|
147
159
|
| `download_asset` | `id`, `dir` (folder to save into), `files` (exact labels from `get_asset`; optional when the asset has one file) | Saves the files under `<dir>/<asset id>/` with each model's companion files (glTF `.bin` and textures) at their relative paths, and writes `cc0.json` with the source, creator, license evidence, `riskFlags` and download time. Login-only pages (Sketchfab, BlenderKit, Freesound originals) are reported in `skipped`; zips are saved as-is |
|
|
148
|
-
| `list_sources` | `kind` (
|
|
160
|
+
| `list_sources` | optional `kind`, `query` (site name, domain or topic words), `limit` 1–50 (default 10), `page` | One page each of the curated catalog, the non-CC0 list and the pending-verification list, with `totals` of all matches |
|
|
149
161
|
|
|
150
162
|
Results are ranked by how many query words appear in each item's title (weight 2) or tags (weight 1); ties alternate between providers. Loose matches, such as a GBIF record that mentions the word only in its locality, sink below exact ones.
|
|
151
163
|
|
|
@@ -250,7 +262,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). In short:
|
|
|
250
262
|
- `get_asset`은 다운로드 URL을 주기 전에 원본에서 CC0 여부를 다시 확인합니다.
|
|
251
263
|
- `download_asset`은 고른 파일을 `<dir>/<asset id>/`에 저장합니다. glTF의 `.bin`과 텍스처 같은 부속 파일도 제자리에 함께 받고, 출처·제작자·라이선스 근거·받은 시각을 `cc0.json`에 남깁니다.
|
|
252
264
|
- 업로더가 CC0라고만 선언한 항목 중 제목이나 태그에 유명 게임·영화·브랜드 이름이 있거나 팬아트라고 적힌 항목에는 `riskFlags`가 붙습니다. CC0 표시가 있어도 원작자의 권리는 남아 있다는 경고입니다.
|
|
253
|
-
- `list_sources`는 검증한 CC0 자료원 681곳의 목록을 줍니다. 종류별로 이미지 323곳, 오디오 181곳, 3D 119곳, 데이터 컬렉션 110곳, 텍스처 48곳, 영상 37곳, 폰트 35곳, 미술품 29곳, HDRI 10곳입니다. CC0가 아닌 무료 사이트(Unsplash, Pixabay, Pexels, Pixnio, SMK, NASA, Coverr, Burst, Mixkit, Gratisography, Natural Earth)와 그 이유도 줍니다. 아직 검증하지 못한 후보도 따로 줍니다.
|
|
265
|
+
- `list_sources`는 검증한 CC0 자료원 681곳의 목록을 한 번에 `limit`개씩(기본 10개) 줍니다. `query`에 사이트 이름·도메인·주제어를 넣으면 그 낱말이 모두 들어 있는 곳만 고르고, `totals`로 전체 일치 수를 알려 줍니다. 종류별로 이미지 323곳, 오디오 181곳, 3D 119곳, 데이터 컬렉션 110곳, 텍스처 48곳, 영상 37곳, 폰트 35곳, 미술품 29곳, HDRI 10곳입니다. CC0가 아닌 무료 사이트(Unsplash, Pixabay, Pexels, Pixnio, SMK, NASA, Coverr, Burst, Mixkit, Gratisography, Natural Earth)와 그 이유도 줍니다. 아직 검증하지 못한 후보도 따로 줍니다.
|
|
254
266
|
|
|
255
267
|
- 매주 자동 점검이 목록의 라이선스 페이지를 다시 확인하고 새 후보를 찾습니다.
|
|
256
268
|
- 버전 태그를 올리면 npm과 MCP 공식 레지스트리에 자동으로 배포됩니다.
|
|
@@ -262,4 +274,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). In short:
|
|
|
262
274
|
claude mcp add cc0-library -- npx -y cc0-library-mcp
|
|
263
275
|
```
|
|
264
276
|
|
|
277
|
+
에이전트용 스킬(선택): [`skills/cc0-assets/SKILL.md`](skills/cc0-assets/SKILL.md)는 에이전트에게 이 도구를 언제, 어떤 순서로 쓰는지 알려 줍니다. 검색한 뒤 제작사·미술관이 선언한 항목을 먼저 고르고, `riskFlags`가 붙은 항목은 건너뛰고, `cc0.json`과 함께 받는 순서입니다. Claude Code에서는 위 영어 섹션의 `curl` 명령으로 `~/.claude/skills/cc0-assets/`에 넣으면 됩니다.
|
|
278
|
+
|
|
265
279
|
코드는 MIT, 카탈로그 데이터는 CC0입니다. 자료원 제안과 기여 방법은 [CONTRIBUTING.md](CONTRIBUTING.md)에 있습니다. 매주 자동 점검이 새 CC0 후보를 찾아 `source-check` 이슈에 올립니다. 후보는 사람이 원본 라이선스 페이지를 확인한 뒤에 목록에 들어갑니다.
|
package/dist/http.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* VERSION must equal the version in package.json and server.json; a test checks it.
|
|
3
|
+
* It is a literal because this module also runs in the browser gallery, which cannot read package.json.
|
|
4
|
+
*
|
|
2
5
|
* Poly Haven's API terms require a User-Agent that names the calling app.
|
|
3
6
|
* Openverse also asks clients to identify themselves.
|
|
4
7
|
*/
|
|
5
|
-
export const
|
|
8
|
+
export const VERSION = "0.2.14";
|
|
9
|
+
export const USER_AGENT = `cc0-library-mcp/${VERSION} (+https://github.com/sanghyoLe/cc0-library)`;
|
|
6
10
|
const TIMEOUT_MS = 15_000;
|
|
7
11
|
/** File downloads can be hundreds of MB, so they get far longer than API calls. */
|
|
8
12
|
const DOWNLOAD_TIMEOUT_MS = 10 * 60_000;
|
package/dist/library.js
CHANGED
|
@@ -5,3 +5,28 @@ const CATALOG_PATH = fileURLToPath(new URL("../catalog/sources.json", import.met
|
|
|
5
5
|
export function loadCatalog() {
|
|
6
6
|
return JSON.parse(readFileSync(CATALOG_PATH, "utf8"));
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* One page of the catalog. The whole catalog is several hundred kilobytes of
|
|
10
|
+
* JSON, more than an MCP client accepts in one reply, so each of the three
|
|
11
|
+
* lists is cut to `limit` entries and `totals` reports the full match counts.
|
|
12
|
+
* `query` keeps entries whose id, name, URL, notes or reason contain every
|
|
13
|
+
* query word (case-insensitive substring). `kind` applies to `sources` only:
|
|
14
|
+
* the other two lists record no kinds.
|
|
15
|
+
*/
|
|
16
|
+
export function listSources(catalog, { kind = "any", query = "", limit, page = 1 }) {
|
|
17
|
+
const words = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
18
|
+
const matches = (...fields) => {
|
|
19
|
+
const text = fields.join("\n").toLowerCase();
|
|
20
|
+
return words.every((w) => text.includes(w));
|
|
21
|
+
};
|
|
22
|
+
const sources = catalog.sources.filter((s) => (kind === "any" || s.kinds.includes(kind)) && matches(s.id, s.name, s.url, s.notes));
|
|
23
|
+
const notCc0 = catalog.excluded.filter((s) => matches(s.name, s.url, s.reason));
|
|
24
|
+
const pending = catalog.pending.filter((s) => matches(s.name, s.url, s.reason));
|
|
25
|
+
const cut = (list) => list.slice((page - 1) * limit, page * limit);
|
|
26
|
+
return {
|
|
27
|
+
sources: cut(sources),
|
|
28
|
+
notCc0: cut(notCc0),
|
|
29
|
+
pendingVerification: cut(pending),
|
|
30
|
+
totals: { sources: sources.length, notCc0: notCc0.length, pendingVerification: pending.length },
|
|
31
|
+
};
|
|
32
|
+
}
|
package/dist/risk.js
CHANGED
|
@@ -41,7 +41,8 @@ const FRANCHISE_TERMS = [
|
|
|
41
41
|
"porsche", "bmw", "mercedes-benz", "rolex", "louis vuitton", "gucci", "red bull",
|
|
42
42
|
];
|
|
43
43
|
/** Words in a title or tags that say the item copies someone else's work. */
|
|
44
|
-
|
|
44
|
+
// "replica" is left out: most are photos of museum replicas of ancient objects.
|
|
45
|
+
const DERIVATIVE_TERMS = ["fan art", "fan made", "ripped", "sprite rip", "inspired by"];
|
|
45
46
|
/** Lowercase words separated by single spaces; hyphens count as spaces ("fan-art" = "fan art"). */
|
|
46
47
|
function normalize(text) {
|
|
47
48
|
return ` ${text.toLowerCase().replace(/[^\p{L}\p{N}'*]+/gu, " ").trim()} `;
|
package/dist/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { DownloadRequestError, MAX_FILES_PER_CALL, RECEIPT_NAME, downloadAsset } from "./download.js";
|
|
4
|
-
import { defaultDownload, defaultFetch } from "./http.js";
|
|
5
|
-
import { getAsset, loadCatalog, search } from "./library.js";
|
|
4
|
+
import { VERSION, defaultDownload, defaultFetch } from "./http.js";
|
|
5
|
+
import { getAsset, listSources, loadCatalog, search } from "./library.js";
|
|
6
6
|
import { ASSET_KINDS, CATALOG_KINDS, PROVIDER_IDS } from "./types.js";
|
|
7
7
|
/** One slow source (The Met can take 30 s) must not hold every reply; it is reported in `pending`. */
|
|
8
8
|
const SEARCH_DEADLINE_MS = 10_000;
|
|
@@ -94,13 +94,17 @@ const listOutput = {
|
|
|
94
94
|
notes: z.string(),
|
|
95
95
|
verified: z.object({ date: z.string().describe("YYYY-MM-DD"), evidence: z.string().describe("Text or field that was checked") }),
|
|
96
96
|
}))
|
|
97
|
-
.describe("Verified CC0 sources"),
|
|
98
|
-
notCc0: z.array(nameReason).describe("Popular 'free' sites that are NOT CC0"),
|
|
99
|
-
pendingVerification: z.array(nameReason).describe("Candidates whose license could not be verified yet"),
|
|
97
|
+
.describe("Verified CC0 sources on this page"),
|
|
98
|
+
notCc0: z.array(nameReason).describe("Popular 'free' sites that are NOT CC0, on this page"),
|
|
99
|
+
pendingVerification: z.array(nameReason).describe("Candidates whose license could not be verified yet, on this page"),
|
|
100
|
+
totals: z
|
|
101
|
+
.object({ sources: z.number(), notCc0: z.number(), pendingVerification: z.number() })
|
|
102
|
+
.describe("Matches per list before paging. When a total exceeds `limit`, narrow with `query` or request the next `page`"),
|
|
100
103
|
};
|
|
104
|
+
/** The text copy is compact JSON: clients that read it pay for every byte, and indentation adds about a third. */
|
|
101
105
|
const result = (value) => ({
|
|
102
106
|
structuredContent: value,
|
|
103
|
-
content: [{ type: "text", text: JSON.stringify(value
|
|
107
|
+
content: [{ type: "text", text: JSON.stringify(value) }],
|
|
104
108
|
});
|
|
105
109
|
const fail = (message) => ({ content: [{ type: "text", text: message }], isError: true });
|
|
106
110
|
const savedFileSchema = z.object({
|
|
@@ -119,7 +123,7 @@ const downloadOutput = {
|
|
|
119
123
|
receipt: z.string().describe(`Absolute path of ${RECEIPT_NAME}: id, title, creator, source URLs, license evidence, riskFlags and download time`),
|
|
120
124
|
};
|
|
121
125
|
export function createServer(fetchImpl = defaultFetch, downloadImpl = defaultDownload) {
|
|
122
|
-
const server = new McpServer({ name: "cc0-library", version:
|
|
126
|
+
const server = new McpServer({ name: "cc0-library", version: VERSION });
|
|
123
127
|
server.registerTool("search_assets", {
|
|
124
128
|
title: "Search CC0 assets across 17 sources",
|
|
125
129
|
description: "Find CC0 1.0 (public-domain dedication) images, audio, video, HDRIs, textures, 3D models and museum artworks by keyword, " +
|
|
@@ -132,7 +136,12 @@ export function createServer(fetchImpl = defaultFetch, downloadImpl = defaultDow
|
|
|
132
136
|
"tell the user to confirm the uploader owns the work; items with riskFlags name a franchise or brand and need that warning most. " +
|
|
133
137
|
"Show each item's servedBy credit with the results.",
|
|
134
138
|
inputSchema: {
|
|
135
|
-
query: z
|
|
139
|
+
query: z
|
|
140
|
+
.string()
|
|
141
|
+
.min(1)
|
|
142
|
+
.max(200)
|
|
143
|
+
.describe("Keywords matched against titles and tags, e.g. 'rainy street' or 'brick wall'. Any language is accepted, " +
|
|
144
|
+
"but most sources index English titles and tags: translate the user's words to English for more results"),
|
|
136
145
|
kind: z.enum([...ASSET_KINDS, "any"]).default("any").describe(KIND_HELP),
|
|
137
146
|
limit: z
|
|
138
147
|
.number()
|
|
@@ -232,22 +241,28 @@ export function createServer(fetchImpl = defaultFetch, downloadImpl = defaultDow
|
|
|
232
241
|
});
|
|
233
242
|
server.registerTool("list_sources", {
|
|
234
243
|
title: "List verified CC0 source sites",
|
|
235
|
-
description: "
|
|
244
|
+
description: "Look up the curated catalog of CC0 asset sites, each with its license page, scope and dated evidence, " +
|
|
236
245
|
"plus popular 'free' sites that are NOT CC0 (e.g. Unsplash, Pixabay) and candidates still pending verification. " +
|
|
237
|
-
"Use it to answer 'is site X CC0?' or to suggest sites to browse by hand
|
|
246
|
+
"Use it to answer 'is site X CC0?' (pass the site name or domain as `query`) or to suggest sites to browse by hand " +
|
|
247
|
+
"(pass `kind`, and a topic as `query`); use search_assets instead to find actual assets. " +
|
|
248
|
+
"The catalog holds several hundred sites, so each of the three lists returns one page of `limit` entries and `totals` gives the full match counts. " +
|
|
238
249
|
"Behavior: reads a bundled JSON file, so no network access, instant and deterministic.",
|
|
239
250
|
inputSchema: {
|
|
240
251
|
kind: z
|
|
241
252
|
.enum([...CATALOG_KINDS, "any"])
|
|
242
253
|
.default("any")
|
|
243
|
-
.describe("Keep only sources offering this asset type ('font' is catalog-only); 'any' (default)
|
|
254
|
+
.describe("Keep only sources offering this asset type ('font' is catalog-only); 'any' (default) keeps all. Does not filter the notCc0 and pending lists"),
|
|
255
|
+
query: z
|
|
256
|
+
.string()
|
|
257
|
+
.max(200)
|
|
258
|
+
.optional()
|
|
259
|
+
.describe("Site name, domain or topic words, e.g. 'unsplash', 'kenney.nl' or 'pixel art'. Keeps entries in all three lists whose " +
|
|
260
|
+
"id, name, URL, notes or reason contain every word (case-insensitive). Leave out to page through everything"),
|
|
261
|
+
limit: z.number().int().min(1).max(50).default(10).describe("Maximum entries per list, 1-50"),
|
|
262
|
+
page: z.number().int().min(1).max(100).default(1).describe("1-based page, applied to each list; request page 2+ only if `totals` shows more matches"),
|
|
244
263
|
},
|
|
245
264
|
outputSchema: listOutput,
|
|
246
265
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
247
|
-
}, async ({ kind }) => {
|
|
248
|
-
const catalog = loadCatalog();
|
|
249
|
-
const sources = kind === "any" ? catalog.sources : catalog.sources.filter((s) => s.kinds.includes(kind));
|
|
250
|
-
return result({ sources, notCc0: catalog.excluded, pendingVerification: catalog.pending });
|
|
251
|
-
});
|
|
266
|
+
}, async ({ kind, query, limit, page }) => result(listSources(loadCatalog(), { kind, query, limit, page })));
|
|
252
267
|
return server;
|
|
253
268
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc0-library-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"mcpName": "io.github.sanghyoLe/cc0-library",
|
|
5
|
-
"description": "MCP server and web gallery for CC0-only assets (images, audio, video, HDRIs, textures, 3D models, museum art) from
|
|
5
|
+
"description": "MCP server and web gallery for CC0-only assets (images, audio, video, HDRIs, textures, 3D models, museum art) from 17 sources, with license evidence per result.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|