# Installation

Install the package, load the extension, start the daemon, and connect an MCP client.

## 1. Install the Python package

```sh
python -m venv venv
source venv/bin/activate
pip install -e .
```

## 2. Load the Chrome extension

1. Open `chrome://extensions` and enable **Developer mode**.
2. Click **Load unpacked** and select `extension/dist/`.
3. Pin the extension and click its icon to open the side panel.

For a one-off production build: `cd extension && npm install && npm run build`.
For day-to-day UI work see [Development › Building](/docs/development/building/).

## 3. Start the daemon

```sh
source venv/bin/activate
bookmark-context serve
```

Runs on `http://localhost:7331`. Keep it running while you use the extension.

On first start the daemon generates an API token, prints it, and writes it to
`~/.config/bookmark-context/token` (mode 0600):

```
[bookmark-context] API token: xY3k...
[bookmark-context] Paste this into the extension's Settings panel.
```

## 4. Give the extension the token

Open the side panel, go to **Settings** (gear icon), paste the token into
**API token**, and **Save**.

Without the token the daemon answers every request except `/status` with `401`,
and the side panel shows *"Daemon rejected the API token"*. This is what stops
any web page you visit from reaching `localhost:7331` and reading or deleting
your collections. The MCP server is unaffected — it reads the database directly
and never goes through HTTP.

## 5. Connect an MCP client

Add to `~/.cursor/mcp.json` (or the equivalent for your client):

```json
{
  "mcpServers": {
    "bookmark-context": {
      "command": "bookmark-context",
      "args": ["mcp"]
    }
  }
}
```

Restart the client. The MCP server starts on demand when the client first calls
a tool.
