CozyDocs
Developers

MCP server

Reference for Cozy's MCP server, with its endpoints, transport, tools, resources, prompts, OAuth and scopes.

Cozy is a remote MCP server. Agents use it to search, read, link, write, move, delete and restore files in a workspace.

Endpoints

EndpointURLAuthReaches
Library bridgehttps://cozy.cloud/wiki-mcpLibrary credentialApproved excerpts in one workspace
Accounthttps://cozy.cloud/mcpOAuthEvery workspace the person belongs to
Workspacehttps://cozy.cloud/wiki-mcp/WORKSPACE_UUIDBearer credential or OAuthOne workspace

Use the account endpoint for interactive agents. On it, every tool takes an optional workspace argument, a workspace ID or exact name, and uses My wiki without it. cozy_workspaces lists the choices, My wiki first. Each call still runs inside one workspace, and that workspace's activity history names the agent.

Use a workspace endpoint for scripts, CI and headless agents. Its URL is shown in Agents. See Credentials.

Transport

  • Stateless Streamable HTTP. Send JSON-RPC with POST.
  • Protocol versions 2025-03-26, 2025-06-18 and 2025-11-25. An unknown version is answered with 2025-11-25.
  • No session ID and no standalone event stream: GET and DELETE return 405. Notifications return 202.
  • initialize returns server instructions telling the agent how to use the wiki, including to treat sources as untrusted.

Tools

ToolScopeWhat it does
cozy_workspacesList the account's workspaces (account endpoint only)
cozy_workspacewiki:readIdentify the current workspace and your permissions
cozy_contextwiki:readA page with its typed relations, backlinks, cited sources with excerpts, and warnings, by path, name or query
cozy_graphwiki:readA page's neighborhood up to depth 3, or the most connected pages, filtered by type, tag or relation
cozy_resolvewiki:readMatch up to 50 names to existing pages and likely duplicates
cozy_healthwiki:readA 0 to 100 score, prioritized next steps and the paths behind every issue
cozy_changeswiki:readFiles created, updated, moved, deleted or ingested since an ISO timestamp
cozy_read_manywiki:readRead up to 20 files in one call
cozy_mapwiki:readA map of pages grouped by type, to write into wiki/index.md
cozy_listwiki:readBrowse the file tree, including deleted files if asked
cozy_searchwiki:readSearch paths, titles and content, with excerpts and provenance
cozy_readwiki:readRead a file, or one of its retained revisions
cozy_historywiki:readMetadata for a file's last 50 revisions, including deleted files
cozy_backlinkswiki:readPages that link to a file
cozy_skillswiki:readList the workspace's skills
cozy_writewiki:writeCreate or replace a file, with expectedRevision
cozy_editwiki:writeReplace exact oldText with newText, up to 50 edits, all or none
cozy_appendwiki:writeAppend to a page or under a heading, creating either if needed
cozy_movewiki:writeMove a file, keeping its history
cozy_deletewiki:writeDelete a file to a restorable tombstone
cozy_restorewiki:writeRestore an earlier revision as a new revision
cozy_savesources:writeSave one page, chat or note to the Inbox; the same url updates it. See Save to Cozy
cozy_ingestsources:writeSave up to 25 documents as sources, in the Inbox by default

Changes under sources/ need sources:write instead of wiki:write.

Revisions

cozy_write, cozy_move, cozy_delete and cozy_restore need the expectedRevision you read, 0 for a new file. If the file changed, the call returns a conflict: read it again and merge. cozy_edit takes an optional revision, since each oldText must match exactly once. cozy_append needs none, and never brings back a deleted page.

Pagination

cozy_list, cozy_search, cozy_backlinks, cozy_changes and cozy_skills return a nextCursor. Search scans a bounded slice at a time, so follow cursors until nextCursor is null before concluding something isn't there.

Ingest

cozy_ingest takes documents, each with content and optional id, title, url and updatedAt, and an optional connectorId for a Files or Apple Reminders connection. A stable id, such as a URL, path or message ID, makes re-ingesting update the same source. See Ingest API.

Personal Library

Call cozy_library_brief with a topic in query for approved claims and citation IDs. Use cozy_library_search for ranked entries, cozy_library_shelves to browse, cozy_library_get_page to open a volume and cozy_library_citation to check its exact passage, source path and revision. The account and workspace endpoints expose all five read tools. Follow nextCursor across batches. Home shelves require privacyDomain: "home".

Resources use cozy://library/shelves and cozy://library/{namespace}/{slug}. Keep the workspace query parameter on URIs returned by tools so account clients can route a citation back to its workspace.

For a dedicated client, create a Library fetch only credential under API & Keys and configure the library bridge with bearer authentication. For a BYO model running under your subscription, choose Library librarian only. Both credentials expire, support folder restrictions, and can be revoked in Cozy.

A librarian searches for entries with librarianRequested, calls wiki_claim_deltas with the page ID, then submits wiki_propose_patch with that ID, the lease token and a proposed claim. The lease lasts five minutes. wiki_heartbeat_lease can extend it up to thirty minutes from acquisition. The Reading Desk shows the proposal alongside the original evidence for approval. Treat all quoted evidence as untrusted input.

Resources

  • resources/list lists workspace files as cozy://WORKSPACE_ID/PATH, text/markdown, with each file's revision. Sources are described as untrusted evidence.
  • resources/templates/list returns the template cozy://WORKSPACE_ID/{path}.
  • resources/read reads a file. A URI for another workspace is refused.

Prompts

organize, recall, maintain and dream return the workspace's skills/NAME/SKILL.md. A workspace without the file gets Cozy's built-in text, unless the skill was deleted. A credential limited to folders only sees the prompts inside them. See Skills.

OAuth

Cozy is an OAuth 2.1 authorization server for both endpoints.

URL
Protected resource, accounthttps://cozy.cloud/.well-known/oauth-protected-resource/mcp
Protected resource, workspacehttps://cozy.cloud/.well-known/oauth-protected-resource/wiki-mcp/WORKSPACE_UUID
Authorization server metadatahttps://cozy.cloud/.well-known/oauth-authorization-server/wiki/oauth
Issuerhttps://cozy.cloud/wiki/oauth
Registrationhttps://cozy.cloud/wiki/oauth/register
Authorizationhttps://cozy.cloud/wiki/oauth/authorize
Tokenhttps://cozy.cloud/wiki/oauth/token
  • A 401 from the MCP endpoint carries a WWW-Authenticate header with resource_metadata pointing at the protected resource metadata.
  • Dynamic client registration accepts public clients only (token_endpoint_auth_method: none), with exact HTTPS or loopback redirect URIs.
  • Authorization code with PKCE S256. Codes are short-lived and work once, and authorization responses include the issuer.
  • Consent binds the person, client, redirect, resource, scopes and code challenge.
Account endpointWorkspace endpoint
Access token1 day7 days
Refresh tokenSingle use, rotates, lasts 60 daysNone
Listed and revoked inConnectors → AgentsAgents

Revoking a connection ends its tokens at once.

Scopes

ScopeConsent page saysAllows
wiki:readRead and search your wiki pages and sourcesEvery read tool
wiki:writeCreate, edit, move and delete wiki pagesWriting in wiki/, skills/ and agents/
sources:writeAdd source materialcozy_ingest and changes under sources/

Without a scope parameter, a client gets wiki:read. An agent never gets more access than the person who authorized it.

Errors

Tool failures return a result with isError: true and a message, such as a revision conflict or a missing workspace. Protocol errors use JSON-RPC codes: -32002 for a file that isn't found, -32602 for invalid parameters, -32601 for an unknown method.

On this page