Skip to content

Domain interfaces ​

Clumsies has four interface boundaries. They serve different callers, even when they participate in the same action. Reading Memory through MCP, editing a local Draft, and publishing Project or Organization Memory are separate capabilities.

Start here if you know what you want to do but do not know which component owns it. For object definitions, read Data model; for a complete example, read Core flows.

Choose the interface ​

CallerInterfaceWhat it can doWhere it runs
Coding AgentMCP over stdio: one memory toolFind relevant fragments, load complete Memory, propose Draft changesApp-bundled proxy → resident daemon
macOS AppLocal XPC with typed request/response payloadsWorkspace binding, local editing, sync, search diagnostics, authenticated Server requestsApp → resident daemon
Product client, normally daemonPublic HTTP /api/v1/...Read shared data, sync Drafts, submit/review/publish changes subject to role checksClient → Server
Organization administratorAdmin HTTP /api/v1/admin/...Manage organization, membership, Projects, tokens and audit recordsNative Administration → daemon → Server

“Public API” means the product API surface; it does not mean anonymous access. Normal Public and Admin requests use Authorization: Bearer …. Organization administration requires the Organization owner or admin role; project administration routes also accept the relevant Project roles. Publication checks the Review target: Project owner/admin for Project Memory, Organization owner/admin for Org Memory.

First-installation setup is a separate exception: /api/v1/setup/... uses a short-lived setup cookie and CSRF token. OIDC entry/callback, token exchange, setup entry points, and /api/v1/admin/health have their own bootstrap access rules. The health URL is public despite its admin path. See Authentication and sessions.

The domains ​

The route families below are a map of responsibilities. Braces identify a value supplied by the caller, such as {project_id}; paths are relative to the configured Server origin.

Identity and organization ​

This domain answers who is calling, and which actions may they perform? A Project is a collaboration and Memory-selection boundary. Organizations and Projects own published Memory.

CapabilityRepresentative HTTP operationsAccess rule
Sign in and refreshGET /oauth2/authorization/oidc, GET /login/oauth2/code/oidc, POST /api/v1/auth/tokenOIDC authorization code + PKCE, or rotating refresh token
Read identity; sign outGET /api/v1/me, DELETE /api/v1/auth/sessionCurrent authenticated session
Discover Projects and membersGET /api/v1/projects, GET /api/v1/projects/{project_id}, GET /api/v1/projects/{project_id}/membersServer filters/checks access
Create ProjectsPOST /api/v1/projectsAuthenticated organization members; requires Idempotency-Key; the creator becomes the Project owner
Update/delete ProjectsPATCH / DELETE /api/v1/projects/{project_id}That Project's admin or an Organization owner/admin with membership access; requires version If-Match
Configure Projects and membership/api/v1/admin/projects/{project_id}, /members, and member subroutesProject members can read; that Project's admin or an Organization owner/admin can mutate, including organization administrators managing projects they have not joined
Find members to addGET /api/v1/admin/projects/{project_id}/member-candidatesThat Project's admin or an Organization owner/admin; supports q, limit, cursor; returns user profiles excluding disabled users and existing project members
Administer the organization/api/v1/admin/org, /members, /projects, /tokens, /audit-eventsOrganization owner/admin; each path here is under /api/v1/admin

GET /api/v1/me returns the caller’s membership role in projects[].role; organization members receive the project:create capability. The organization-wide directory /api/v1/admin/projects remains restricted to Organization owners/admins.

A role in a Project is not automatically an Organization administrator role. Server checks publication authority independently of whether the caller can see a Project.

Memory and selection ​

This domain answers which published resources exist, and which ones does this Project use? A Memory has stable identity and Markdown content. A selection contains resource IDs; it does not copy the content into a new authority.

CapabilityHTTP operationsResult or constraint
Browse published Organization MemoryGET /api/v1/org/memories and /{memory_id}Metadata list or complete resource
Read published Project-owned MemoryGET /api/v1/projects/{project_id}/memories and /{memory_id}scope=project resources; these routes do not return the selected Organization projection
Read/change Project selectionGET / PUT /api/v1/projects/{project_id}/org-selectionsresource_ids input; replacement needs that Project’s admin or an Organization owner/admin with membership access, plus selection revision If-Match
Save a personal selection BundleGET / POST /api/v1/me/bundles; GET / PATCH / DELETE /api/v1/me/bundles/{bundle_id}Owned by the current user; editing/deletion uses Bundle revision If-Match
Export managed organization dataGET /api/v1/admin/memory-exportAdmin export of Memory, Drafts, selections and Bundles

For the current selected Organization view, read /org-selections under the Project, or its /commit-state and referenced Commit snapshot. To answer “what will my Agent read right now?”, use local MCP load or activate. The daemon constructs Effective Memory from the Project's published projection plus its local Draft overlays. A Server Memory GET alone cannot answer that question.

Drafts and synchronization ​

This domain answers what changes have been proposed, and have they reached Server? A Draft is carried by a Project and targets exactly one owner, Project or Organization. Local persistence, Server synchronization and publication are separate milestones.

