> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/classic/fastn-ucl/getting-started/about-unified-context-layer/defining-an-mcp-server.md).

# 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="/files/252KVPhrH9hMWXjLxILL" 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="/files/o4lZO1EtKmfBQKXksI1w" 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="/files/iQLutqmogLlZviqaJPtY" alt=""><figcaption></figcaption></figure>

> You can set one of these methods as the **default**.
>
> 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

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

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

<figure><img src="/files/grSUsYv7J7u2VqcV84Aa" 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="/files/lNaWnKX0NQCjv4lmPgSr" alt=""><figcaption></figcaption></figure>

Click **Next** to continue.

### Step 5: Test Connection

You will now see your MCP server details.

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

<figure><img src="/files/rufelpbQaNU9B257giNA" 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="/files/vVUGVWN6DRw9m25Jn5mb" alt=""><figcaption></figcaption></figure>

* Your new MCP server will be added as a tool in your dashboard.

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

> You can now use it within your UCL workspace.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fastn.ai/classic/fastn-ucl/getting-started/about-unified-context-layer/defining-an-mcp-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
