MCP integration

AFFiNE MCP Server: connect AI tools to your knowledge base

AFFiNE’s workspace MCP endpoint lets compatible AI clients search your notes and whiteboard text and read documents using a revocable credential. Connect directly with Streamable HTTP and Bearer-header support, or use a local stdio bridge when your client supports one.

  • Workspace-scoped, revocable credentials
  • Streamable HTTP + Bearer
  • 70K+ GitHub stars

Connect your knowledge base to a compatible AI client

MCP is an open standard for connecting AI assistants to tools and data. AFFiNE includes a workspace endpoint on supported Cloud and self-hosted instances. Direct connections need Streamable HTTP and a custom Authorization header; a stdio-only desktop client needs a local bridge such as mcp-remote.

Once connected, an assistant can run keyword and semantic search across your knowledge base, whiteboards included, and read full documents, with exactly the permissions you grant and nothing more. Each client gets its own credential that you can rotate or revoke independently, so "my AI can see my notes" never has to mean "everything, forever".

AFFiNE MCP Server at a glance

What it isThe official Model Context Protocol endpoint built into AFFiNE Cloud and self-hosted instances
EndpointPOST /api/workspaces/{workspace-id}/mcp
TransportStreamable HTTP, stateless
AuthBearer credential (aff_mcp_v1. prefix), created per client in workspace settings
Toolsdoc_search / read_document; READ_WRITE: development / canary
ScopeOne workspace per credential, honoring your document permissions
PriceFree on AFFiNE Cloud and self-hosted instances with AI features enabled

Workspace connection or public content demo?

Your workspace

On AFFiNE Cloud or your own supported instance. Requires your workspace Bearer credential and honors document permissions. The tools below are the read-only defaults; availability depends on the deployment.

https://app.affine.pro/api/workspaces/{workspace-id}/mcp
  • doc_search
  • read_document

Public website content

A separate read-only service for published AFFiNE blog articles and templates. No account or credential is needed. It cannot read your workspace or write documents; never send your workspace credential to this endpoint.

https://affine.pro/api/public/mcp
  • search_public_content
  • read_public_content
Public content API

Connect a compatible MCP client

Create a workspace credential in AFFiNE, then configure the intended client using its own transport format.

  1. Open your workspace's MCP settings

    In AFFiNE, go to Settings, then Integrations, then MCP Server. This works on AFFiNE Cloud and on self-hosted instances with AI features enabled.

  2. Create a credential

    Click 'Create credential', give it a label (one per client, for example 'Claude Code' or 'Cursor'), then choose the access mode and an expiry. Read only is the default.

  3. Copy the configuration into your client

    Copy the endpoint and credential from AFFiNE. The token is shown once. Use the matching client example below rather than assuming every client accepts the same JSON.

{
"mcpServers": {
"affine_workspace_<workspace-id>": {
"type": "streamable-http",
"url": "https://app.affine.pro/api/workspaces/<workspace-id>/mcp",
"headers": { "Authorization": "Bearer aff_mcp_v1...." }
}
}
}

AFFiNE’s generated connection format. Adapt it to your client; self-hosted instances use their own server address.

Client-by-client setup

Check both transport and authentication support. Claude Code, Cursor and Cline accept remote HTTP connections with a Bearer header. A client that only accepts OAuth sign-in cannot use this manually provisioned credential through that flow. A local stdio bridge is an option only if the client can launch local processes.

Claude Code

Add AFFiNE with one CLI command, then ask Claude to search or read your workspace from any session.

claude mcp add --transport http affine \
"https://app.affine.pro/api/workspaces/<workspace-id>/mcp" \
--header "Authorization: Bearer <your-credential>"

Cursor

Add the URL and headers shown below to ~/.cursor/mcp.json. Use the endpoint and credential copied from your own workspace; client configuration formats differ.

{
"mcpServers": {
"affine": {
"url": "https://app.affine.pro/api/workspaces/<id>/mcp",
"headers": {
"Authorization": "Bearer <your-credential>"
}
}
}
}

Cline

Open Cline's MCP settings and add AFFiNE as a remote streamable HTTP server.

{
"mcpServers": {
"affine": {
"type": "streamableHttp",
"url": "https://app.affine.pro/api/workspaces/<id>/mcp",
"headers": {
"Authorization": "Bearer <your-credential>"
}
}
}
}

Local stdio clients, including Claude Desktop

For a client that can launch local stdio processes, this configuration runs the third-party mcp-remote bridge. Install a supported Node.js runtime and follow the bridge documentation. This is not a Claude web OAuth connector.

{
"mcpServers": {
"affine": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://app.affine.pro/api/workspaces/<workspace-id>/mcp",
"--header",
"Authorization:${AFFINE_MCP_AUTH}"
],
"env": {
"AFFINE_MCP_AUTH": "Bearer <your-credential>"
}
}
}
}

