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

# MCP

> Run a Snow Leopard MCP server and connect it to Claude Desktop or other MCP clients.

This guide shows you how to run a Snow Leopard [MCP](https://modelcontextprotocol.io/) server using [FastMCP](https://github.com/jlowin/fastmcp) and connect it to an MCP client.

## Prerequisites

* Python 3.10+
* [uv](https://docs.astral.sh/uv/) package manager
* [Snow Leopard API key](https://auth.snowleopard.ai/account/api_keys)
* A datafile uploaded to [Snow Leopard Playground](https://try.snowleopard.ai)
* [Claude Desktop](https://claude.ai/download) (or another MCP client)

<Note>
  Don't have data? Use our [sample superheroes dataset](https://github.com/SnowLeopard-AI/playground_datasets/raw/refs/heads/main/superheroes.db) to get started, or choose from our other [sample datasets](https://github.com/SnowLeopard-AI/playground_datasets/).
</Note>

## Run the Snow Leopard MCP server

Clone the [example server](https://github.com/SnowLeopard-AI/snowy-examples/tree/main/quickstart/fastmcp):

```bash theme={null}
git clone https://github.com/SnowLeopard-AI/snowy-examples.git
cd snowy-examples/quickstart/fastmcp
```

Set your environment variables:

```bash theme={null}
export SNOWLEOPARD_API_KEY=your-snowleopard-key
export SNOWLEOPARD_DATAFILE_ID=your-datafile-id
```

Run the server:

```bash theme={null}
uv run fastmcp run server.py
```

### Customize the tool description (optional)

The tool's docstring tells agents when and how to use it. Edit `server.py` to describe your specific data:

```python theme={null}
@mcp.tool
def get_data(user_query: str):
    """
    Retrieve customer order data.
    Contains order history, products, and customer information.
    Use this to answer questions about sales, orders, and customers.
    """
    return snowy.retrieve(user_query=user_query, datafile_id=datafile_id)
```

## Connect to the MCP server

You can now connect the server to any application that supports MCP. Below we show how to connect with Claude Desktop.

### Claude Desktop

Add the server to your Claude Desktop configuration (`claude_desktop_config.json`):

```json theme={null}
{
  "mcpServers": {
    "snowy": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/snowy-examples/quickstart/fastmcp",
        "run",
        "fastmcp",
        "run",
        "server.py"
      ],
      "env": {
        "SNOWLEOPARD_API_KEY": "your-api-key",
        "SNOWLEOPARD_DATAFILE_ID": "your-datafile-id"
      }
    }
  }
}
```

Now you can ask Claude questions about your data.

## Next steps

* View the [full example on GitHub](https://github.com/SnowLeopard-AI/snowy-examples/tree/main/quickstart/fastmcp)
* See our full [API documentation](https://docs.snowleopard.ai/) to learn about the [Retrieve](/playground/endpoints/retrieve) and [Response](/playground/endpoints/response) endpoints
* Explore [Recipes](/recipes) for production-ready agent examples
