Introducing a new way to review your PRs.

Read the announcement

karakeep-app / karakeep

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

View on GitHub

21 documents · Updated Nov 23, 2026

docs / client-integrations

Client integrations

Karakeep connects people and external tools to one bookmark service through browser, mobile, command-line, agent, and library clients. These clients capture and manage links, notes, files, lists, tags, highlights, and readable content while the server remains the source of truth.

Integration model

Each client uses a server address and an API key to reach an authenticated Karakeep account. First-party clients mainly use the typed tRPC service surface, while developer tools use the versioned REST API and its OpenAPI contract. See API and tRPC service layer for the service boundary itself.

The client paths join at the same account and bookmark model. A capture from a browser or phone can therefore be searched and edited from the CLI or an agent without a separate copy of the data.

This diagram shows how user actions and external tools reach the shared Karakeep service.

flowchart LR
    Browser[Browser extension] -->|tRPC + API key| Service[Karakeep service]
    Mobile[Mobile application] -->|tRPC + API key| Service
    CLI[CLI] -->|tRPC + API key| Service
    MCP[MCP server] -->|REST SDK + API key| Service
    SDK[TypeScript SDK] -->|REST API + API key| Service
    Service --> Data[(Account and bookmark data)]

Authentication and account context

The shared client identity is a bearer API key tied to one Karakeep server and account. The browser extension can exchange account credentials for a key. The mobile app accepts account credentials or an existing API key and keeps the server address and key on the device. It can also keep custom HTTP headers for requests to that server. The CLI reads the same pair from command options, environment values, or its user config. The MCP server receives them from its process environment.

References: packages/…/apiKeys.ts• L35-59 packages/…/apiKeys.ts• L132-193 apps/…/signin.tsx• L80-172 apps/…/server-address.tsx• L14-101 apps/…/settings.ts• L39-68 apps/…/index.ts• L17-41 apps/…/config.ts• L6-47 apps/…/shared.ts• L8-29

An API key can be created with full access or with named scopes. Clients must use a key that grants the operations they need. A missing, invalid, expired, or under-scoped key stops the request at the service boundary.

References: packages/…/apiKeys.ts• L27-33 packages/…/apiKeys.ts• L39-49 packages/…/auth.ts• L24-37

Service surfaces

The /api/trpc surface exposes the typed application router used by the browser extension, mobile app, and CLI. The /api/v1 surface exposes stable HTTP resources for bookmarks, lists, tags, highlights, assets, feeds, backups, and user data. The SDK and MCP server build on the REST surface rather than creating a second data model.

References: packages/…/index.ts• L29-43 packages/…/index.ts• L69-93 packages/…/trpc.ts• L8-28 packages/…/_app.ts• L21-40 packages/…/karakeep-openapi-spec.json• L1-6 packages/…/karakeep-api.d.ts• L6-42

User-facing clients

Karakeep provides clients for saving content at the point where a user finds it. These clients focus on fast capture and access while enrichment, search, and account data stay in the service.

Browser extension capture

The browser extension turns the active page, a selected passage, a link, or an image into a bookmark request. It can save at once or show a short confirmation step. When the user grants host access, it can also make a client-side page archive before sending the bookmark. See Browser extension capture for its capture and authentication flows.

References: apps/…/manifest.json• L11-70 apps/…/background.ts• L99-183 apps/…/SavePage.tsx• L69-160 apps/…/package.json• L16-39

The extension also gives the browser a view of saved status. Its badge and context-menu actions can open an existing bookmark or a URL search in Karakeep. A change in server address or API key replaces the client context so cached status does not cross account boundaries.

References: apps/…/background.ts• L187-215 apps/…/trpc.ts• L23-111

Mobile application access

The mobile application gives iOS and Android users access to the same account data as the web application. It supports capture, reading, search, bookmark management, sharing, lists, tags, highlights, and account settings against either the hosted service or a self-hosted server.

The dashboard changes its navigation to fit the window. Phones use native tabs for home, lists, tags, highlights, and search. Wide iOS windows use a sidebar with archive, favourites, owned lists, and shared lists. The same account and bookmark tasks remain available across both layouts. See Mobile application for the mobile product flows.

