# How to Give Claude Long-Term Memory (MCP Setup, 2026)

The simplest way to give Claude or ChatGPT long-term memory using MCP is Hjarni, a knowledge base with a built-in MCP server. You write Markdown notes once. Your AI searches and reads them in every conversation that follows. Setup takes five minutes: create a note, paste one URL into your AI client, done.

Right now, every time you open your AI, you start over. You explain your project, your stack, the decision you made last Tuesday. Again. Here is how to stop.

The walkthrough below uses Claude. See [how to use Hjarni with Claude](/docs/claude) for the overview. The same setup works for ChatGPT, covered at the end.

## How it works

[Hjarni](https://hjarni.com) is a note app your AI can read. You write notes. Your AI searches and reads them. One URL to connect. That persistent, searchable store is what [long-term memory for AI](/docs/ai-long-term-memory) actually looks like in practice.

## Step 1: Create your first note

Sign up at [hjarni.com](https://hjarni.com/registration/new). Create a note about something you're tired of re-explaining.

```
Title: Tech Stack

Rails 8 + SQLite.
Deployed on Hetzner via Kamal.
MCP server built into the app.
Tailwind + Turbo, no React.
Solid Queue for background jobs.
```

![A note in Hjarni](/blog-hjarni-note.png)

## Step 2: Connect to Claude

Go to Settings. Find Connectors. Add a custom connector.

Name it "Hjarni" and paste https://hjarni.com/mcp as the URL. Done.

On Claude Desktop or Claude Code instead? The [connect Claude to an MCP server](/docs/connect-claude-mcp) guide covers all three. For the terminal, it is one line: `claude mcp add --transport http hjarni https://hjarni.com/mcp` adds the MCP server to Claude Code.

![Claude MCP settings with Hjarni connected](/blog-claude-mcp-settings.png)

## Step 3: Ask Claude something

Start a new conversation. Don't paste any context. Just ask something only your notes would know.

"Write me a pitch based on what you know about my product."

Claude searches your notes. Finds the answer. No copy-pasting.

[demo:claudememoryvideo]

## Doing the same with ChatGPT

The pattern works for ChatGPT too. MCP is open. Both clients read the same notes. For the dual-client version of this guide, see [Give Claude or ChatGPT long-term memory with MCP](/give-claude-chatgpt-long-term-memory).

ChatGPT supports MCP two ways. Apps Directory for one-click installs. Developer mode for custom servers. Either path, the result is the same: ChatGPT searches your notes, reads them, writes back to them. The [how to add MCP to ChatGPT](/docs/connect-chatgpt-mcp) guide walks through both.

If you mostly use ChatGPT, see [How to Use MCP with ChatGPT](/blog/how-to-use-mcp-with-chatgpt) for the full walkthrough. Coding in VS Code? [Give GitHub Copilot Long-Term Memory](/blog/give-github-copilot-long-term-memory) covers the `.vscode/mcp.json` setup. In the Codex CLI? [Codex CLI hooks](/docs/codex-hooks) save every session automatically. Pair programming with [Aider MCP](/for/aider)? It reads your project context across sessions too. If you use more than one, point them at the same Hjarni. The context follows you across clients.

## What to save next

If you've typed it twice, save it. Project context. Decisions and their reasons. Research conclusions. Need a starting list? [What to save in your AI knowledge base](/blog/what-to-save-in-your-ai-knowledge-base) has five recipes. The habit you are building here, an assistant that maintains a growing brain for you, is [Karpathy's LLM wiki pattern](/blog/karpathys-llm-wiki-is-right), hosted instead of local. If you want the full setup, here is [how to build an LLM wiki with Claude or ChatGPT](/blog/how-to-build-an-llm-wiki-with-claude-mcp).

Every note you add makes the next conversation better. Ten notes in, you just talk to your AI like it's been on your team all along.

The free tier gives you 25 notes with full MCP access. No credit card.