CapabilityInterfaceImportant input/output
Make an Agent proposalMCP memory.storeExact replacements for updates; returns local operation ID, Draft ID and sync status
Create/read/edit a Server DraftPOST / GET /api/v1/drafts; GET / PATCH / DELETE /api/v1/drafts/{draft_id}Creation needs Project and daemon installation IDs; Draft edits are author-scoped and version checked
Append a full materialized operationPOST /api/v1/drafts/{draft_id}/operationsaction, resource, content/path fields; integer Draft If-Match
Upload queued operationsPOST /api/v1/draft-operation-batchesEach item has local_operation_id, draft_id, expected_draft_version, operation
Consume changes for syncGET /api/v1/draft-eventsafter_cursor, limit; returns events and next cursor for the current author's Drafts
Compare against a newer basePOST /api/v1/drafts/{draft_id}/reconciliation-candidatesExpected Draft version → Base/Current/Draft comparison
Automatically reconcile a clean DraftPOST /api/v1/drafts/{draft_id}/auto-rebasesAuthor only; expected Draft version; conflicts preserve the baseline and notify the author
Apply a confirmed comparisonPOST /api/v1/drafts/{draft_id}/rebasesCandidate ID + expected Draft version + authority Ref If-Match; saves the previous Draft revision

The HTTP operation format is not the MCP operation format. MCP update accepts expected_hash and exact replacements. The daemon validates these against complete Effective Memory and turns them into the full content operation used for synchronization.

Review and publication ​

This domain answers which proposed changes are being reviewed, and who can publish them? One Review can contain several Drafts, including a large batch of files, but every Draft must target the same publication owner.

CapabilityHTTP operationConcurrency and permission
Submit DraftsPOST /api/v1/reviewsAuthor-owned, open Drafts from one Project and one scope; each Draft version + authority Ref If-Match
Read Review/detail/commentsGET /api/v1/reviews, GET /api/v1/reviews/{review_id}, GET /api/v1/reviews/{review_id}/commentsAuthorized Review readers
CommentPOST /api/v1/reviews/{review_id}/commentsExpected Review version; optional paired anchor_path and one-based anchor_line
Submit revised Drafts as a new ReviewPOST /api/v1/reviewsSame creation checks; rejected Reviews remain closed
Record a decisionPOST /api/v1/reviews/{review_id}/decisionsPublication owner/admin; approved or rejected, expected Review version
Approve and publishPOST /api/v1/reviews/{review_id}/mergesPublication owner/admin; expected Review version + authority Ref If-Match

The current Desktop Approve action calls /merges: an open Review becomes merged, with decision metadata and the new authority Commit recorded in the same transaction. The separate /decisions API remains implemented: approved records approval without publishing, and /merges can subsequently publish an approved Review if its approved content still matches. A rejection closes the Review and freezes its proposal content, while reopening the Drafts for editing. Submit revised Drafts through normal creation to receive a new Review identity; the legacy /submissions endpoint returns 400 without changing history.

A Project Review can include an explicit org_contribution selection. After Project merge, it creates a separate Org Review from that fixed commit; POST /api/v1/reviews/{review_id}/org-contribution retries creation idempotently. Failure or rejection leaves the Project publication intact.

See the HTTP walkthrough for exact request shapes, including stale Draft reconciliation.

Snapshots and local retrieval ​

This domain answers which version is published, and what content belongs to that version?

CapabilityInterfaceMeaning
Check published headGET /api/v1/org/commit-state or GET /api/v1/projects/{project_id}/commit-stateCurrent Ref, latest Commit, update availability and strong ETag
Read historyGET /api/v1/org/commits or GET /api/v1/projects/{project_id}/commitsOrganization history or combined Project publication/selection history
Download one snapshotGET /api/v1/commits/{commit_id}Full commit, tree, blobs, optional Project selection
Retrieve relevant fragmentsMCP memory.activate → XPC activate_memoryTask query → ranked fragments from local Effective Memory
Load a known resourceMCP memory.load → XPC load_memoryIDs/exact paths → complete resources and content hashes
Inspect retrievalPrivate XPC diagnostic methodsLocal Retrieval Runs, evaluation and index state; see Retrieval evaluation

A Commit download is a whole snapshot, not a single-file diff. Multiple files can share the same base/current Commit. Clients should load each required Commit once per operation, then derive file changes locally.

Local XPC is a separate contract ​

The XPC envelope contains method, payload, request_id, and an optional agent_runtime marker. Responses contain ok, payload, and an optional structured error. The daemon dispatches each method to its request type. This is local macOS IPC, not an HTTP service on a localhost port.

The App can use the private server_request method with an HTTP method, relative path, headers and body. Daemon supplies the configured Server origin and credentials. The MCP proxy cannot use this general bridge: it exposes only its three typed Memory operations. Agent runtime calls also carry a protocol revision/build identity, checked before binding and on dispatch.

Workspace directory binding, Keychain credentials, local storage paths, search indexes, and Draft queue state belong to daemon. They are not Server resources and do not acquire Public API routes merely because Desktop displays them.

Contracts and compatibility ​

Both project and org scopes can publish. Project editing defaults to project; existing Org Drafts retain their target. A Project Ref combines Project-owned content with selected Org content. The removed MCP retrieve tool and old separate rule/workflow/context APIs are not current integration entry points. Preserve returned identifiers as opaque values instead of inferring their meaning from a prefix.