References: apps/…/_layout.tsx• L24-53 apps/…/_layout.tsx• L10-98 apps/…/DashboardSidebar.tsx• L321-477 apps/…/responsive.ts• L5-21

The mobile client accepts password login or an existing API key. Users can set a server address and custom request headers, which lets the same app connect to hosted, self-hosted, or deployment-specific endpoints. A connection check separates a device with no network from a server that cannot be reached, so the app can show the right recovery action.

References: apps/…/signin.tsx• L80-172 apps/…/server-address.tsx• L14-101 apps/…/test-connection.tsx• L17-91 apps/…/useConnectionStatus.tsx• L10-116

The mobile client captures a new link or note, text from the clipboard, and images from the photo library. Native share targets accept links, text, images, and PDFs, then send the content through the same bookmark or asset flow. Development and production builds use separate app identities and URL schemes so shared content opens in the intended app. A duplicate save remains tied to the existing bookmark rather than creating a second local record.

References: apps/…/index.tsx• L47-189 apps/…/new.tsx• L28-82 apps/…/app.config.js• L1-13 apps/…/app.config.js• L73-117 apps/…/_layout.tsx• L42-75 apps/…/sharing.tsx• L26-93 apps/…/eas.json• L6-17

The app presents links, text notes, and image or PDF assets in a shared bookmark view. Users can edit details, manage tags and lists, mark items as favourites, archive them, share them, and open highlights in their article context. The bookmark feed supports quick owner actions such as favourite and archive. The reader toolbar can place common actions on the bar and move less-used actions into an overflow menu when space is limited.

References: apps/…/info.tsx• L147-216 apps/…/info.tsx• L356-525 apps/…/BookmarkCard.tsx• L405-537 apps/…/BottomActions.tsx• L116-144 apps/…/BottomActions.tsx• L508-663 apps/…/shareBookmark.ts• L15-93

Mobile search supports keyword, hybrid, and semantic bookmark search when the server enables semantic search. Search history is local to the app, while search results and paging come from the shared account service. Lists can also use smart search queries with tag, favourite, site, and time shortcuts.

References: apps/…/InlineSearch.tsx• L21-91 apps/…/SearchModeSelector.tsx• L19-79 apps/…/useBookmarkSearchState.ts• L21-75 apps/…/ListFormFields.tsx• L58-161 apps/…/index.tsx• L31-87

The mobile app supports manual and smart lists, nested list navigation, shared lists, invitations, tags, highlights, and usage statistics. Owners can add or remove bookmarks from manual lists and manage list access. The app shows source and storage statistics so users can understand how their library grows.

References: apps/…/add.tsx• L85-196 apps/…/ListFormFields.tsx• L33-166 apps/…/DashboardSidebar.tsx• L321-477 apps/…/UsageStatsScreen.tsx• L524-741 apps/…/_layout.tsx• L12-80

Mobile offline reading

Mobile offline reading keeps selected link articles and text notes on the device for use without a network connection. Users can save one article by hand or select recent articles and lists for automatic download. List articles have priority when storage is limited, while manually saved copies are kept.

The app reports whether it is checking, downloading, waiting for Wi-Fi or a connection, paused, blocked by storage, or ready. Downloads run while the app is open and restart when it returns to the foreground or when settings and network state change. Normal writes fail when the device is offline; the local store is not a write queue.

References: apps/…/offline.tsx• L118-260 apps/…/OfflineDownloadSync.tsx• L27-101 apps/…/offlineSync.ts• L326-464 apps/…/offlineDownloadPrefs.ts• L5-16

Offline article copies are scoped to the server and API-key identity. The app keeps bookmark metadata separate from large article bodies and can reconcile or remove stale automatic copies. Logout clears the account's local query, download, and article state so a later session cannot read the prior account's local content.

References: apps/…/offlineLibrary.ts• L18-60 apps/…/offlineLibrary.ts• L221-355 apps/…/providers.tsx• L27-69 apps/…/offlineLibrary.test.ts• L45-101

