> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mcp integration

# MCP (Model Context Protocol)

Connect Anona Memory to Claude Code, Claude Desktop, and other MCP clients so your AI assistant can remember and recall context directly, without you writing any integration code.

## Tools Exposed

| Tool           | What it does                                   |
| -------------- | ---------------------------------------------- |
| `remember`     | Store a memory in a space                      |
| `recall`       | Semantically search memories in a space        |
| `list_spaces`  | List available Memory Spaces                   |
| `get_insights` | Synthesize an answer from accumulated memories |

Per-tool failures (denied space, no credits) come back as structured tool errors, not broken connections - the MCP session stays alive.

***

## Option 1: Local (stdio)

Runs on your machine via `uvx`, ships with the Python SDK.

```bash theme={null}
uvx --from anona anona-mcp
```

Requires:

```bash theme={null}
export ANONA_API_KEY="anona_live_YOUR_KEY"
export ANONA_SPACE_ID="spc_a1b2c3d4"   # optional - scopes the server to one space
```

Or install explicitly:

```bash theme={null}
pip install "anona[mcp]"
```

### Register with Claude Code

```bash theme={null}
claude mcp add --transport stdio anona -- uvx --from anona anona-mcp
```

Set `ANONA_API_KEY` (and optionally `ANONA_SPACE_ID`) in your shell environment before starting Claude Code.

***

## Option 2: Remote (Streamable HTTP)

Connect directly to the hosted gateway - no local process to run.

```bash theme={null}
claude mcp add --transport http anona http://anona-prod-alb-747552680.us-east-1.elb.amazonaws.com/mcp \
  --header "Authorization: Bearer anona_live_YOUR_KEY"
```

Auth is the same API key you use for the REST API - no separate credential to manage.

***

## Important Notes

* **Tools only load at session start.** Adding or changing the MCP server mid-session won't expose its tools until you restart your MCP client.
* **Scoping to a space.** Without `ANONA_SPACE_ID` set, tools that need a space will ask you to specify one, or operate across whichever spaces your API key can see.
* **Same quota, same billing.** MCP calls consume credits and count against your usage the same way REST API calls do.

***

## Example: Claude Code Session

Once registered, just talk naturally:

> "Remember that the user prefers dark mode and uses VS Code."

> "What do we know about this user's editor preferences?"

Claude Code calls `remember` and `recall` automatically behind the scenes.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python" href="/sdk/python">
    Programmatic client library
  </Card>

  <Card title="API Reference" icon="rectangle-terminal" href="/api-reference/authentication">
    Full REST API documentation
  </Card>
</CardGroup>
