🎃 New adapter: Immich (self-hosted photo library, read-only)
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 75/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- json, node.js, typescript
- 领域
- backend
调研方向
Start by running npm run adapter:new -- immich --region intl --auth API_KEY to scaffold packages/backend/src/adapters/intl/immich.json. Copy baseUrl and envVarMeta from intl/grafana.json and API_KEY header from intl/clockify.json. Define the 8 GET tools per the table, add immich.live.spec.ts, and run npx jest src/adapters/intl/immich in packages/backend. Done when validate-adapters is clean, tests pass, logo SVG and docs exist.
由索引模型根据 Issue 内容生成。
描述
Part of the October Challenge #997.
Why
Immich is the most popular self-hosted alternative to Google Photos (immich-app/immich has over 115k GitHub stars). Its REST API covers the user's library: albums, assets with EXIF data, recognised people, places and a month-by-month timeline. With an adapter, a user could ask "how many photos and videos do I have?", "which albums are shared with me?", "how many pictures of Anna did we take each month this year?" or "where and with which camera was this photo taken?". The catalog has Google Photos but no Immich (ls packages/backend/src/adapters/*/ | grep -i immich finds nothing).
Self-hosted vs Cloud
- Self-hosted: available in Community and Business. Catalog adapters have no edition gating. Immich usually runs on a home server or NAS (
http://192.168.x.x:2283). The outbound SSRF guard blocks private addresses by default, so the operator must allow the host throughSSRF_ALLOWED_HOSTSor the admin-editable allowlist (settings/site-settings.controller.ts:229-233).intl/directus.json:9already words this for a self-hosted product; reuse that wording ininstructions. - Cloud (
DEPLOYMENT_MODE=cloud): available, but only for instances reachable from the public internet (for example behind a reverse proxy). A private IP or a local hostname is refused, and the allowlist cannot be edited on Cloud (those routes answer 404, same file).instructionsmust say this. On Cloud trial plans, installs count toward the trial's connector limit (license/license-guard.service.ts:75-80). - Who can use it: any role except VIEWER can install it (
adapters/adapters.controller.ts:306). The connector and its encryptedauthConfigbelong to the installer's organization. An Immich API key reads one user's personal photos, faces and locations, soinstructionsmust recommend assigning the connector only to MCP servers whose users may see that library.
What to build
packages/backend/src/adapters/intl/immich.json. Start with npm run adapter:new -- immich --region intl --auth API_KEY.
- API docs: the reference at https://api.immich.app, generated from the OpenAPI spec in the repo (
open-api/immich-openapi-specs.json, e.g. https://github.com/immich-app/immich/blob/v3.3.5/open-api/immich-openapi-specs.json). API keys: https://docs.immich.app/features/command-line-interface ("Obtain the API Key"). Use https://api.immich.app asdocsUrl. - Target version: Immich 3.x (current release 3.3.5). The API changed between 2.x and 3.0:
GET /albumsswappedsharedforisOwned/isShared/name, andGET /albums/{id}no longer returns the album's assets. Build against the 3.x spec and state "Immich 3.0 or newer" ininstructions. - Base URL: user-supplied,
"baseUrl": "{{IMMICH_URL}}/api", the same pattern asintl/grafana.json:46.IMMICH_URLis the address the user opens Immich at, without/apiand without a trailing slash (default port 2283). Immich's own examples usehttp://<host>:2283/apias the API root. AddenvVarMetawithkind: "address"and a no-trailing-slashpattern, asintl/grafana.json:15-33does. - Auth:
API_KEYwithheaderName: "x-api-key"andapiKey: "{{IMMICH_API_KEY}}"(theapi_keysecurity scheme in the spec). Same shape asintl/clockify.json:15-19. The user creates the key in the web UI under Account Settings → API Keys and can restrict its permissions. The 8 tools below need onlyuser.read,asset.read,asset.statistics,album.readandperson.read. - Category:
storage(same asintl/google-photos.json:7). probe:immich_get_my_user. healthcheckPath:/server/ping(no permission needed, returns{"res":"pong"}).
| Tool | Endpoint | Expected hints |
|---|---|---|
immich_get_my_user |
GET /users/me (name, email, quota usage) · user.read |
read-only |
immich_get_asset_statistics |
GET /assets/statistics (isFavorite, isTrashed, visibility: archive/timeline/hidden/locked) → images, videos, total · asset.statistics |
read-only |
immich_list_albums |
GET /albums (isOwned, isShared, name exact match, assetId) · album.read |
read-only |
immich_get_album |
GET /albums/{id} (metadata, assetCount, albumUsers, date range; no asset list in 3.x) · album.read |
read-only |
immich_get_asset |
GET /assets/{id} (file name, dates, exifInfo, people, tags) · asset.read |
read-only |
immich_search_people |
GET /search/person (name required, withHidden) · person.read |
read-only |
immich_get_timeline_buckets |
GET /timeline/buckets (albumId, personId, tagId, isFavorite, isTrashed, visibility) → asset count per month · asset.read |
read-only |
immich_search_places |
GET /search/places (name required) → place names with coordinates · asset.read |
read-only |
All tools are GET, so they are derived as readOnlyHint: true, destructiveHint: false (docs/tool-definition.md:782-806). Details the tool definitions must get right:
- All ids are UUIDs. Tool descriptions must say where each id comes from: album ids from
immich_list_albums, person ids fromimmich_search_people, asset ids from the album or asset responses. immich_get_assetreturnsoriginalPath(the file path on the Immich server) andchecksum. Drop both withresponseMapping.transform.exclude(docs/tool-definition.md:627).immich_get_timeline_bucketsanswers "how many per month" questions; say so in its description, since there is no GET asset search.- Use only parameters that exist since Immich 3.0. For example, the
namefilter onGET /peoplearrived in 3.3, which is why people are searched through/search/person.
Where to look
packages/backend/src/adapters/intl/grafana.json— self-hosted product with a user-supplied URL:baseUrl(line 46),envVarMeta(lines 15-33),verifyHints(lines 34-39).packages/backend/src/adapters/intl/directus.json— smaller self-hosted read-only adapter;instructions(line 9) explain the SSRF allowlist.packages/backend/src/adapters/intl/clockify.json:15-19—API_KEYwith a custom header name.packages/backend/src/adapters/intl/todoist.live.spec.ts— the minimal spec template;intl/grafana.live.spec.ts:25-37andintl/directus.live.spec.ts:135-139show live tests against a user-supplied URL, gated by an env flag.docs/tool-definition.md— response mapping andexclude(line 627)..github/CONTRIBUTING.md:137— the "Add an adapter" checklist; #982 — good-first-issue adapter guide.
Acceptance criteria
-
intl/immich.jsonexists with the 8 read-only tools,requiredEnvVars: ["IMMICH_URL","IMMICH_API_KEY"],envVarMetafor both, and adocsUrl. - No tool uses POST/PUT/PATCH/DELETE (asserted in the spec).
-
validate-adapters.mjs --warnis clean (the validator requiresinstructions≥ 800 chars and each tool description ≥ 60 chars,scripts/validate-adapters.mjs:32-33);catalog.tsis regenerated;adapter-count.mjs --checkpasses. -
intl/immich.live.spec.ts: static checks (base URL{{IMMICH_URL}}/api,x-api-keyheader, read-only methods,originalPathexcluded fromimmich_get_asset); withRUN_IMMICH_LIVE=1plusIMMICH_URLandIMMICH_API_KEYit calls/users/meand/albumson a real instance.npx jest src/adapters/intl/immichpasses inpackages/backend. - Logo at
packages/frontend/public/logos/connectors/immich.svg. -
instructionscover: minimum Immich version 3.0, where to create the key and the five permissions it needs, the SSRF allowlist on self-hosted, and public reachability on Cloud. - Docs updated: optional
content/guides/en/immich-to-mcp.mdx.
Out of scope
- Smart and metadata search (
POST /search/smart,POST /search/metadata). They only read, but as POST they derive as writes; shipping them needs anannotations: {"readOnlyHint": true}override (docs/tool-definition.md:832). Good follow-up issue. - Uploading, editing, favouriting, archiving, trashing or deleting assets; creating or changing albums, people, tags and shared links.
- Downloading originals, thumbnails or video streams (binary responses).
- Admin endpoints (users, jobs, server statistics, system config) and API key management.
Free / test instance: run Immich locally with Docker Compose (https://docs.immich.app/install/docker-compose), upload a few photos and create an API key under Account Settings → API Keys. To look at real response shapes first, the public demo at https://demo.immich.app (login [email protected] / demo) runs 3.3.5. It is shared with everyone, so create your own key on your local instance, not there.
Size
S (a few hours)
How to claim
Comment "I'd like to work on this" and we'll assign you. Rules in #997.
- 主要语言
- TypeScript
- 星标
- 856
- 派生
- 82
- 平均合并
- 7 小时 17 分钟
- 30 天内合并 PR
- 321
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HelpCode-ai/anythingmcp 的其他 Issue
-
enhancement good first issue hacktoberfest help wanted
难度 2/5 1-3 小时 新手友好度 78/100
HelpCode-ai/anythingmcp#982 · 12 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
HelpCode-ai/anythingmcp#1365 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
HelpCode-ai/anythingmcp#1364 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
HelpCode-ai/anythingmcp#1363 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 38/100
HelpCode-ai/anythingmcp#1362 · 1 条评论 ·
维护者通常 1 天内回复
查看 HelpCode-ai/anythingmcp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
excaliburjs/Excalibur#3895 ·
维护者通常 3 天内回复
-
infer_audio_type only recognises one MPEG Layer III frame header, so most MP3 files are rejected可能已有人在做 @Steve-20-ai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Earn report crashes with "RangeError: Invalid time value" when a report row has an unparsable timestamp可能已有人在做 @Gurkaran18 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
joinmarket-webui/jam#1588 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
mihaip/infinite-mac#475 ·