Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AFFINE_EMAILNoAFFiNE account email for email/password authentication.
MCP_TRANSPORTNoTransport mode for the MCP server, for example stdio or http.
AFFINE_BASE_URLNoBase URL of the AFFiNE instance.
AFFINE_PASSWORDNoAFFiNE account password for email/password authentication.
AFFINE_API_TOKENNoCompatible GraphQL bearer token for older deployments that still accept it.
AFFINE_GRAPHQL_PATHNoCustom GraphQL route for non-standard self-hosted AFFiNE deployments.
AFFINE_TOOL_PROFILENoTool exposure profile: read_only, core, authoring, or full. Default: full.
AFFINE_WORKSPACE_IDNoDefault AFFiNE workspace ID.
AFFINE_MCP_AUTH_MODENoHTTP MCP authentication mode, for example bearer.
AFFINE_DISABLED_TOOLSNoComma-separated canonical tool names to disable.
AFFINE_MCP_HTTP_TOKENNoBearer token for the HTTP MCP listener/gateway. Keep it server-side.
AFFINE_DISABLED_GROUPSNoComma-separated tool groups to disable, such as docs.database, destructive, or admin.
AFFINE_MCP_MULTI_TENANTNoEnable multi-tenant mode. Default: false.
AFFINE_ALLOW_INSECURE_HTTPNoAllow plain HTTP for a self-hosted AFFiNE instance on a trusted private network. Defaults to false.
AFFINE_MCP_HTTP_MAX_SESSIONSNoCombined Streamable HTTP and legacy SSE session capacity, including sessions being initialized. Default: 32.
AFFINE_MCP_TENANT_ALLOWED_HOSTSNoComma-separated allowed AFFiNE hosts for multi-tenant mode. Required when multi-tenant mode is enabled.
AFFINE_OAUTH_ALLOW_SERVICE_WRITESNoAllow write-capable tool profiles in OAuth service-account mode. Default: false.
AFFINE_MCP_HTTP_SESSION_IDLE_TIMEOUT_MSNoIdle time before an inactive HTTP session is closed. Default: 1800000.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_workspacesB

List available AFFiNE workspaces with best-effort profile metadata and direct URLs

get_workspaceB

Get workspace details with best-effort profile metadata and a direct URL

create_workspaceB

Create a new workspace with initial document (accessible in UI)

update_workspaceB

Update workspace settings. Requires at least one of public or enableAi.

delete_workspaceB

Delete a workspace permanently and report success only when AFFiNE confirms the mutation.

create_mindmapA

Create a native AFFiNE mindmap with one root shape in an existing document. Returns mindmapId/rootId for add_mindmap_node. Only right/left/balance are supported; down/up are unsupported by BlockSuite. Does not create a document or sidebar link.

get_mindmapA

Read and validate native mindmap hierarchy, ordered child IDs, text, collapsed state, geometry, and supported directions. Discover mindmapId via get_edgeless_canvas.

add_mindmap_nodeA

Add one native child shape to parentId inside mindmapId. beforeId optionally inserts before a sibling; otherwise append. Returns nodeId. Persists hierarchy and layout together. Maximum 500 nodes, depth 64; shape nodes only.

update_mindmap_nodeB

Replace a native node's text and/or set collapsed. Keeps node IDs and hierarchy. Recalculates geometry; the editor may refine text dimensions when opened.

reparent_mindmap_nodeA

Move a node with all descendants to a parent in the SAME native mindmap; beforeId optionally reorders siblings. Rejects root moves, cycles, missing/foreign IDs. Preserve collapsed state. One shared MCP server serializes workspace mutations; independent servers and native editors have no compare-and-swap protection.

set_mindmap_styleA

Switch native style ONE=1, TWO=2, THREE=3, FOUR=4. Persists the preset on all nodes, sizes and layout; native connectors follow style. Keeps IDs, hierarchy, collapsed state and root anchor. Rejects locked maps/nodes.

set_mindmap_lockA

Set the mindmap's native lockedBySelf flag. Nodes inherit the lock in AFFiNE. Unlock does not clear ancestor-group or independently locked node flags; read the returned effective locked state. Does not change layout or styles. This is an editor lock, not an access-control boundary.