List sharing

Mobile list sharing gives owners one place to publish a list, invite collaborators, and manage access. A list owner can grant view or edit access on manual lists, while other users can inspect their access or leave a shared list. Public links let anyone with the link view a published list.

The mobile list view groups favourites, archive, owned lists, shared lists, nested lists, and pending invitations. Users can create manual or smart lists, choose a parent for a nested list, add bookmarks to manual lists, and organize bookmarks with tags. Smart lists are defined by a search query and do not accept collaborators through the mobile flow. A list can also be selected for offline reading from its list view.

References: apps/…/DashboardSidebar.tsx• L321-477 apps/…/new.tsx• L21-101 apps/…/select-parent.tsx• L19-72 apps/…/add.tsx• L85-196 apps/…/ListFormFields.tsx• L33-166

The sharing view keeps the list, collaborator, invitation, and bookmark views aligned after an access change. Users can accept or decline invitations, change collaborator roles, remove access, or share a public list link when the server allows it. Tag views provide the same mobile organization path for editing or deleting a tag and changing bookmark layout.

References: apps/…/sharing.tsx• L13-51 apps/…/list-sharing-settings.tsx• L136-313 apps/…/pending-list-invitations.tsx• L17-59 apps/…/[slug].tsx• L63-145

Developer-facing integrations

Developer tools use Karakeep as a programmable store rather than as a visual app. The CLI supports shell and script workflows, the MCP server exposes bookmark actions to agent hosts, and the SDK gives TypeScript programs typed access to the REST API. See CLI, MCP, and SDK integrations for tool-specific use.

Command-line workflows

The CLI provides commands for authentication, bookmarks, assets, lists, tags, highlights, administration, import, migration, backup-oriented work, and output for scripts. It is published as the karakeep command, sends authenticated requests to a selected Karakeep server, and can return JSON instead of human-readable output. Authentication setup and skill guidance are available before the CLI resolves account credentials for other commands.

References: apps/…/package.json• L3-16 apps/…/index.ts• L45-103 apps/…/bookmarks.ts• L154-303 apps/…/bookmarks.ts• L324-375

The CLI accepts a server address and API key from the command line or environment, then falls back to a per-user config file. When no server address is set, it uses the hosted Karakeep service. Bookmark operations include links, text notes, image or PDF assets, search, pagination, readable content, tags, and list membership.

References: apps/…/index.ts• L17-41 apps/…/config.ts• L6-47 apps/…/bookmarks.ts• L432-493 apps/…/bookmarks.ts• L586-760

Model Context Protocol access

The Model Context Protocol (MCP) server lets an MCP host, such as an agent desktop tool, call Karakeep actions through named tools. It focuses on bookmark and collection work: search and read bookmarks, create or update records, manage lists and tags, work with highlights, and obtain asset downloads.

References: apps/…/README.md• L6-42 apps/…/index.ts• L1-11

The MCP server communicates over standard input and output. It creates one REST client with the configured server address, bearer key, and optional custom headers, then registers tool groups on that client. It exposes tools rather than MCP resources and is published as the karakeep-mcp command.

References: apps/…/package.json• L3-15 apps/…/package.json• L42-46 apps/…/index.ts• L1-11 apps/…/shared.ts• L8-36

TypeScript SDK and REST contract

The official TypeScript SDK gives programs a typed REST client for the versioned API. Its generated types describe bookmark, search, organization, highlight, asset, feed, backup, user, and related operations. See API and tRPC service layer for the server-side API groups.

References: packages/…/README.md• L1-5 packages/…/index.ts• L1-12 packages/…/karakeep-openapi-spec.json• L1-55 packages/…/karakeep-api.d.ts• L247-555

Developers install the package as @karakeep/sdk. Its published package exposes the typed client as an ESM module and publishes TypeScript declarations for programs that call the REST API. The declarations are generated from the OpenAPI contract and copied into the published build.

References: packages/…/package.json• L3-22 packages/…/package.json• L31-40 packages/…/vite.config.mts• L6-25 packages/…/karakeep-api.d.ts• L1-6

