Skip to main content
Glama
README.md
# Memo MCP

[Türkçe](README.tr.md)

**Your agent already knows your code. Memo knows you.**

Coding agents such as Claude Code, Codex and Antigravity have their own file, shell and git tools. What they lack is what you told another assistant last week: your preferences, your past decisions, your calendar. [Memo](https://github.com/BugraAkdemir/memo) is a personal assistant that runs on your own computer and remembers those things. Its MCP server lets any MCP client use them.

> **Status: pre-release.** The MCP server is on Memo's `main` branch and is not in a Memo release yet. The npm package is [`memocpp-mcp`](https://www.npmjs.com/package/memocpp-mcp) (`memo-mcp` was taken on npm); it needs a Memo with MCP. Signed backend-only downloads (Memo's server without the desktop app) are planned but do not exist yet. Until then you need Memo itself on the machine, built from `main`.

## What your agent gets

Out of the box, read-only:

- **Memory**: facts you asked Memo to remember, and a search over past conversations and decisions. Inside a Memo project the agent sees only that project's memory. What an agent saves shows up in your editable Markdown memory notes, which you can also open in Obsidian.
- **Calendar**: events, free and busy times, routines.
- **Web**: free web search, and page reading with a real browser, returned as Markdown.
- **Your skills**: your Memo skills show up in the agent as prompts (slash commands).

Opt-in, per agent:

- saving to memory;
- mail, WhatsApp and contacts (read only; third-party content is fenced as untrusted);
- image generation, local speech-to-text, text-to-speech;
- `ask_memo`: one question to a model you configured in Memo, for example a free local model as a second opinion;
- sending mail and messages, with **your approval for every single call**;
- switching Memo's own features (memory, web search, speech-to-text…) on and off.

File, shell and system tools are never exposed. Your agent has its own.

## Quick start

You need Memo on the machine: the desktop app, or the backend alone on Linux/macOS.

```bash
npx -y memocpp-mcp setup
```

(`memo mcp setup` does the same without npm. The npm package is only a launcher: it finds your Memo, checks that it has MCP — an older Memo gets an "update Memo" message, never started — and runs `memo mcp …`.)

The wizard:

1. starts Memo's backend if it is not running, and turns the MCP server on;
2. asks whether your general memory may be shared outside Memo projects (default: no);
3. asks whether to install the "using Memo" skill for your agents (default: yes);
4. finds Claude Code, Codex and Antigravity on this machine and asks, for each one, whether to connect it.

Each agent gets its own client, with its own token and the default tool groups. `memo mcp setup --yes` accepts every default without asking. `memo mcp uninstall` undoes exactly what the wizard did.

To connect one agent with other options, use `install`:

```bash
memo mcp install claude-code --groups web,memory,memory_write,calendar,skills --memory all
memo mcp install codex
memo mcp install agy            # Antigravity
```

Restart the agent afterwards so it loads the new server.

## Manual install

`memo mcp client create <name>` creates a client, prints its token **once**, and prints ready-to-paste setup for each agent:

```bash
memo mcp client create claude-code --memory general
```

There are two ways to connect:

- **stdio** (recommended): the agent starts `memo mcp`, a small bridge that forwards MCP to the running backend and starts the backend when needed. Give it `MEMO_MCP_TOKEN` and an absolute `MEMO_DATA_DIR`.
- **HTTP**: the agent connects to `http://127.0.0.1:8090/mcp` with `Authorization: Bearer <token>`. Memo must already be running.

| Agent | stdio (what `memo mcp install` writes) | HTTP |
|---|---|---|
| Claude Code | `claude mcp add-json --scope user memo '{"type":"stdio","command":"/home/you/.memo/bin/memo","args":["mcp"],"env":{"MEMO_DATA_DIR":"/home/you/.memo/data","MEMO_MCP_TOKEN":"<token>"}}'` | `claude mcp add --transport http memo http://127.0.0.1:8090/mcp --header "Authorization: Bearer <token>"` |
| Codex | `codex mcp add memo --env MEMO_DATA_DIR=/home/you/.memo/data --env MEMO_MCP_TOKEN=<token> -- /home/you/.memo/bin/memo mcp` | (use stdio) |
| Antigravity | `~/.gemini/config/mcp_config.json`: `"memo": {"command": …, "args": ["mcp"], "env": {…}}` | same file: `"memo": {"serverUrl": "http://127.0.0.1:8090/mcp", "headers": {"Authorization": "Bearer <token>"}}` |
| any other client | command `memo mcp`, env `MEMO_MCP_TOKEN` and `MEMO_DATA_DIR` | `http://127.0.0.1:8090/mcp` with the bearer token |

