# One MCP Server That Gives Notion AI and Cloud Agents Your Memory

Notion AI MCP server pattern for a personal markdown knowledge base: read-only search and read tools, OAuth, warm-cache latency, and a stale-copy lesson.

Topic: Claude & MCP
Published: 2026-11-16
URL: https://productivitytech.io/mcp-server-ai-memory/

*Disclosure: this article contains affiliate links to Wispr Flow. If you subscribe through them, I earn a commission at no extra cost to you. Nobody at Wispr reviewed this article before publication.*

## Short answer

A **Notion AI MCP server** for personal memory is a small, hosted, read-only MCP process over the same markdown knowledge base local Claude Code already reads from disk. The tools are search, then read a file or a section. Put it behind OAuth so Notion AI Custom Agents, claude.ai custom connectors, and Claude Code cloud sessions can authenticate without embedding a long-lived secret in every client. That is the one door those surfaces share when they cannot open the private repo themselves.

👉 [**Use this template on GitHub**](https://github.com/Sinfjell/personal-memory-template) — click *Use this template*, make the copy private, run `/setup`. Star the repo if it helps you keep the pattern around. Product page: [/products/personal-memory-template/](/products/personal-memory-template/).

When I write longer prompts for Claude, I dictate them with [Wispr Flow](/claude-code-voice-vs-wispr-flow/) — same habit as in my [Wispr Flow review](/wispr-flow-review/). <a href="/go/wispr/?position=mcp-memory-top&via=md&from=%2Fmcp-server-ai-memory%2F" rel="sponsored nofollow noopener" data-cta-product="wispr-flow" data-cta-location="mcp-memory-top">Try Wispr Flow’s free plan</a> if you want to test that workflow.

## The problem: local agents read the repo, cloud tools can’t

The knowledge base is a private git repo of markdown: index, clients, engineering notes, playbooks. Local Claude Code opens that folder and follows the same rules as in [Claude Code memory lessons](/claude-code-memory-lessons/), [CLAUDE.md too long](/claude-md-too-long/), and the [auto-memory load window](/claude-code-auto-memory-limit/).

Notion AI, claude.ai, and Claude Code cloud sessions sit somewhere else. In my setup the cloud sessions couldn’t clone my private memory repo, so they had no disk path into those files. Pasting excerpts by hand does not scale. Uploading the whole wiki into a project is a second copy that drifts. I needed one protocol surface those clients already speak: remote MCP.

This article is about exposing a personal markdown memory. For building MCP servers in general, see [build an MCP server](/build-mcp-server-tutorial/) and [custom MCP server lessons](/custom-mcp-server-lessons/).

## The design: read-only search, then read a section

Two tool kinds. Search returns ranked file paths (and short snippets) for a question. A follow-up tool reads one file, or one named section inside a file, so the model does not pull an entire long note when it only needs the current-state heading for Example Client.

Why read-only: the markdown repo remains the source of truth. Writes belong in the usual git workflow (and skills like ingest in the [LLM wiki template](/llm-wiki-template-claude-code/)), not through a connector that Notion AI or claude.ai might call mid-chat. The MCP schema documents a `readOnlyHint` annotation for tools that do not modify their environment ([ToolAnnotations in the 2025-11-25 schema](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.json)); clients must still treat annotations from untrusted servers as untrusted.

Illustrative TypeScript sketch (not production code; placeholder host; official MCP SDK shape):

```ts
// Illustrative only — placeholder names, not a real server.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const server = new McpServer({ name: "personal-memory", version: "0.1.0" });

server.registerTool(
  "search_memory",
  {
    description: "Search the markdown knowledge base; return top paths.",
    inputSchema: { query: z.string() },
    annotations: { readOnlyHint: true },
  },
  async ({ query }) => {
    // Look up query in a local index of the synced repo copy…
    return { content: [{ type: "text", text: JSON.stringify([]) }] };
  },
);

server.registerTool(
  "read_section",
  {
    description: "Read one file, or one ## heading section, from the wiki.",
    inputSchema: {
      path: z.string(),
      heading: z.string().optional(),
    },
    annotations: { readOnlyHint: true },
  },
  async ({ path, heading }) => {
    // Read clients/acme.md or a single section…
    return { content: [{ type: "text", text: "" }] };
  },
);

// Serve over HTTPS at https://memory.example.com/mcp (placeholder).
```

Keep the tool count small — the same lesson as in [custom MCP server lessons](/custom-mcp-server-lessons/): a few sharp tools beat a sprawling CRUD surface.

## OAuth so Notion AI, claude.ai, and cloud sessions can connect

Remote clients need a way to prove who is calling. The MCP [authorization specification](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization) (checked 16 November 2026) defines HTTP transport authorization based on OAuth 2.1: the MCP server is a resource server, clients obtain access tokens from an authorization server, and Protected Resource Metadata advertises where to authenticate.

That matches how the hosted clients describe sign-in. Anthropic’s [custom connectors with remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) guide (checked 16 November 2026) walks through adding a remote URL and choosing OAuth (“Sign in now” / “Sign in when needed”). Notion’s [MCP connections for Custom Agents](https://www.notion.com/help/mcp-connections-for-custom-agents) page (checked 16 November 2026) lists OAuth and header-based auth for custom servers.

High level only here: put the memory server behind OAuth, do not ship a shared bearer token to every chat product, and follow the build notes in [build an MCP server](/build-mcp-server-tutorial/) when you implement the flow.

## Making it fast enough

Search latency matters because the agent often searches before it reads. In my setup, with a warm cache, search is about **60 ms** (before the cache work it was **140–360 ms**). Reading one section is about **25 ms**.

Search quality is the other half. On the **20**-question recall test in the [October 2026 audit](/claude-code-memory-lessons/), finding the right file in the top 3 went from **50%** to **85%** (Recall@3). Those numbers are for my knowledge base and indexing approach, not a promise about every repo.

## The stale-copy lesson: automate and measure sync

The server does not edit the live working tree on my laptop. It serves a copy of the repo. That copy once sat **four weeks** stale without anyone noticing.

The fix pattern is boring on purpose: sync must be **automated** and **measured**. Expose the last-synced commit and time (or an equivalent freshness signal) and check it on a schedule so silence cannot mean “still current.” Do not treat a successful OAuth handshake as proof the markdown is fresh.

## Connecting it: Notion AI, claude.ai, Claude Code cloud

Only what the public docs confirm (checked 16 November 2026):

**Notion AI / Custom Agents.** Notion’s help article [MCP connections for Custom Agents](https://www.notion.com/help/mcp-connections-for-custom-agents) says MCP connections are available on **Business and Enterprise** plans. Custom remote MCP servers use a public URL; a workspace admin must enable custom MCP servers under Settings → Connections. Agents add the server under Tools & Access → Custom MCP server, with OAuth or header-based auth. A related guide describes the same admin gate under Settings → Notion AI → AI connectors ([Connect Custom Agents to MCP integrations](https://www.notion.com/help/guides/connect-custom-agents-to-mcp-integrations)).

**claude.ai.** [Get started with custom connectors using remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) says custom connectors using remote MCP are available on Free, Pro, Max, Ultra, Team, and Enterprise (Free is limited to one custom connector). Claude reaches the server from Anthropic’s cloud over HTTPS on port 443 — the host must be publicly reachable. Add the connector under Customize → Connectors (Owners add it first on Team/Enterprise).

**Claude Code cloud.** [Connect to MCP servers](https://code.claude.com/docs/en/mcp-quickstart) says cloud sessions outside a project’s threads can load MCP from a committed `.mcp.json` in a single-repository session, and cloud threads in a project use your claude.ai connectors. [Configure cloud environments](https://code.claude.com/docs/en/cloud-environments) adds that MCP connector traffic goes through Anthropic’s servers (not the session network allowlist), and that cloud sessions start from a fresh clone of the session repository — local-only MCP config does not travel with you. That is why a remote memory connector mattered in my setup when the private wiki was not the repo the cloud session cloned.

For a broader Notion task system next to the wiki, see [GTD Notion setup for 2026](/gtd-notion-setup-2026/).

## Where this fits in the series

1. Hub: [7 failures and the rules that fixed them](/claude-code-memory-lessons/).
2. Always-on rules: [CLAUDE.md too long](/claude-md-too-long/).
3. Auto-memory load window: [Claude Code auto memory not working?](/claude-code-auto-memory-limit/).
4. Template product page: [free LLM wiki template for Claude Code](/llm-wiki-template-claude-code/).
5. Skills hygiene: [Claude Code skill versioning](/claude-code-skill-versioning/).
6. This post: one read-only **MCP server for personal knowledge base** access from Notion AI, claude.ai, and Claude Code cloud.

👉 [**Use this template on GitHub**](https://github.com/Sinfjell/personal-memory-template) — *Use this template*, make it private, run `/setup`.

If you dictate longer prompts into Notion AI or Claude, <a href="/go/wispr/?position=mcp-memory-end&via=md&from=%2Fmcp-server-ai-memory%2F" rel="sponsored nofollow noopener" data-cta-product="wispr-flow" data-cta-location="mcp-memory-end">Wispr Flow’s free plan</a> is the system-wide dictation path I compared with Claude Code `/voice` in [Claude Code /voice vs Wispr Flow](/claude-code-voice-vs-wispr-flow/).

[Subscribe below](#foot-sub) if you want template updates and later series posts by email.

## FAQ: Notion AI MCP server and cloud memory

<!-- faq -->