What a connected assistant can do

Read only is the default. The implementation reviewed on October 26, 2026 restricts read-write credential creation and write tools to development or canary deployments. This does not establish stable Cloud availability. Check your instance’s access-mode settings and tools/list before relying on writes.

Read only

Default
doc_search
Document search

Keyword and semantic search across workspace documents, returning bounded passages with page or canvas locators. Never files, blobs or the web.

read_document
Read document

Fetch the full content of a document by ID, respecting your current workspace permissions.

Read and write

Development / canary
create_document
Create document

Where enabled, create a document from a title and Markdown body. Database-block and image insertion are not supported by this tool.

update_document
Update document

Where enabled, update the Markdown body using structural diffing. This does not change the title or support database-block or image updates.

update_document_meta
Update document metadata

Where enabled, update a document’s title. Other metadata fields are not exposed by the inspected tool.

Workspace-scoped

A credential only ever reaches one workspace, with your permissions.

One credential per client

Revoke any client's access without touching the others.

Expiry built in

Every credential gets an expiry date when you create it.

Token rotation

After rotation, the old token works for up to 24 hours, or until its existing expiry if sooner. Revocation can end access earlier.

How AFFiNE's MCP server compares

Plenty of note-taking tools speak MCP now. What differs is what the server can reach, where it runs, and who controls it. Here is how AFFiNE's built-in server compares with the two setups people ask about most.

AFFiNENotion MCPObsidian
Built in, first-partyYesFirst-party, built into the app; credentials created in workspace settingsYesOfficial remote server, hosted by NotionNoCommunity plugins or third-party servers
Self-hostable endpointYesSame official endpoint; enable AI features on your instanceNoCurrent server is hosted only; a deprecated open-source predecessor can self-hostDependsLocalhost by default, remote is DIY
Whiteboard searchYesSearch indexes Edgeless canvas text and returns element and frame locatorsNoNotion has no native whiteboardNo.canvas files readable only as raw JSON; no mainstream server searches them
Deployment modelCloud or self-hostedOfficial endpoint built into AFFiNE; AI features must be enabled when self-hostingHosted onlyCurrent official server is hosted by NotionLocalCommunity plugins or third-party servers run beside the desktop vault
PriceFreeFree on Cloud and self-hosted instances with AI features enabledFree coreConnected-app search and meeting notes need Notion AI plansFreeBoth the app and community servers

Comparison reflects publicly documented capabilities as of August 2026.

Obsidian's REST-API-based MCP servers require the desktop app to be running. Obsidian's CLI (2026) is an official automation surface, but it is not MCP.

Frequently asked questions

What is the AFFiNE MCP server?

It is the official Model Context Protocol endpoint built into AFFiNE. It lets AI assistants such as Claude, Cursor and Cline search and read the documents in one of your AFFiNE workspaces over a standard, authenticated HTTP connection, using credentials you create and control in workspace settings.

Is the AFFiNE MCP server read-only?

Read only is the default. The implementation reviewed on October 26, 2026 restricts read-write credential creation and write tools to development or canary deployments. This does not establish stable Cloud availability. Check your instance’s access-mode settings and tools/list before relying on writes.

Does the MCP server work with self-hosted AFFiNE?

Yes. The official MCP endpoint is available on self-hosted AFFiNE instances. On a self-hosted instance the endpoint lives on your own server address, and setup is identical: Settings, Integrations, MCP Server. AI features need to be enabled on the instance.

How is access secured?

A credential only ever reaches one workspace, with your permissions. Revoke any client's access without touching the others. Every credential gets an expiry date when you create it. After rotation, the old token works for up to 24 hours, or until its existing expiry if sooner. Revocation can end access earlier.

Which AI tools can connect to AFFiNE?

Check both transport and authentication support. Claude Code, Cursor and Cline accept remote HTTP connections with a Bearer header. A client that only accepts OAuth sign-in cannot use this manually provisioned credential through that flow. A local stdio bridge is an option only if the client can launch local processes.

Can a connected AI search my whiteboards?

Yes. doc_search covers page documents and Edgeless whiteboards alike: text on the canvas is indexed, and results carry block, element or frame locators, so an assistant can point at exactly where on a whiteboard an answer lives. Full-document reads return page content; whiteboard content surfaces through search. Most note-taking MCP servers only see plain documents.

Why connect my notes to an AI assistant?

Grounding. An assistant that can search your actual notes answers from your knowledge: meeting decisions, project context, research. Because AFFiNE's server returns bounded passages with document locators, assistants can also cite exactly where an answer came from.

Put your knowledge base to work

Create a credential in your workspace settings and your AI tools can start answering from your own notes today.

Last updated: October 26, 2026