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

# Installation

> Install the MCP Rank SDK

# Installation

## Python

Install using pip:

```bash theme={null}
pip install mcp-rank
```

Or with poetry:

```bash theme={null}
poetry add mcp-rank
```

### Requirements

* Python 3.9+
* `httpx` for async HTTP requests
* `openai` or `anthropic` (optional, for Agent class)

## Configuration

### Environment Variables

Set your API key as an environment variable:

```bash theme={null}
export MCP_RANK_API_KEY="sk_mcp_rank_..."
```

### Using .env Files

Create a `.env` file in your project root:

```bash theme={null}
MCP_RANK_API_KEY=sk_mcp_rank_...
```

Load it in your code:

```python theme={null}
from dotenv import load_dotenv
load_dotenv()
```

### Direct Configuration

Or pass the API key directly:

```python theme={null}
from mcp_rank import MCPRankClient

client = MCPRankClient(
    api_key="sk_mcp_rank_...",
    base_url="https://api.mcprank.com",  # optional
    timeout=30.0,  # optional
)
```

## Verify Installation

Test that everything works:

```python theme={null}
import asyncio
from mcp_rank import MCPRankClient

async def test():
    async with MCPRankClient(api_key="sk_mcp_rank_...") as client:
        health = await client.health()
        print(f"API Status: {health['status']}")
        print(f"Server Count: {health['server_count']}")

asyncio.run(test())
```

Expected output:

```
API Status: healthy
Server Count: 490
```
