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

# Connect to AMFS

Getting started with SenseLab AMFS only takes a few seconds

## Get Your Credentials

<Frame>
  <img src="https://mintcdn.com/senselab/3XNRyYeyag8jPqsf/images/Screenshot-2026-04-14-at-12.43.20-PM.png?fit=max&auto=format&n=3XNRyYeyag8jPqsf&q=85&s=9f4d91079c887afec7f3a2ea7f5e342a" alt="Screenshot 2026 04 14 At 12 43 20 PM" width="1647" height="857" data-path="images/Screenshot-2026-04-14-at-12.43.20-PM.png" />
</Frame>

1. Create an [**AMFS**](https://amfs.sense-lab.ai) account
2. Go to **Settings → API Keys** to create a scoped key
3. Go to the [AMFS Dashboard → Agents](https://amfs-login.sense-lab.ai) page
4. The **MCP Connection Card** shows your **Server URL**
5. Copy the ready-made JSON snippet — paste it into your IDE config

Need more keys? Go to **Settings → API Keys** to create scoped keys per agent or service.

***

## Connect Your IDE

### Cursor

Add to `.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "amfs": {
      "command": "uvx",
      "args": ["amfs-mcp-server"],
      "env": {
        "AMFS_HTTP_URL": "https://amfs-login.sense-lab.ai",
        "AMFS_API_KEY": "<your-api-key>"
      }
    }
  }
}
```

### Claude Code

Add to `~/.claude/claude_desktop_config.json`:

```json theme={null}
{
  "mcpServers": {
    "amfs": {
      "command": "uvx",
      "args": ["amfs-mcp-server"],
      "env": {
        "AMFS_HTTP_URL": "https://amfs-login.sense-lab.ai",
        "AMFS_API_KEY": "<your-api-key>"
      }
    }
  }
}
```

***

## Connect via SDK

Set the env vars once — both SDKs pick them up automatically:

```bash theme={null}
export AMFS_HTTP_URL="https://amfs-login.sense-lab.ai"
export AMFS_API_KEY="<your-api-key>"
```

### Python

```bash theme={null}
pip install amfs
```

```python theme={null}
from amfs import AgentMemory

mem = AgentMemory(agent_id="my-agent")
mem.write("checkout-service", "retry-pattern", {"max_retries": 3})
```

### TypeScript

```bash theme={null}
npm install @amfs/sdk
```

```typescript theme={null}
import { AgentMemory } from "@amfs/sdk";

const mem = new AgentMemory({ agentId: "my-agent" });
await mem.write("checkout-service", "retry-pattern", { maxRetries: 3 });
```

***

## Connect via REST API

```bash theme={null}
curl -X POST https://amfs-login.sense-lab.ai/api/v1/entries \
  -H "Content-Type: application/json" \
  -H "X-AMFS-API-Key: <your-api-key>" \
  -d '{"entity_path": "checkout-service", "key": "retry-pattern", "value": {"max_retries": 3}}'
```

See the [API Reference](/amfs/reference/api) for the full endpoint list.

***

## Security

**Account isolation** — Postgres Row-Level Security ensures tenants can't see each other's data, even if there's an application bug.

**Scoped keys** — Restrict keys to specific entity paths and permissions:

```text theme={null}
amfs_sk_live_abc123  →  checkout-service/**  [READ_WRITE]
                        shared/patterns/*     [READ]
```

**Audit logging** — Every state-changing operation is recorded. View in Dashboard → Audit Log.

<Warning>
  Never hardcode API keys in files committed to git. Use environment variables or a secrets manager.
</Warning>

***

## Troubleshooting

| Problem                  | Fix                                                                                                                       |      |
| :----------------------- | :------------------------------------------------------------------------------------------------------------------------ | ---- |
| `401 Unauthorized`       | Check your API key in Dashboard → Settings → API Keys                                                                     |      |
| `403 Scope Denied`       | Key doesn't have permission for that entity path — check scopes                                                           |      |
| `uvx: command not found` | Install [uv](https://docs.astral.sh/uv/): \`curl -LsSf [https://astral.sh/uv/install.sh](https://astral.sh/uv/install.sh) | sh\` |