set_mindmap_layoutA

Set right, left, or balance and persist native node positions. Root stays anchored; collapsed flags remain unchanged. BlockSuite does not support down/up. This is a native mindmap, with editor-derived connectors.

list_docsA

List documents in a workspace (GraphQL), falling back to bounded workspace metadata when GraphQL document access is denied. Each doc includes an inTrash flag; fallback summary, public, and defaultRole values are null. GraphQL and fallback cursors are not interchangeable; restart pagination without after if a cursor is rejected.

search_docsA

Fast search for documents by title using workspace metadata. Much faster than exporting each doc. Returns docId, title, direct URL, and inTrash for each match, plus offset/limit pagination state (hasMore, truncated, and nextOffset).

find_doc_by_titleA

Resolve docs by exact title. Returns ALL matches up to limit (callers handle ambiguity). Case-sensitive by default; pass caseInsensitive: true to fold case. Reads workspace metadata — fast, no per-doc fetch. Unlike search_docs (which is always case-insensitive and capped at limit 20), this tool defaults to case-sensitive matching and returns up to limit matches (default 50, max 200). Prefer this over search_docs when you know the exact title and want every match. Returns: { query, caseInsensitive, matches: [{ id, title, createdAt, updatedAt, inTrash }], workspaceDocCount, truncated }.

list_tagsA

List all workspace-level tags and the number of documents attached to each tag. Use this before tag mutation when the exact tag name or id is unknown.

list_docs_by_tagB

List documents that contain the requested tag. This is read-only and each result includes title metadata and an inTrash flag.

create_tagA

Create a workspace-level tag entry for future reuse. This does not attach the tag to a document; use add_tag_to_doc for that.

add_tag_to_docA

Attach a workspace tag to a document, creating the workspace tag option if needed. Document tags are stored in workspace metadata.

remove_tag_from_docA

Detach a tag from one document without deleting the workspace-level tag. Use delete_tag only when the tag should be removed from every document.

delete_tagA

Delete a workspace-level tag and remove it from every document that references it. Accepts a tag id or name; an ambiguous name is rejected with the candidate ids.

get_docA

Read GraphQL metadata for one document, such as title, summary, public state, roles, and timestamps. Use read_doc when you need block content.

read_docA

Read document block content and its revision via WebSocket snapshot. Pass revision as expectedRevision on a document write to reject stale edits through a shared MCP server. Each block includes plain text and formatting-preserving deltas. Set includeMarkdown: true to also get rendered markdown, which can be lossy for unsupported inline attributes.

get_capabilitiesA

Return machine-readable capability flags for this MCP server, including static feature support and the effective enabled tool surface.

analyze_doc_fidelityA

Inspect a document for markdown export fidelity risk, including unsupported AFFiNE block flavours and risky content paths.

move_docA

Move a doc in the AFFiNE sidebar. The destination link is validated and added before the optional source link is removed, cycles are rejected, and partial outcomes are reported explicitly.

publish_docA

Make a document publicly accessible through AFFiNE public sharing. This changes sharing state; use revoke_doc to disable public access later.

revoke_docA

Disable public sharing for a document without deleting the document. Use delete_doc only when the document itself should be removed.

create_docA

Create a new AFFiNE document with optional plain-text content stored as one paragraph. Use create_doc_from_markdown for native headings, lists, links, and code blocks. If parentDocId is provided, the new doc is linked into the sidebar tree immediately. If folderId is provided, the doc is placed inside that folder in the sidebar.

create_semantic_pageC

Create an AFFiNE-native page with intentional section structure and native block composition.

append_semantic_sectionB

Append a semantic section to an existing AFFiNE document by heading title and native block composition.

append_blockC

Append document blocks with canonical types and legacy aliases (supports placement + strict validation).

export_doc_markdownC

Export AFFiNE document content to markdown.

export_with_fidelity_reportA

Export document markdown together with a structured fidelity report that highlights markdown loss risk and unsupported AFFiNE-native content.

create_doc_from_markdownA