The OpenAPI contract is the shared agreement between the REST service and REST clients. It uses bearer authentication, cursor-based pagination, and three main bookmark forms: links, text notes, and image or PDF assets. The generated SDK keeps the REST resource and response types aligned with the server contract.

References: packages/…/karakeep-openapi-spec.json• L1-6 packages/…/karakeep-openapi-spec.json• L57-64 packages/…/karakeep-api.d.ts• L6-42 packages/…/karakeep-api.d.ts• L826-976 packages/…/karakeep-api.d.ts• L1115-1285

Cross-client data flows

All clients create and update the same bookmark types. A link may later gain fetched content or an archive. A text bookmark remains a note. An asset bookmark points to an uploaded image or PDF. The source field records which client or import path created the record.

References: packages/…/karakeep-api.d.ts• L831-926 packages/…/karakeep-api.d.ts• L1158-1233 apps/…/sharing.tsx• L48-79

A typical integration flow has three stages:

  1. The client gathers a URL, text selection, file, or command input.
  2. The client authenticates and sends a typed request to tRPC or the REST API.
  3. Karakeep stores the record and can later enrich, search, organize, or return it to any other client.

This separation lets capture clients stay small while the service applies common account rules and background processing. A client-side archive is optional, so a failed page capture can still produce a normal link bookmark.

References: apps/…/SavePage.tsx• L122-160 apps/…/sharing.tsx• L26-93 packages/…/index.ts• L69-93 packages/…/karakeep-openapi-spec.json• L8-44

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to API key creation, exchange, revocation, or scopes affect the extension login flow, mobile sessions, CLI credentials, MCP startup, and the security guidance in API and tRPC service layer.
  • Changes to the bookmark request or response shape must stay aligned across the shared bookmark types, the OpenAPI document, the generated SDK types, and clients that set the source value.
  • Changes to REST paths or pagination must be checked against the SDK, MCP calls, CLI readable-content and list flows, and direct asset uploads.
  • Changes to the tRPC router or endpoint must be checked against the browser extension, mobile providers, and CLI client builders.
  • Changes to client account context must preserve cache separation by server address and API-key identity. This is important for extension badge data and mobile persisted data.
  • Changes to asset upload or download rules must account for mobile sharing, CLI asset bookmarks, and MCP asset access.
  • Changes to native mobile share targets or app identity must preserve separate development and production launch settings and the supported shared content types.
  • Changes to mobile server settings or request headers must preserve valid HTTP(S) address checks, stored account context, and the header values used for server requests.
  • Changes to mobile health checks or connection-state rules must preserve the difference between device-offline and server-unreachable states and keep retry and diagnostics actions useful.
  • Changes to mobile navigation breakpoints, tab routes, or sidebar entries must keep phone and wide-window routes focused on the same dashboard areas.
  • Changes to mobile search modes or cursor behavior must preserve feature gating, local history, and the shared bookmark result shape.
  • Changes to mobile bookmark card gestures, reader toolbar actions, or action-menu placement must preserve owner-only controls, external-browser behavior, offline actions, and accessible labels.
  • Changes to mobile offline selection, storage limits, or article eligibility must preserve list priority, manual-copy protection, Wi-Fi rules, account scoping, and removal of stale automatic copies.
  • Changes to mobile list nesting, parent selection, or list routes must preserve the owner-only parent rule, the no-parent option, and the edit flow that returns the selected parent.
  • Changes to mobile list roles, invitations, public links, or sharing routes must preserve the relationship between the list tree, collaborator view, pending invitations, and list membership actions.
  • Changes to mobile list or tag action menus must preserve role-based visibility, delete or leave navigation, layout actions, and query refresh behavior.
  • Changes to mobile localization or shared settings screens must preserve the shared web namespace, mobile key parity, valid locale tags, and settings navigation inside the single settings sheet.
  • Changes to CLI command registration or authentication bypass rules must preserve unauthenticated setup commands while keeping account commands behind credential resolution.
  • Changes to CLI or MCP package entry points must preserve the published karakeep and karakeep-mcp commands.
  • Changes to MCP tool registration or its standard input and output transport must remain compatible with MCP hosts and the REST client setup.
  • Changes to the SDK package entry points, ESM build, generated API declarations, or build output must preserve the @karakeep/sdk install and import contract for REST clients.

