> ## 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 Cloud API key](https://docs.snowleopard.ai/cloud/getting-started.md#api-keys)
* A [Snow Leopard Cloud](https://docs.snowleopard.ai/cloud/getting-started.md) instance with at least one [data source](https://docs.snowleopard.ai/cloud/getting-started.md#adding-a-data-source) connected
* Your instance ID, from the instance's [Connection Info](https://docs.snowleopard.ai/cloud/getting-started.md#connection-info) tab
* [Claude Desktop](https://claude.ai/download) (or another MCP client)

> [!NOTE]
>
> Don't have data? Load the [sample Northwind dataset](https://github.com/SnowLeopard-AI/northwind_psql) into a PostgreSQL database that Snow Leopard Cloud can reach, such as a hosted [Neon](https://neon.com) or [Supabase](https://supabase.com) database. Run the dataset's `northwind.sql` script against your database, then [add the database as a data source](https://docs.snowleopard.ai/cloud/getting-started.md#adding-a-data-source) in your instance.

## 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_INSTANCE_ID=your-instance-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, instance_id=instance_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_INSTANCE_ID": "your-instance-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/index.md) to learn about the [Retrieve](https://docs.snowleopard.ai/cloud/endpoints/retrieve.md) and [Response](https://docs.snowleopard.ai/cloud/endpoints/response.md) endpoints
* Improve accuracy by giving Snow Leopard [feedback](https://docs.snowleopard.ai/cloud/endpoints/feedback.md) about your business logic and terminology
* Explore [Recipes](https://docs.snowleopard.ai/recipes) for production-ready agent examples


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.