Create a new AFFiNE document and import Markdown as native blocks, including $$...$$ equation blocks and $...$ inline equations. Use parentDocId to embed the new doc into a parent, or folderId to place it in an organize folder.

append_markdownB

Append markdown content to an existing AFFiNE document. $$...$$ and $...$ become native equations.

replace_doc_with_markdownA

Replace the main note content of a document with markdown content.

trash_docA

Move a document to the AFFiNE trash without deleting its content. This is recoverable with restore_doc and safe to retry.

restore_docA

Restore a document from the AFFiNE trash without changing its content. This is safe to retry.

delete_docA

Remove a document from the workspace list and request content deletion. AFFiNE servers may acknowledge this request while retaining readable content that still syncs. Content deletion is reported only after absence is verified; otherwise the result is partial with a warning. This is destructive; use trash_doc for recoverable cleanup or revoke_doc to remove public access.

list_workspace_treeA

Returns the full document hierarchy as a tree (roots → children → grandchildren). Use depth to limit nesting (default: 3). Note: loads all docs — may be slow on large workspaces. Each node includes an inTrash flag.

get_orphan_docsA

Find all documents that have no parent (not linked from any other doc via embed_linked_doc / embed_synced_doc blocks or inline LinkedPage references). Useful for workspace hygiene. Note: scans all docs — O(n). Each doc includes an inTrash flag.

list_childrenA

List the direct children of a document in the sidebar (embed_linked_doc / embed_synced_doc blocks and inline LinkedPage references). Returns docId, title, URL, and inTrash for each child.

update_doc_titleA

Rename a document — updates both the sidebar title (workspace metadata) and the doc's internal page block title.

inspect_template_structureA

Inspect a template doc's native structure, tags, and fallback risk before instantiation.

instantiate_template_nativeB

Instantiate a template using native AFFiNE block cloning when supported, falling back to markdown materialization only when necessary.

add_database_rowA

Add a row to an AFFiNE database block. Provide cell values mapped by column name or column ID. Title column text is stored on the row paragraph block. Select columns auto-create options by label.

delete_database_rowB

Delete a row from an AFFiNE database block.

read_database_cellsA

Read row titles and database cell values from an AFFiNE database block. Rich-text titles and cells include both plain values and formatting-preserving deltas.

read_database_columnsA

Read schema metadata for an AFFiNE database block, including columns, select options, and view column mappings. Useful for empty databases before any rows exist.

update_database_rowA

Batch update multiple cells on an existing AFFiNE database row. Include title in the cells map to update the Kanban row title.

compose_database_from_intentB

Create a useful AFFiNE database/data-view from declarative intent. Supports task_board and issue_tracker presets with starter schema, kanban view, and optional starter rows.

add_database_columnA

Add a column to an existing AFFiNE database block. Supports title, rich-text, select, multi-select, number, checkbox, link, and date types. A title addition is rejected when the current database snapshot already has a title column.

add_surface_elementA

Add a shape, connector, text, or group to the AFFiNE edgeless canvas surface. Shapes support rect/ellipse/diamond/triangle with fill, stroke, and text. Connectors draw arrows between shapes (by id) or between absolute points. Use for building diagrams programmatically. Style fields that don't apply to the chosen element type are reported in the response 'ignored' list (mirrors update_surface_element).

list_surface_elementsA

List all shape/connector/text/group elements on the AFFiNE edgeless canvas surface. Returns raw xywh strings plus parsed {x,y,width,height} bounds, with Y.Text fields serialized to plain strings. Optional filters by element type or id.

update_surface_elementA

Partially update a surface element by id. x/y/width/height merge with the element's current xywh (move without resizing, or vice versa). text/label/title replace their Y.Text wholesale. Fields that don't apply to the element's type are reported in the response 'ignored' list.

delete_surface_elementA

Delete a surface element by id. Set pruneConnectors=true to also delete any connectors whose source or target referenced the deleted element.

update_frame_childrenA

Replace a frame block's contents wholesale. Accepts ids of surface elements (shapes/connectors/groups) AND edgeless blocks (notes/frames/edgeless-text) — all go into BlockSuite's prop:childElementIds map, matching what the editor writes when you drag members into a frame. Dragging the frame drags every owned member. Ids that don't resolve come back under 'missing'. By default the frame is resized to fit its new contents (plus padding + title band); set resizeToFit=false to leave xywh untouched. Pass [] to clear ownership (resize is skipped in that case).

