Skip to main content
Glama
Second Brain MCP

Second Brain MCP

by YudiG12

A remote MCP server that gives every AI client the same Markdown notes: Claude Code on the Mac, Claude on the web and phone, ChatGPT. Search by keyword or by meaning; every change is a Git commit. Deploy your own on Cloudflare.

Deploy your own

Each deployment serves one person: your notes, your Cloudflare account, and only your GitHub account can sign in. You need a Cloudflare account on the Workers Paid plan, Node 24 or later, and a GitHub account.

  1. Fork and install. npm ci, then npx wrangler login.

  2. Point it at your account. Everything that changes per deployment is in wrangler.jsonc: name, account_id, and in vars PUBLIC_URL (https://<name>.<your-subdomain>.workers.dev), CF_ACCOUNT_ID (same as account_id) and OWNER_GITHUB_ID (your numeric GitHub id: gh api user --jq .id). The scripts and CI read it from there (scripts/config.mjs; node scripts/config.mjs check validates it). Then npm run types.

  3. Create a GitHub OAuth app (Settings → Developer settings → OAuth Apps) with the callback <PUBLIC_URL>/callback. Put its client id in GITHUB_CLIENT_ID.

  4. Create the resources. scripts/setup.sh creates the Vectorize index, the Artifacts repository, the D1 database, the queues and the push subscription. It is safe to run again: when it creates the D1 database or the KV namespace it stops and asks you to copy the printed id into wrangler.jsonc, then run it again.

  5. Add your notes. Push your Markdown notes (at least one commit) to the Artifacts repository before the first deploy; the setup guide has the token command.

  6. Deploy and set secrets. npx wrangler deploy, then scripts/secrets.sh github-oauth and scripts/secrets.sh admin.

  7. Build the index. POST <PUBLIC_URL>/admin/reconcile?mode=rebuild with Authorization: Bearer <ADMIN_SECRET>.

  8. Optional, a Mac clone. scripts/secrets.sh hook, then follow clients/claude-code: link the hook, write ~/.config/second-brain/hook.env with your NOTES_DIR and SECOND_BRAIN_URL, and add the hooks to your Claude Code settings.

Every command, in order: docs/setup.md.

Related MCP server: 50 First Tapes MCP Server

How to use

Add your server as a remote MCP connector in each client, then sign in with GitHub on the consent page. The address is your PUBLIC_URL plus /mcp:

Client

Where

Claude (web, desktop, phone)

Settings → Connectors → Add custom connector

ChatGPT

Settings → Connectors → Create (developer mode)

Claude Code

claude mcp add --transport http second-brain <PUBLIC_URL>/mcp

Then just ask. The client picks the tool:

You ask

Tool

"What did I decide about the Acme proposal?"

search_notes (keyword + meaning)

"Save this idea: …"

save_idea

"Read projects/acme.md"

read_note, list_notes

"In the plan note, change the deadline to Friday"

edit_note (also write_note, move_note, delete_note)

Each client gets its own grant, which expires and can be revoked (SECURITY.md).

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI clients to incrementally build and maintain a git-backed personal wiki, providing long-term memory by compiling and cross-referencing knowledge across sessions.
    2
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Lets AI agents from any machine list, read, search, write, edit, move and link markdown pages and store files alongside them, all in a shared wiki. People can then see what the agents know through a web app showing the link graph, every page, and the history of who changed what.
    16
    8
    AGPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables multiple AI agents to share a locally controlled long-term knowledge base of Markdown notes, allowing them to retrieve, add, update, and remove preferences, decisions, and experiences. It supports cross-agent recall and version-aware changes while keeping the notes readable and editable outside the agent.
    MIT