Important failure modes

TriggerConsequenceGuard
A client sends a missing, invalid, or under-scoped API keyThe service rejects the request and the client cannot read or change account dataCreate a key with the needed scope and send it as a bearer token
A client uses the wrong server address or service pathThe client reports a connection or request failure, or reaches a different accountKeep the server address with the client settings and use /api/trpc for tRPC or /api/v1 for REST
The browser extension lacks host permission for client-side captureThe page archive is skipped, but a plain link bookmark can still be savedTreat client-side capture as optional and grant host access only when archive capture is needed
A mobile session changes account or server without clearing local contextCached data or offline articles can appear to belong to the wrong accountScope persisted data by server and API-key identity and clear it on logout
A mobile server address has no HTTP(S) scheme or points to the wrong hostSign-in or later requests fail before reaching the intended serviceSave a trimmed address with http:// or https:// and test the selected server
The mobile health check treats device-offline and server-unreachable as the same stateThe user sees the wrong recovery action and may retry a server that the device cannot reachKeep network state and server health as separate signals
A wide-window navigation route is added to only the tab bar or only the sidebarUsers can lose access to a dashboard area when the layout changesKeep the native tabs and wide iOS sidebar mapped to the same main routes
A REST contract changes without updating the OpenAPI-generated SDK or tool clientsType checks may pass in one client while requests or response handling fail in anotherUpdate the OpenAPI contract and all REST consumers together
An asset download or upload lacks a valid share target or complete transferThe asset bookmark or native share action failsCheck device sharing and storage, require successful asset responses, and complete upload before creating the bookmark
A mobile build uses the wrong app variant or share registrationDevelopment links can open the production app, or supported shared content does not reach the appKeep variant-specific names and schemes, and preserve the platform share filters
A mobile bookmark action is shown to the wrong role or loses its content-type guardA user sees an action they cannot use, or an action fails for a note or assetDerive action visibility from ownership and bookmark type before building the card or toolbar
A mobile list access change updates only the collaborator view or only the list treeThe user sees stale membership, counts, or invitation stateRefresh the list, list stats, collaborator, bookmark, and pending-invitation data affected by the change
A collaborator is added to a smart listThe mobile flow offers an access change that the list type cannot supportAllow collaborator invites only for manual lists and keep smart lists viewable without collaborators
A user selects an invalid parent or the edit flow loses its return stateA list can become incorrectly nested or the selected parent is not appliedOffer only owned lists outside the edited subtree and return the selected parent to the create or edit route
A mobile query cache stores article content or persists stale account dataLocal storage grows without bound or exposes data from a prior accountKeep article bodies in the offline library and clear persisted cache when the account context is removed
A mobile search request loses its mode or cursor stateSearch results can use the wrong search behavior or stop before all matches loadKeep feature gating, search mode selection, and cursor paging aligned with the shared search service
A mobile write starts while the device is offlineThe write fails instead of waiting for later deliveryShow the existing error state and retry after connectivity returns; do not treat the local cache as a write queue
An automatic offline pass runs on cellular when Wi-Fi-only is setThe device uses an unapproved network or stops before the selected articles are savedRespect the network rule and show the waiting state until an allowed connection is available
Offline storage reaches its limit or an article has no reader contentSome automatic articles remain unavailable offline, while older automatic copies may be removedKeep list articles ahead of recent articles, protect manual copies, and retry content that is still processing
A list or tag is deleted without leaving its current route or refreshing its parent viewThe app can show a dead detail screen or stale organization dataReturn to the list or tag index after success and refresh the affected list or tag queries
A mobile locale lacks a required string or uses an invalid plural localeA label falls back unexpectedly or a plural displays a raw key on a deviceKeep locale keys in parity and use the app's valid locale tags and plural support
A CLI account command runs without resolved credentialsThe command stops before it can reach the serverUse the configured key or provide KARAKEEP_API_KEY or --api-key; limit the unauthenticated path to setup commands
A published client command or SDK export points to a missing build entryThe integration cannot start or import even when the REST service is availableKeep package names, binary names, exports, module formats, and build output aligned
An MCP host cannot use the configured standard input and output processThe host cannot discover or call Karakeep toolsStart the MCP server as the host's stdio process and provide its server address and bearer key