update_edgeless_blockA

Partially update a note/frame/edgeless-text block by id. x/y/width/height merge with current prop:xywh (move without resizing, or vice versa). background replaces prop:background (AFFiNE token or {light, dark} hex object). Fields that don't apply to the block's flavour come back under ignored.

update_blockA

Partially update one paragraph, heading, quote, list, or code block while preserving its block id. Omitted fields remain unchanged. Paragraph/heading/quote conversions preserve ids; cross-flavour conversions are rejected.

update_table_cellA

Replace one cell in an AFFiNE table by zero-based row and column while preserving rich-text attributes and the table's header bold formatting.

update_table_column_widthsA

Set every column width in an AFFiNE table while preserving rows and cell content. Pass null for a column to restore AFFiNE's automatic width.

move_blockA

Move an existing block without changing its id. Reuses append_block placement semantics and rejects document-root moves and cycles.

delete_blockA

Delete a block by id and return snapshots of the removed content. Removes descendants and unlinks from the parent's sys:children by default; set deleteChildren=false to keep descendants orphaned (for re-parenting), or pruneConnectors=true to also drop surface connectors referencing any deleted id. Refuses affine:page — use delete_doc for whole docs.

get_edgeless_canvasA

Read the full edgeless canvas: all edgeless-positioned blocks (notes, frames, edgeless-text) with their xywh, plus all surface elements (shapes, connectors, text, groups). Includes aggregate bounding box and per-type element counts. Use this when you need to understand canvas layout end-to-end before placing new elements.

list_commentsA

List paginated comments for a document, including nested replies and resolution state. Use this before update_comment, delete_comment, or resolve_comment when you need the existing comment ids.

create_commentA

Create a new comment on an existing document. This writes collaboration state; use update_comment when editing an existing comment instead.

update_commentA

Replace the content of an existing comment. This preserves the comment thread; use create_comment for a new thread.

delete_commentA

Delete an existing comment by id. This is destructive for that comment; use resolve_comment when you only want to mark a thread resolved.

resolve_commentA

Set a comment thread's resolved state without changing its content. Use delete_comment only when the comment should be removed.

list_historiesC

List doc histories (timestamps) for a doc.

list_collectionsA

List AFFiNE sidebar collections and their rules. Use this read-only tool before updating, deleting, or adding documents to a collection.

get_collectionA

Read one AFFiNE sidebar collection by id, including rules and allow-list. Use list_collections first when the id is unknown.

create_collectionB

Create a new AFFiNE sidebar collection with optional rules. This writes workspace sidebar metadata but does not create documents.

update_collection_rulesA

Replace an AFFiNE collection's rules and rebuild its allow-list from current workspace documents. This can change which docs appear in the collection.

update_collectionA

Rename an existing AFFiNE sidebar collection without changing its rules or allow-list.

delete_collectionA

Delete an AFFiNE sidebar collection. This removes the collection metadata but does not delete the documents it referenced.

add_doc_to_collectionA

Add an existing document id to an AFFiNE collection allow-list. Use update_collection_rules instead when membership should be rule-driven.

remove_doc_from_collectionA

Remove a document id from an AFFiNE collection allow-list. This does not delete the document or change collection rules.

list_organize_nodesA

Experimental: list AFFiNE sidebar organize folder and link nodes from the folders workspace DB. Use this before moving or deleting organize nodes.

create_folderA

Experimental: create an AFFiNE organize folder node in the sidebar tree. This only changes sidebar organization, not document content.

create_workspace_blueprintA

Create a simple AFFiNE organize folder blueprint with one root folder and optional child folders. This is a convenience wrapper around create_folder.

rename_folderA

Experimental: rename an AFFiNE organize folder node. This changes sidebar metadata only and does not rename documents inside the folder.

delete_folderA

Experimental: delete an AFFiNE organize folder and every nested folder or link node. This is destructive for sidebar organization but does not delete target documents, tags, or collections.

