Connect your client

AlterNafs Brain is consumed through MCP. Point your AI client at the Brain MCP endpoint:

https://brain.alternafs.com/mcp

Before you start

Hit a snag? Jump to Troubleshooting.

claude.ai (web & mobile)

Recommended — signs you in with OAuth, no token to manage.

  1. 1In claude.ai, open Settings → Connectors and choose Add custom connector.
  2. 2Paste the MCP URL above as the connector URL.
  3. 3Click Connect — you'll be sent to sign in, then asked to authorize access.
  4. 4Brain's tools (read/write memories, search, …) become available in your chats.

Verify: In a new chat, ask Brain to search your memories — its tools (read / write / search) should appear and respond.

Need a token?

Every client below (Codex, Claude Desktop, Claude Code — or any MCP client) needs a personal token. Generate one per device, then paste it into the matching config.

Manage device tokens →

Claude Code (CLI)

Add Brain as an HTTP MCP server with your device token (replace <your-token> and <your-device>):

claude mcp add --transport http brain https://brain.alternafs.com/mcp \
  --header "Authorization: Bearer <your-token>" \
  --header "X-Brain-Device: <your-device>" \
  --header "X-Brain-Client: claude-code"

Restart Claude Code, then run /mcp to check the connection.

Verify: /mcp lists brain as connected and its tools are available.

Desktop apps

Pick your OS — the config-file location differs.

Claude Desktop

Add Brain to your config file at:

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "brain": {
      "type": "http",
      "url": "https://brain.alternafs.com/mcp",
      "headers": {
        "Authorization": "Bearer <your-token>",
        "X-Brain-Device": "<your-device>",
        "X-Brain-Client": "claude-desktop"
      }
    }
  }
}

Then fully quit Claude Desktop (Cmd / Ctrl + Q) and reopen — closing the window isn't enough.

Verify: Brain's tools appear under the tools (🔨) menu in a new chat.

Codex

Codex speaks MCP over HTTP natively. Add this to:

~/.codex/config.toml
[mcp_servers.brain]
url = "https://brain.alternafs.com/mcp"
http_headers = { "Authorization" = "Bearer <your-token>", "X-Brain-Device" = "<your-device>", "X-Brain-Client" = "codex" }

Use http_headers as shown — a bare bearer_token is rejected for HTTP servers. On Windows, set the device env var with setx and fully restart Codex.

Verify: Restart Codex, then ask it to use a Brain tool — it should connect and respond.

Any other MCP client

Brain works with any client that speaks MCP over HTTP — only the config format differs. Point yours at the endpoint below and send these headers (replace the placeholders with your device token and a device label):

MCP endpoint (HTTP / streamable):
  https://brain.alternafs.com/mcp

Headers:
  Authorization: Bearer <your-token>
  X-Brain-Device: <your-device>
  X-Brain-Client: <your-client>

X-Brain-Device and X-Brain-Client are free-form audit labels — use lowercase letters, digits, - or _ (e.g. pc-aisyah, my-editor).

Troubleshooting

The usual snags, and how to fix them.

401 / “Unauthorized” / authentication failed

Cause: the token is wrong, expired, or revoked — or the header isn't formatted right.

Fix: the header must be exactly Authorization: Bearer <token> — the word Bearer, one space, then the token. Confirm the token isn't revoked at /account/tokens (revoked or expired tokens stop working immediately). If unsure, mint a fresh token and paste the new value. (claude.ai uses no token — see the OAuth item below instead.)

Brain’s tools don’t show up after I edited the config

Cause: the client reads its MCP config on launch, so it's still running the old one.

Fix: fully quit the client (Cmd / Ctrl + Q for desktop apps — closing the window or signing out isn't enough), then reopen. For Claude Code, restart and run /mcp.

I lost my token / it was “only shown once”

Cause: the token is shown once, at creation. We only store a masked prefix afterwards, so it can't be revealed again.

Fix: at /account/tokens, revoke the old token and mint a new one, then update your client's config with the new value.

Claude Desktop won’t start, or ignores Brain

Cause: the config file isn't valid JSON — a stray trailing comma, a missing quote or brace, or a duplicate key.

Fix: paste the exact block from the Desktop section above and make sure it's wrapped in a single { "mcpServers": { … } } object with no trailing commas. If the file didn't exist before, create it with just that block. Validate with a JSON linter if it still won't load.

Codex rejects the token / “bearer” error

Cause: a bare bearer_token isn't accepted for HTTP MCP servers.

Fix: use the http_headers = { "Authorization" = "Bearer …", … } form shown in the Codex section. On Windows, set any env var with setx and fully restart Codex.

claude.ai: the connect button errors or won’t authorize

Cause: you're not signed in, or there's a stale connector entry.

Fix: in claude.ai, open Settings → Connectors → Add custom connector, paste the MCP URL, click Connect, sign in, and approve. If it still fails, remove the connector and add it again.

Can’t reach the server / TLS or network error

Cause: a firewall, VPN, or corporate proxy is blocking the endpoint — or the URL has a typo.

Fix: confirm the MCP URL matches the one at the top of this page exactly (https, no trailing space). Try from another network — corporate networks sometimes block unfamiliar hosts.

Revoke one device without breaking the others

Cause: each device should have its own token.

Fix: at /account/tokens, revoke just that device's token — your other devices keep working. Mint a replacement only for the affected device.