Skip to main content
Glama

linkwarden-mcp

CI npm downloads container node license docs

一个为 Linkwarden 提供的 模型上下文协议 服务器。Linkwarden 是一个自托管的书签管理器,会为每个保存的页面保留永久副本。

它允许 MCP 客户端(Claude Code、Claude Desktop、Codex)搜索书签集合,将其组织到集合和标签中,并读取已保存页面的存档文章文本,从而无需再次访问实时网站即可对已存档的链接进行摘要或引用。

📖 完整文档请访问 linkwarden-mcp.ni-c.de

演示

注意: Linkwarden 发布的 API 参考文档不完整。此服务器是根据 linkwarden/linkwarden 中 apps/web/pages/api/v1/** 的路由和 packages/lib/schemaValidation.ts 的请求模式编写的,并于 2026-08-17 针对 v2.16.0 进行了验证。这两个文件是此处所有工具的权威来源。

要求

  • Node.js ≥ 22

  • 一个正在运行的 Linkwarden 实例

  • 一个访问令牌,在 设置 → 访问令牌 下创建

Linkwarden 没有按令牌划分的作用域:一个令牌拥有创建它的账户的全部权限。请创建一个专用账户,仅授予此服务器应看到的集合的访问权限,而不是提供管理员令牌。

Related MCP server: raindrop-mcp

配置

变量

必需

描述

LINKWARDEN_URL

是

基础 URL,例如 https://links.example.net(不含 /api/v1)

LINKWARDEN_TOKEN

是

来自设置 → 访问令牌的访问令牌

LINKWARDEN_READ_ONLY

否

true 仅注册读取工具

LINKWARDEN_INSECURE_TLS

否

true 接受自签名证书(仅限于此连接)

请使用 https://。 通过纯 HTTP 传输时,令牌会以未加密方式传输;除非主机是本地主机,否则服务器会打印警告。对于自签名证书,建议使用适当的内部 CA,而不是 LINKWARDEN_INSECURE_TLS。

令牌在被读取后会从进程环境中移除,因此子进程或 /proc/<pid>/environ 中不可见。

即使没有凭据,服务器仍会启动并列出其工具,因此注册表和检查器可以对其进行内省;此时每个调用都会失败并显示设置说明,而不会访问 API。

安装

Claude Code

claude mcp add linkwarden -e LINKWARDEN_URL=https://links.example.net -e LINKWARDEN_TOKEN=… -- npx -y linkwarden-mcp

Claude Desktop

{
  "mcpServers": {
    "linkwarden": {
      "command": "npx",
      "args": ["-y", "linkwarden-mcp"],
      "env": {
        "LINKWARDEN_URL": "https://links.example.net",
        "LINKWARDEN_TOKEN": "…"
      }
    }
  }
}

Codex

[mcp_servers.linkwarden]
command = "npx"
args = ["-y", "linkwarden-mcp"]
env = { LINKWARDEN_URL = "https://links.example.net", LINKWARDEN_TOKEN = "…" }

从源码安装

npm install && npm run build
LINKWARDEN_URL=https://links.example.net LINKWARDEN_TOKEN=… node dist/index.js

Docker

docker build -t linkwarden-mcp .
docker run --rm -i \
  -e LINKWARDEN_URL=https://links.example.net \
  -e LINKWARDEN_TOKEN=… \
  linkwarden-mcp

工具

读取

工具

描述

search_links

搜索或列出书签。支持 Linkwarden 的字段过滤器(tag:、collection:、before:、! …)。

get_link

获取一个书签及其标签、集合和存在的存档格式。

get_link_content

获取已保存页面的存档文章文本,长文章会进行分片。

list_collections

获取所有集合及其链接数量;通过 parentId 显示嵌套关系。

get_collection

获取一个集合及其每个成员的权限。

list_tags

获取标签及其链接数量和每个标签的存档设置。

get_tag

获取一个标签。

get_dashboard

获取最近添加和置顶的链接,如同 Linkwarden 仪表盘所示。

list_rss_subscriptions

获取此账户订阅的 RSS 源。

get_current_user

获取令牌所属的账户及其存档默认设置。良好的连通性检查。

get_worker_stats

获取存档和搜索索引队列。仅限管理员账户 — 其他用户会收到 HTTP 403。

写入

当 LINKWARDEN_READ_ONLY=true 时完全不注册。标记为 🔒 的工具需要确认令牌。

工具

描述

create_link

保存书签,可选择添加标签和集合(按需创建)。

update_link

更改标题、描述、标签或集合。🔒 仅在 URL 更改时需要确认。

set_link_pinned

为此账户置顶或取消置顶链接。

delete_link 🔒

删除书签及其存档副本。

bulk_update_links 🔒

将一组标签和/或集合应用于多个链接。

bulk_delete_links 🔒

一次删除多个书签。

represerve_link 🔒

删除现有存档并重新存档页面。

delete_link_preservations 🔒

删除多个链接的存档,但保留书签。

create_collection

创建集合,可选择嵌套。

update_collection

重命名、重新设置父级或发布集合。🔒 仅在发布时需要确认。

delete_collection 🔒

删除集合 — 级联删除其链接和子集合。

create_tags

创建标签或更改其存档设置(按名称更新或插入)。

rename_tag

重命名标签。

delete_tags 🔒

删除标签;链接保持不变。

merge_tags 🔒

将多个标签合并为一个新标签。

create_rss_subscription

订阅 RSS/Atom 源。

delete_rss_subscription 🔒

停止轮询某个源。

故意不暴露的功能

  • 访问令牌管理(/tokens)。能够创建 API 凭据的工具是权限提升的攻击面,书签服务器不应持有此类功能。

  • 用户管理(/users、账户删除)。超出范围。

  • 备份导出和导入(/migration)。导出会将整个实例转储到模型上下文中;导入可能破坏实例。

  • 高亮标记。 创建高亮需要精确的字符偏移量指向存档文档,模型无法有意义地生成这些偏移量,且 Linkwarden 没有提供列出现有高亮的路由。

  • 存档上传和签名的 preserved URL,这需要配置 NEXT_PUBLIC_USER_CONTENT_DOMAIN。

  • 已弃用的 GET /links 列表路由 — search_links 改用 GET /search,这也是 Linkwarden 自身推荐的方式。

安全性

  • 破坏性工具是两步操作。 第一次调用返回一个绑定到确切目标的短期确认令牌;只有携带该令牌的第二次调用才会执行操作。模型无法自行满足此门控条件,且为一个链接、标签集或更改颁发的令牌不能重放用于另一个。

  • 扩大可见性被视为破坏性操作。 发布集合和更改链接的 URL(这会删除旧页面的所有存档副本)都需要确认,而不仅仅是删除操作。

  • 确认提示从不引用 Linkwarden 中的内容。 标题、URL、描述和集合名称来自已保存页面和实例的其他用户;模型读取的文本中仅出现计数和 ID。

  • 返回的内容被标记为不可信数据,特别是存档文章文本,它由控制目标网站的任何人所写。

  • 部分更新不会清除字段。 Linkwarden 的更新路由会替换整个记录,因此此服务器会读取当前状态并进行合并 — 否则更新会静默地剥离链接的标签或集合的协作者。

  • 200 状态码本身不可信。 几个 Linkwarden 路由会以 HTTP 200 和正文中的错误句子报告失败,而一个没有处理所使用方法的路由会返回 200 且没有任何内容。这两种情况都会报告为错误,而不是成功的写入。

  • 错误正文会被截断,HTML 错误页面会被完全丢弃,重定向永远不会被跟随(因此 bearer 令牌不能重放到其他主机),并且每个请求都带有超时。

  • LINKWARDEN_READ_ONLY=true 不会注册写入工具。

  • 剩余风险: 在您配置的令牌权限范围内,被要求执行破坏性操作且用户确认的模型仍然可以执行。请限定账户范围,并保持主机级别的权限提示。

开发

npm install
npm run build
npm test
npm run test:coverage
npm run lint
npm run format
npm run docs:tools     # regenerate docs/reference/tools.md from the registered tools

docs/reference/tools.md 是生成的;如果提交的副本与代码不再匹配,CI 会失败。文档站点位于 docs/ 中,带有其自己的 package.json 和锁文件 — VitePress 不得出现在根安装中,根安装会在 Docker 构建和整个测试矩阵中运行。

请参阅 CONTRIBUTING.md。

发布

一切由标签驱动;没有手动发布步骤。

  1. 将 CHANGELOG.md 中的 [Unreleased] 部分移至新版本并为其添加日期。发布工作流使用 awk 提取该部分,因此 ## [x.y.z] 标题格式很重要。

  2. 更新 package.json 中的 version 字段。

  3. npm run lint && npm run build && npm run test:coverage。

  4. 提交,然后创建一个签名注释标签:

    git tag -s v0.1.1 -m "v0.1.1"
    git push origin main v0.1.1

随后 release.yml 会验证标签是否与 package.json 匹配,通过受信任发布(OIDC——不存在可泄露的 npm 令牌)并附带 provenance 发布到 npm,将版本同步到 server.json 的两个包条目中,发布到 MCP 注册表,并从 changelog 部分创建 GitHub 发布。ci.yml 会并行将多架构容器镜像推送到 GHCR。

如果注册表步骤失败,请在 main 分支上修复它,然后手动运行 mcp-registry.yml 工作流。重新运行失败的作业不是选项:它会检出不可变的标签,因此 main 上的修复永远无法到达它。

License

MIT © Willi Thiel

Available Tools

28 tools
create_collectionCreate a collectionA

Creates a collection. Pass parent_id to nest it under an existing collection. New collections are private; use update_collection to publish one.

Inputs: name (required), color, parent_id, description.

create_rss_subscriptionSubscribe to an RSS feedA

Subscribes to an RSS or Atom feed. Linkwarden polls it and files every new entry as a link in the given collection, preserving the pages according to the account defaults.

Linkwarden fetches the feed once immediately, so an unreachable feed fails right away. Because that fetch happens on the Linkwarden server, a URL addressing its own loopback or the link-local range is refused here before the request is made. That check covers the feed URL only — Linkwarden creates and preserves a link for every entry the feed contains, and on versions before 2.14 it does not check those addresses at all. Do not subscribe to a feed you do not trust. Subscription names must be unique per account, and instances cap the number of subscriptions (20 by default).

Inputs: url (required), name (required), collection_id, collection_name.

create_tagsCreate tags or change their archival settingsA
Idempotent

Creates tags, or updates the ones that already exist — the underlying route is an upsert keyed on the tag name. This is also the only way to set the per-tag archival overrides, which decide how links carrying the tag get preserved.

Note that tags are usually created implicitly by create_link and update_link; use this tool when the archival settings matter, or to create a tag before any link uses it.

Inputs: names (required), ai_tag, archive_as_pdf, archive_as_monolith, +3 more.

delete_collectionDelete a collectionA
Destructive

Deletes a collection. This cascades: every link inside it, every preserved copy of those pages, and every sub-collection below it are deleted too. Two-step: the first call reports how many links would be lost and returns a confirmation token.

Inputs: collection_id (required), confirm_token.

delete_rss_subscriptionDelete an RSS subscriptionA
Destructive

Stops polling a feed. Links that were already created from it stay where they are — only the subscription goes away.

Inputs: rss_subscription_id (required), confirm_token.

delete_tagsDelete tagsA
Destructive

Deletes one or more tags. The links keep existing, they just lose the tag. Two-step: the first call returns a confirmation token bound to exactly this set of ids.

Inputs: tag_ids (required), confirm_token.

get_collectionGet a collectionA
Read-only

Fetches one collection with its link count and the per-member create/update/delete permissions. Use search_links with collection_id to get the links inside it.

Inputs: collection_id (required).

get_current_userGet the authenticated accountA
Read-only

Reports which Linkwarden account the configured token belongs to and that account's archival defaults — which formats new links get preserved in, and whether duplicate URLs are rejected. Useful as a connectivity check and before creating links, because the defaults decide what get_link_content will later have to read.

Inputs: no named parameters.

get_dashboardGet the dashboard linksA
Read-only

Returns the links Linkwarden shows on its dashboard: the most recently added ones together with everything the account has pinned, deduplicated. A quick "what is going on here" overview — use search_links for anything targeted.

Inputs: no named parameters.

get_tagGet a tagA
Read-only

Fetches one tag with its archival settings. Use search_links with tag_id to get the links carrying it.

Inputs: tag_id (required).

get_worker_statsGet preservation queue statisticsA
Read-only

Reports how many links are waiting to be preserved, how many succeeded and how many failed, plus the search-index backlog. Use it to find out whether a page requested through represerve_link has been archived yet.

Requires the instance administrator account (the id in NEXT_PUBLIC_ADMIN, 1 by default); every other account gets HTTP 403 here. The counts cover the whole instance, not just this account.

Inputs: no named parameters.

list_collectionsList collectionsA
Read-only

Lists every collection the authenticated account owns or is a member of, with its link count. The list is flat: nesting is expressed through parentId, where null means the collection sits at the top level. Linkwarden does not page this route, so all collections come back at once.

Inputs: no named parameters.

list_rss_subscriptionsList RSS subscriptionsA
Read-only

Lists the RSS feeds this account subscribes to. Linkwarden polls them and files new entries as links in the configured collection.

Inputs: no named parameters.

list_tagsList tagsA
Read-only

Lists the tags of the authenticated account with the number of links each one is attached to. Tags cut across collections. The per-tag archival settings are included: null there means "inherit the account default", which is not the same as false.

Inputs: sort, cursor, search.

merge_tagsMerge tags into oneA
Destructive

Folds several tags into a single new one: every link that carried any of the source tags gets the new tag, and the source tags are deleted.

Two things to know before calling this. The new tag is created from scratch, so the name must not already be in use by this account — merging into an existing name fails. And the per-tag archival settings of the source tags are not carried over; set them again with create_tags afterwards if they mattered.

Inputs: tag_ids (required), new_name (required), confirm_token.

rename_tagRename a tagA
Idempotent

Renames a tag; every link carrying it keeps it. Tag names are unique per account, so renaming a tag to a name that already exists fails — use merge_tags to fold two tags into one instead.

Inputs: name (required), tag_id (required).

update_collectionUpdate a collectionA
Idempotent

Changes a collection. Fields that are not given stay as they are: the tool reads the collection first and merges, because the underlying route rebuilds the member list from the request body and would otherwise remove every collaborator.

Only the owner of a collection may update it. To move a collection to the top level pass parent_id=0 — Linkwarden needs an explicit marker for that and ignores null.

Setting is_public=true needs a confirmation token: it makes the collection and every link in it readable by anyone who has the URL, without logging in.

Inputs: collection_id (required), name, color, is_public, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 28 tools

    Disambiguation5/5

    Every tool targets a distinct resource/action combination: reads are list/get, mutations are create/update/delete, bulk operations carry a bulk_ prefix, and preservation/RSS/pinning have dedicated verbs. Near-neighbor tools like delete_link vs delete_link_preservations are clearly separated by their nouns and descriptions.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern, with list/get for reads, create/update/delete for writes, bulk_ for multi-item operations, and set_/represerve_/merge_ for special actions. The singular/plural distinction between single-item and bulk tools reinforces the pattern rather than breaking it.

    Tool Count3/5

    28 tools is on the heavy side and exceeds the typical comfortable range, though the set covers several distinct subdomains: links, preservation, collections, tags, RSS, and account/worker status. No tool is pure filler, but the count feels more like a full API wrapper than a tightly scoped MCP server.

    Completeness5/5

    The tool surface provides full lifecycle coverage for links, collections, and tags, plus bulk operations, preservation controls, RSS subscription management, and background-worker monitoring. There are no obvious dead ends: search_links covers listing, get_link_content reads archived text, and represerve_link/delete_link_preservations handle preservation lifecycle.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables managing bookmarks via the Linkwarden API with token-frugal tools for listing collections and links, adding/moving/deleting links, and creating collections.
      7
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables management of Raindrop.io bookmarks, collections, tags, and highlights via MCP tools, with support for search, bulk editing, and library auditing.
      17
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Linkwarden bookmarks providing read-first search and preserved content access with opt-in write, delete, and collection-delete tools, plus heuristic triage workflows.
      128 PyPI
      1
      MIT