move_organize_nodeA

Experimental: move an AFFiNE organize folder or link node to another folder or root. This preserves the target document, tag, or collection and changes only sidebar placement.

add_organize_linkA

Experimental: add a doc, tag, or collection link under an AFFiNE organize folder. Use move_organize_node for an existing link node instead of creating a duplicate link.

delete_organize_linkA

Experimental: delete an AFFiNE organize doc, tag, or collection link node. This removes only the sidebar link, not the target resource.

set_doc_journalA

Set or clear AFFiNE's native Journal date for a document. Use YYYY-MM-DD or null to remove it; customJournal and custom properties are preserved.

list_doc_propertiesA

List native workspace custom-property definitions and document values. Set includeLegacy to read older unscoped data separately for recovery; this never migrates or writes data.

create_custom_propertyB

Create a workspace-wide custom property definition (text, number, checkbox, or date). Returns its propertyId.

delete_custom_propertyA

Soft-delete a workspace custom property definition (by propertyId or name). Existing values are hidden.

set_doc_propertyB

Set a document's custom property value (property by id or name). Value is validated against the property type (text/number/checkbox/date).

clear_doc_propertyB

Remove a custom property value from a document (property by id or name).

update_doc_iconA

Set or clear the sidebar icon (the Notion-style emoji slot) on a document. Pass an emoji string, a full icon object, or null to remove it.

update_folder_iconA

Set or clear the sidebar icon on an organize folder. Pass an emoji string, a full icon object, or null to remove it. Experimental.

get_doc_iconA

Read the current sidebar icon of a document. Returns null when none is set.

get_folder_iconB

Read the current sidebar icon of an organize folder. Returns null when none is set. Experimental.

current_userA

Return the currently authenticated AFFiNE user profile. Use this read-only check to verify credentials before workspace or document operations.

update_profileA

Update current user's profile information. Requires at least one of name or avatarUrl.

update_settingsC

Update user settings and preferences.

sign_inA

Sign in to AFFiNE using email and password; sets session cookies for subsequent calls.

upload_blobA

Upload a file or blob into AFFiNE workspace storage and return its blob key. This creates stored content but does not attach it to a document by itself.

delete_blobA

Delete a blob from AFFiNE workspace storage. Set permanently only when the blob should bypass recoverable deletion.

cleanup_blobsA

Permanently release blobs that were already marked deleted in a workspace. This is destructive cleanup and should be used only after confirming deleted blobs are no longer needed.

list_notificationsA

List one server page of current-user AFFiNE notifications in a stable envelope. The response preserves each edge cursor, server pageInfo, and serverTotalCount. unreadOnly is a client-side filter over only the fetched page; it does not change server counts or pageInfo.

read_all_notificationsB

Ask AFFiNE to mark every current-user notification as read. Inspect applied/status in the response; a false server result is reported as not_applied, not as success.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.2/5.0

Scored across 107 tools

Disambiguation3/5

The tool set covers many adjacent operations, and several groups overlap heavily: list_docs/search_docs/find_doc_by_title, get_doc/read_doc, create_doc/create_doc_from_markdown/create_semantic_page, and append_block/append_markdown/append_semantic_section. The descriptions usually explain the boundaries, so misselection is avoidable, but the sheer number of similar choices makes the set confusing in practice.

Naming Consistency4/5

Almost all tools use snake_case with a verb_noun pattern, such as list_workspaces, create_doc, update_surface_element, and delete_comment. The main deviation is current_user, and there are minor verb variations like get/read/list, but the overall convention is predictable.

Tool Count1/5

107 tools are far beyond an appropriate MCP surface and create severe navigation and selection overhead. Even though AFFiNE is a broad product, this set would benefit from consolidation and grouping rather than exposing nearly every operation individually.

Completeness4/5

Coverage is very broad across workspaces, docs, blocks, canvas, databases, mindmaps, tags, collections, folders, comments, properties, and blobs. There are still notable lifecycle gaps, such as database column update/delete, mindmap node deletion, blob listing/retrieval, and explicit comment replies.

Maintenance

ActivityMaintained
ResponsivenessNo issues