# Defining an MCP Server

The Unified Context Layer (UCL) allows you to define your own **MCP (Model Context Protocol) servers** and use them as tools within your workspace.

### Step 1: Access the Define MCP Server Option

* Log in to your UCL account at [**app.ucl.dev**](https://app.ucl.dev).
* Select your workspace.
* From the **Dashboard → Connect page**, click on **Define an MCP Server**.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FI0A6vvvdXz0UclJckNeQ%2FScreenshot%202025-10-03%20195550.png?alt=media&#x26;token=530664b6-45b2-442e-afd3-671231cd2724" alt=""><figcaption></figcaption></figure>

* You will be taken to the **Create New MCP Tool** screen.

### Step 2: Add Tool Details

On this screen, you will provide the basic information for your MCP tool.

#### **Tool Details**

* **Tool Name** → Enter a name for your tool.
* **Description** → Briefly describe your tool.
* **Workspace** → Select the workspace.
* **Images (0/3)** → Optionally upload up to 3 images (e.g., `https://example.com/image.jpg`).
* **Mode** → Choose how the tool will appear:
  * Default
  * Light
  * Dark

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fnw4bd4l1cwf2QIG7AXOW%2Fimage.png?alt=media&#x26;token=7f6b2aec-d006-4e10-a31e-538c31621089" alt=""><figcaption></figcaption></figure>

Click **Next** to continue.

### Step 3: Configure Activation

Set up authentication and activation parameters for your MCP tool.

#### **Available Authentication Modes**

* **OAuth** → Enter OAuth secrets.
* **Basic** → Username/Password authentication.
* **API Key** → Provide an API key.
* **Bearer Token** → Token-based authentication.
* **Custom Input** → Define your own variable names and descriptions (e.g., `Instance ID`).

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FKrFCtWI8bxRBUMrlAJ6b%2Fimage.png?alt=media&#x26;token=ce587d5f-1744-42a0-8a70-3272f83660d3" alt=""><figcaption></figcaption></figure>

> &#x20;You can set one of these methods as the **default**.
>
> &#x20;Example: In *Custom Input* mode, you may define `instanceId` as a required parameter for connecting.

Click **Next** to proceed.

### Step 4: Configure MCP Server

Provide the server connection details.

#### **Server Configuration**

* **Server URL** → Add the URL of your MCP server&#x20;

```
 https://your-mcp-server.com
```

* **Headers** → Add any required headers (e.g., `instanceId`).

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FPFWBuaOpAUFJg6afdaq4%2Fimage.png?alt=media&#x26;token=6b1e54d1-4242-4efb-b44f-f848cb084bf2" alt=""><figcaption></figcaption></figure>

* **Query Parameters** → Add query parameters if needed.
* **Authentication Configuration** → Choose one:
  * No Authentication
  * Basic
  * Bearer
  * JWT Bearer
  * AWS Signature
  * API Key

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FrHTqm6tMqd0JHNs9NrNZ%2Fimage.png?alt=media&#x26;token=650377e9-6496-4ddb-a771-3f71d7e54b83" alt=""><figcaption></figcaption></figure>

Click **Next** to continue.

### Step 5: Test Connection

You will now see your MCP server details.&#x20;

```
- Tool Name
- Server URL
- Connection Status: Ready to test connection
```

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FgFDQ9d9UptMqHacUCIsU%2Fimage.png?alt=media&#x26;token=6b1404fa-756f-4070-8650-771ba1165f2e" alt=""><figcaption></figcaption></figure>

* Click **Test Connection**.
* If successful, you will see a notification: *“Connection Successful. Ready to complete setup.”*

### Step 6: Complete Setup

* Click **Complete Setup**.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F1NPWIzX0vr2trJEncdCI%2Fimage.png?alt=media&#x26;token=d739725a-f76d-423d-96ef-de37f79a852b" alt=""><figcaption></figcaption></figure>

* Your new MCP server will be added as a tool in your dashboard.&#x20;

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FZSqbPjX4qCeQVki2aKea%2Fimage.png?alt=media&#x26;token=082319d5-30b4-460b-817a-174f06847fe7" alt=""><figcaption></figcaption></figure>

> You can now use it within your UCL workspace.