Complete files are in [examples/](examples/). Paths, Windows notes and every option are in [docs/install.md](docs/install.md).

## Tool groups

Each client sees only the groups it was given. A tool outside them is neither listed nor callable. New clients get the first four.

| Group | Tools | Default |
|---|---|---|
| `web` | `web_search`, `fetch_page` | ✓ |
| `memory` | `memory_search`, `memory_known_facts` | ✓ |
| `calendar` | `get_calendar_events`, `check_availability`, `list_routines` | ✓ |
| `skills` | your Memo skills as MCP prompts | ✓ |
| `memory_write` | `memory_save` | |
| `dev` | `dev_status`, `git_project_status` | |
| `mail` | `mail_accounts`, `mail_inbox`, `mail_search`, `mail_read`, `mail_download_attachment` | |
| `messages` | `whatsapp_latest`, `whatsapp_messages`, `whatsapp_search` | |
| `contacts` | `twin_contacts`, `contact_timeline`, `twin_commitments`, `twin_pending_actions` | |
| `media` | `image_generate`, `transcribe_audio`, `speak_text` | |
| `ask` | `ask_memo` | |
| `actions` | `mail_send`, `mail_save_draft`, `whatsapp_send`, `telegram_send` (every call needs your approval) | |
| `settings` | `memo_settings`, `memo_set_feature` | |

Resources: `memo://memory/known-facts` (with `memory`) and `memo://calendar/today` (with `calendar`).

Every tool in one line: [docs/tools.md](docs/tools.md).

## Memory scopes

Every client has a memory scope, set with `--memory` when the client is created:

| Scope | Outside a Memo project | Inside a Memo project (`.memo/`) |
|---|---|---|
| `none` (default) | no memory | only that project's memory |
| `general` | your general memory, never other projects' | only that project's memory |
| `all` | every pool, grouped and labelled | every pool, current project first |

Memo learns which folder the agent is in from the agent's MCP roots. For agents without roots support, such as Codex, it uses the folder `memo mcp` was started in.

With `all`, results come in sections, so two similar projects do not get mixed up:

```text
Scope: all memory, grouped by where it belongs; current project: /home/you/code/shop-api
## This project: shop-api (/home/you/code/shop-api)
1. (2026-11-20) Use pnpm in this repo, not npm.
## General memory (not tied to any project)
2. (2026-10-02) Answers in Turkish, code comments in English.
## Another project: shop-api-legacy (/home/you/code/shop-api-legacy) — NOT the current project; do not apply these to it unless the user says so
3. (2026-09-14) Deploys with Docker Compose on the old VPS.
```

A project you linked to the current one in your memory notes (`related:` in its hub note) comes under `## Related project: … — NOT the current project` and is searched first.

`memory_save` (group `memory_write`) always writes to the current project, or to your general memory outside projects, as a `fact`, `rule`, `decision` or `source` (with `url`). The entry appears in your Markdown memory notes, marked `(ai: <client name> · date)`, and is tagged `mcp` and `mcp:<client id>`. Details: [docs/memory.md](docs/memory.md).

## Settings group

With the opt-in `settings` group, an agent can answer "is Memo's web search on?" and act on "turn Memo's memory on":

- `memo_settings` lists the switchable features and whether each is on.
- `memo_set_feature` switches one of them: `memory`, `memory_dreams`, `web_search`, `speech_to_text`, `mood`, `proactive`, `minimal_mode`, `on_demand_tools`, `browser_keep_alive`.

No security setting is on the list. Permissions and auto-approval, remote access, sync, telemetry and the MCP server itself stay in Memo's own settings. Granting the group is your consent to these switches, so they need no per-call approval. Every switch can be undone with the same tool.

## Security

