Connect an AI assistant (MCP)

Let Claude, Cursor, VS Code or any assistant that speaks the Model Context Protocol search, read and write your notebook. Setup is one address and a sign-in.

Your notebook needs to be connected to a GitHub repository. A notebook that lives only in this browser is not somewhere an assistant can reach. For a model beside the note you are writing rather than an assistant working on the notebook from outside, see the assistant panel.

Connect in one step

In the editor, open All tools → Connect an AI assistant (or type /connect) for these steps with your address filled in and copy buttons. Every assistant uses the same address:

MCP server address
https://forkleaf.vercel.app/api/mcp

Claude Code

Terminal
claude mcp add --transport http forkleaf https://forkleaf.vercel.app/api/mcp

Then type /mcp in Claude Code, choose forkleaf and Authenticate.

Claude Desktop and claude.ai

Settings → Connectors → Add custom connector. Name it ForkLeaf, paste the address, press Add, then Connect.

Cursor

~/.cursor/mcp.json
{
  "mcpServers": {
    "forkleaf": { "url": "https://forkleaf.vercel.app/api/mcp" }
  }
}

VS Code

.vscode/mcp.json
{
  "servers": {
    "forkleaf": { "type": "http", "url": "https://forkleaf.vercel.app/api/mcp" }
  }
}

What happens next

  1. The assistant opens a ForkLeaf page in your browser. Sign in with GitHub if asked.
  2. Choose its default repository — optionally a folder and a branch — and tick Read only if it should not write. Also let it use my other repositories is ticked to begin with: untick it to keep the assistant to that one repository.
  3. Press Allow. GitHub confirms, and you are sent back to the assistant.

There is no token to create and nothing to install. The assistant keeps its own sign-in and renews it; ForkLeaf stores nothing about the connection.

What the assistant gets

ToolWhat it does
list_repositoriesThe repositories it can use, and the default
search_notesFull-text search across every note
list_notesThe notes in the notebook, or in one folder
read_noteOne note in full, with the notes that link to it
write_noteCreate a note, or replace one, as a single commit
append_to_daily_noteAdd to today's journal/YYYY-MM-DD.md

Every tool works on the default repository unless you name another — “add this to my work repository” or “in ada/handbook, update the onboarding note”.

Where its notes go

  • Next to related notes, in a folder that already exists — or in inbox/ when you did not say where, the same folder Save to ForkLeaf uses.
  • It will not make up a new folder unless you ask for one. Asked to write to a folder that does not exist, the tool refuses and lists the folders there are.
  • After every write it tells you the repository, the full path and a link to the note, and the commit says it came from an assistant.

Try asking: “What did I write about the launch plan?”, “Add today’s meeting notes to my daily note”, or “Summarise everything tagged research into a new note.”

What it will not do

  • Touch anything but .md and .mdx notes, or anything in a hidden folder like .github.
  • Use a repository other than the default unless you allowed it, and you name it. Inside the default repository it stays in the folder you chose.
  • Make up a folder for a new note.
  • Write at all, if you ticked Read only.
  • Read or overwrite an encrypted note. It has no passphrase, so it says the note is encrypted and leaves it alone.

Disconnecting

Remove the server in the assistant. To cut off every assistant at once, revoke ForkLeaf at GitHub → Settings → Applications — this signs ForkLeaf out in your browsers too.

If it does not connect

  • The browser page says the link is not valid: start connecting again from the assistant; each sign-in link is good for ten minutes.
  • “could not be read … connect again”: the repository was renamed, deleted, or access to it was removed. Remove the server and add it again.
  • It asks to sign in again after months: GitHub’s sign-in lasts six months without use. Authenticate again from the assistant.

Advanced: run the server yourself

packages/mcp is the same set of tools as a local server, for assistants that only run commands, or for keeping the connection off ForkLeaf entirely. It needs Node.js 20+, a clone of the repository with pnpm install, and a fine-grained token limited to your notes repository with Contents: Read and write:

Terminal
claude mcp add forkleaf \
  --env FORKLEAF_GITHUB_TOKEN=github_pat_... \
  --env FORKLEAF_REPO=you/notes \
  -- pnpm --silent --dir /path/to/ForkLeaf/packages/mcp start

FORKLEAF_BRANCH, FORKLEAF_DIR and FORKLEAF_READ_ONLY=true are optional. Details in the package’s README.