Key files

FileWhy to read it
packages/…/index.tsShows the HTTP entry points and the split between tRPC, versioned REST, asset, and public routes.
packages/…/trpc.tsShows how the typed application router is exposed to first-party clients.
packages/…/_app.tsShows the shared domain capabilities available through tRPC.
packages/…/apiKeys.tsShows API key creation, credential exchange, scopes, and revocation.
apps/…/SavePage.tsxShows how browser input becomes a bookmark and how optional page capture fits into save.
apps/…/background.tsShows browser context-menu, shortcut, badge, and current-page lookup behavior.
apps/…/app.config.jsShows mobile app identities, URL schemes, and native share targets for development and production variants.
apps/…/_layout.tsxShows the mobile root flow for native share intents and shared providers.
apps/…/index.tsxShows the mobile login or dashboard entry decision.
apps/…/signin.tsxShows how the mobile client selects a server and authenticates with a password or API key.
apps/…/_layout.tsxShows the dashboard stack and its bookmark, list, tag, and settings routes.
apps/…/_layout.tsxShows the phone dashboard's native navigation areas.
apps/…/DashboardSidebar.tsxShows the wide-window navigation model for main pages and nested lists.
apps/…/responsive.tsShows when the mobile client switches between tabs and the sidebar.
apps/…/sharing.tsxShows how native share intents become link, note, or asset bookmarks.
apps/…/info.tsxShows the mobile bookmark detail, organization, owner actions, and offline controls.
apps/…/BookmarkCard.tsxShows bookmark card layouts, owner actions, swipe triage, and external-browser behavior.
apps/…/BottomActions.tsxShows the configurable reader toolbar and its responsive overflow behavior.
apps/…/InlineSearch.tsxShows mobile search input, mode selection, and result navigation.
apps/…/offlineLibrary.tsShows the product purpose of mobile offline reading and its account-scoped local library.
apps/…/offlineSync.tsShows how selected server articles become local offline copies and how download state is reported.
apps/…/OfflineDownloadSync.tsxShows when the mobile client starts or stops automatic offline download passes.
apps/…/DashboardSidebar.tsxShows the mobile list tree, shared-list grouping, and wide-window list navigation.
apps/…/add.tsxShows how the mobile client adds and removes bookmarks from manual lists.
apps/…/ListFormFields.tsxShows manual and smart list creation, nesting, and query guidance.
apps/…/list-sharing-settings.tsxShows public list links, collaborator roles, invitations, and access removal from the mobile client.
apps/…/UsageStatsScreen.tsxShows the mobile account statistics and source breakdown.
apps/…/package.jsonShows the published CLI command and package entry point.
apps/…/index.tsShows CLI command groups, setup commands, and common server and credential setup.
apps/…/bookmarks.tsShows the main programmable bookmark, search, readable-content, asset, tag, and list workflows.
apps/…/package.jsonShows the published MCP command and its SDK and MCP dependencies.
apps/…/index.tsShows the MCP stdio entry point and the registered tool groups.
apps/…/shared.tsShows how the MCP server connects to the REST API and passes authentication context.
apps/…/README.mdGives the high-level tool set available to agent hosts.
packages/…/package.jsonShows the SDK package name and the published client, module, and type entry points.
packages/…/index.tsShows the official typed REST client entry point.
packages/…/karakeep-api.d.tsShows the generated REST request and response contract used by SDK consumers.
packages/sdk/vite.config.mtsShows the SDK's published ESM build shape.
packages/…/karakeep-openapi-spec.jsonDefines the versioned REST contract used by the SDK and other REST clients.