- The server accepts connections from this computer only and needs a per-client token on every request, even locally. Memo stores only a hash of each token. Deleting a client revokes its token at once.
- The MCP server is off by default. Turning it off takes effect on the next request.
- Each client sees only its own tool groups. File, shell and OS tools, the interactive browser, provider settings, sub-agents and creating routines are not available to any client.
- Output from mail, WhatsApp and contacts tools arrives wrapped in `<untrusted source="…">`, and the agent is told that this is data, not instructions.
- `actions` calls need your approval one by one: in the agent's own window (MCP elicitation), in a Memo dialog, or with `memo mcp approvals` / `approve <id>` / `deny <id>`. No answer in two minutes counts as a refusal. Memo's own auto-approve settings do not apply to MCP clients.
- Calls to Memo's agent tools (web, calendar, dev, mail, messages, contacts, actions) are in Memo's audit log under the session `mcp:<client id>`. Memory saves are tagged `mcp:<client id>`.

More: [docs/security.md](docs/security.md).

## Uninstall

```bash
memo mcp uninstall              # every agent that install or setup connected
memo mcp uninstall codex        # one agent
```

Uninstall removes the agent's `memo` entry, the skill file it wrote (only if it is still Memo's), and the client with its token. Nothing else is touched. Clients you created by hand are removed with `memo mcp client delete <id>` (IDs: `memo mcp client list`). To stop serving every agent: `memo mcp disable`.

## Troubleshooting

| Message or symptom | Cause and fix |
|---|---|
| `Memo's MCP server is off; run memo mcp enable` (HTTP 503) | The server switch is off. Run `memo mcp enable`, or turn it on in Settings › Developer › MCP server. |
| `the token is invalid or was revoked` (HTTP 401) | The client was deleted or the token is wrong. Run `memo mcp uninstall <agent>` and then `memo mcp install <agent>`, or create a new client. |
| `memo mcp: … no token` | The agent starts `memo mcp` without `MEMO_MCP_TOKEN`. Add it to the agent's MCP entry. |
| `backend did not come up on port 8090 (see …/backend.log)` | Memo's backend failed to start. Read that log. If another program uses port 8090, pass `--port` to every `memo mcp` command. |
| `Memo is not running on port 8090` | The bridge was started with `--no-start`. Start Memo, or drop `--no-start`. HTTP clients also need a running Memo. |
| Memory is empty, or another Memo's data shows up | The bridge is using a different data directory. On Linux/macOS an unset `MEMO_DATA_DIR` means `./data` relative to the folder the agent started in. Put the absolute data directory into the agent's `MEMO_DATA_DIR`; `memo mcp install` does this for you. |
| `This client may not use Memo's general memory…` | The client's scope is `none` and the folder is not a Memo project. Recreate the client with `--memory general` or `--memory all`. |
| `Memory is turned off in Memo.` | Memo's global memory switch is off. Turn it on in Memo, or with `memo_set_feature` if the agent has the `settings` group. |
| A tool is missing | The client does not have that group. Groups are fixed when a client is created: recreate it with `--groups`. |

`memo mcp status` shows whether the server is on, its URL, and every client with its groups and memory scope.

## This repository

No backend code lives here. The server is part of Memo (`internal/mcpserver`), so the tools, the backend and the skill cannot drift apart. This repository holds the distribution side.

| Path | What |
|---|---|
| `bin/memo-mcp.js` | npm entry point. It finds the installed `memo` (`MEMO_BIN`, the usual install folders, then `PATH`) and runs `memo mcp …` with the same arguments: the stdio server, `setup`, `install` and the rest. It probes each candidate with `memo --mcp-capable` and never runs a Memo without MCP (it says "update Memo" instead), and sets `MEMO_DATA_DIR` from the binary's location when it is not set. It downloads nothing; if Memo is missing, it says how to install it. |
| `skill/SKILL.md` | Copy of the agent skill. Source: `internal/mcpserver/skill/SKILL.md` in Memo. Update it with `scripts/sync-from-memo.sh`. |
| `examples/` | Client configuration for Claude Code, Codex and Antigravity. |
| `docs/` | [Install](docs/install.md), [tools](docs/tools.md), [memory](docs/memory.md), [security](docs/security.md). Turkish in `docs/tr/`. |
| `server.json.draft` | MCP Registry entry. Not submitted. |
| `test/` | Launcher tests: `npm test`. |

Memo's own documentation of the feature: [docs/MCP.md](https://github.com/BugraAkdemir/memo/blob/main/docs/MCP.md).

## License

AGPL-3.0-or-later, same as Memo. See [LICENSE](LICENSE).