# 1. Set up the python-MCS-SDK

To begin using Swan Storage, you need to install and configure the python-MCS-SDK.

### 1.1 Install Python

Ensure you have Python 3.7 or later installed on your system.

For information about how to get the latest version of Python, see the official [Python documentation](https://www.python.org/downloads/).

### 1.2 Install python-MCS-SDK

Install the latest python-MCS-SDK release via **pip:**

`pip install python-MCS-SDK`

{% hint style="info" %}
The latest development version of python-MCS-SDK is on [GitHub](https://github.com/filswan/python-mcs-sdk)
{% endhint %}

### 1.3 Configure the SDK

Before using the SDK, you need to generate an API key from the MCS website.

1. Visit [https://swanipfs.com/#/my\_account](https://www.multichain.storage/#/my_account)
2. Generate an API key
3. Save your API key securely

<figure><img src="/files/Y1lsATG6HvfWrOabLru5" alt=""><figcaption></figcaption></figure>

### 1.4 Initialize the SDK

To use python-MCS-SDK, you must first import it and state your identity.

```python
from swan_mcs import APIClient
import logging
# Set logging level to be sure that you can see the info level message
logging.basicConfig(level=logging.INFO)
# Let's initialize the Python-MCS-SDK
mcs_api = APIClient("<API_KEY>")
```

If you see "Login Successful" in the console, you have logged in successfully. The following code will take you through the initialization of services.

```python
from swan_mcs import BucketAPI
# Init bucket client
bucket_client = BucketAPI(mcs_api)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swanchain.io/bulders/app-developer/store-and-retrieve-a-file-with-swan-storage/1.-set-up-the-python-mcs-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
