# MCP Server

## Configuration

### Prerequisites

Before connecting an MCP server, make sure you have:

* A running MCP server with an accessible SSE endpoint (e.g. `https://your-server.com/mcp`).
* Available authentication method (if required): API key, Bearer token, or OAuth.
* At least one tool is configured on the MCP server.

***

### Connecting the data source

1. On the Data sources page, click **Connect**, and select **MCP Server** in the Data sources list.
2. Select the required **Transport**:
   * Choose **HTTP** for MCP servers with Streamable HTTP support.
   * Choose **SSE** for legacy MCP servers that use HTTP plus SSE.
3. Provide the required connection details:

* **Server URL**: SSE endpoint of your MCP server.
* **Authentication:** choose one of the supported methods.

4. Provide your **Username** and **Password**.
5. Click **Test connection** to verify connectivity.
6. Click **Connect Data source** to complete setup.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FOHR7OKzYdKzvq7nYee8t%2Fmcp%20server.png?alt=media&#x26;token=bee5c94f-ed95-4ab7-be42-58e534875515" alt=""><figcaption></figcaption></figure>

After a successful connection, UI Bakery automatically calls the MCP `tools/list` method to retrieve available tools and their schemas.

***

### Usage

After connecting the MCP server, you can use its tools inside your application.

#### Schema discovery

Once connected, UI Bakery fetches and stores the list of available tools exposed by the MCP server.

Each tool includes:

* Tool name
* Description
* Input parameters schema.

#### Dynamic tool access

The list of available tools is retrieved dynamically from the MCP server. This means:

* Any changes on the MCP server (new tools, updated parameters) are reflected after re-fetching the schema.
* Different users or environments may see different tool sets depending on authentication and permissions.

***

{% hint style="info" %}

* MCP server acts as a unified gateway to external tools and APIs.
* Tools are defined and managed on the MCP server side, not in UI Bakery.
* Authentication affects which tools are available and accessible.
  {% endhint %}


---

# 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.uibakery.io/reference/data-sources/mcp-server.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.
