Stage 3: Configure your environment & run the server

Introduction

In this stage, you will copy and rename the .env.example file (added during Stage 1), and then update it with your own Patchworks credentials

Pre-requisites

To complete this task, you will need an API key for your Patchworks account. Please refer to our API keys product documentation for information about obtaining API keys.

The steps

1

Prepare credentials

Ensure that your Patchworks API key is to hand, ready to copy/paste later in this task.

2

Change into the required folder

In a terminal window, run the following command:

cd ~/patchworks-mcp
3

Copy and rename the .env.example file

Run the following command:

cp .env.example .env

The copied file is now named .env.

4

Open the .env file in edit mode

Run the following command:

nano .env

The .env opens and will look similar to the example below:

5

Apply your Patchworks API key

Use your arrow keys to move down to the end of the PATCHWORKS_TOKEN= XXXXXXXXXXXXXX line:

Then use your backspace key to delete the XXXXXXXXXXXXXX element:

Now paste your Patchworks API key - for example:

Press CTRL+X to exit. When prompted, enter Y to save changes, then press Enter to confirm the .env filename.

6

Run the server

In the same terminal window (at the patchworks-mcp directory), run the following command:

uv run python server.py

You should see confirmation that a virtual environment is created and packages are installed - for example:

At this point, you can terminate the session.

7

Configure your MCP client

Go to Stage 4: Configure your MCP client.

Last updated

Was this helpful?