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

# Connecting Agents

> Step-by-step setup for Claude Desktop, Cursor, Windsurf, and custom MCP clients.

## SSE Endpoint

All MCP clients connect to:

```
https://app.alana.shopping/api/mcp/sse
```

## Claude Desktop

Add Alana to Claude Desktop's MCP configuration file:

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json theme={null}
{
  "mcpServers": {
    "alana": {
      "url": "https://app.alana.shopping/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer sk_live_your_api_key"
      }
    }
  }
}
```

Restart Claude Desktop after saving. You'll see Alana tools available in the tools panel.

## Cursor

In Cursor, open **Settings → MCP** and add a new server:

```json theme={null}
{
  "alana": {
    "url": "https://app.alana.shopping/api/mcp/sse",
    "headers": {
      "Authorization": "Bearer sk_live_your_api_key"
    }
  }
}
```

## Windsurf

In Windsurf, open **Settings → Extensions → MCP** and configure:

```json theme={null}
{
  "servers": {
    "alana": {
      "transport": "sse",
      "url": "https://app.alana.shopping/api/mcp/sse",
      "headers": {
        "Authorization": "Bearer sk_live_your_api_key"
      }
    }
  }
}
```

## Custom Agent (TypeScript)

Use the `@modelcontextprotocol/sdk` to connect programmatically:

```typescript theme={null}
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

const transport = new SSEClientTransport(
  new URL("https://app.alana.shopping/api/mcp/sse"),
  {
    requestInit: {
      headers: {
        Authorization: "Bearer sk_live_your_api_key",
      },
    },
  }
);

const client = new Client({ name: "my-agent", version: "1.0.0" }, {});
await client.connect(transport);

// Call a tool
const result = await client.callTool({
  name: "search_products",
  arguments: { query: "cotton t-shirt", limit: 5 },
});

console.log(result.content);
```

## Custom Agent (Python)

```python theme={null}
import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main():
    url = "https://app.alana.shopping/api/mcp/sse"
    headers = {"Authorization": "Bearer sk_live_your_api_key"}

    async with sse_client(url, headers=headers) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()

            result = await session.call_tool(
                "search_products",
                arguments={"query": "cotton t-shirt", "limit": 5},
            )
            print(result.content)

asyncio.run(main())
```

## Environment Variables

For production deployments, use environment variables instead of hardcoding the API key:

```bash theme={null}
ALANA_API_KEY=sk_live_your_api_key
ALANA_MCP_URL=https://app.alana.shopping/api/mcp/sse
```

Then reference them in your config:

```json theme={null}
{
  "mcpServers": {
    "alana": {
      "url": "${ALANA_MCP_URL}",
      "headers": {
        "Authorization": "Bearer ${ALANA_API_KEY}"
      }
    }
  }
}
```
