> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/mcp-server.md).

# 🖥️ MCP server (beta)

Connect the UI Bakery MCP server to Codex, Claude, or another MCP-compatible agent to build apps and manage your UI Bakery workspace directly from the agent.

{% hint style="warning" %}
MCP is in beta. The MCP API, available tools, scopes, permissions, and tool parameters may change.
{% endhint %}

### Connect an MCP client

{% hint style="info" %}
UI Bakery on-premise administrators must [enable the MCP server](/on-premise/additional-configurations/mcp-server.md) before clients can connect. In the examples below, replace `https://cloud.uibakery.io` with the public URL of your UI Bakery instance.
{% endhint %}

1. Add the endpoint to the client.
2. Complete browser-based OAuth and sign in to UI Bakery.

{% tabs %}
{% tab title="AI agent" %}
**Ask your AI agent to connect**

Copy and send this prompt to an AI coding agent that can configure MCP servers:

```
Connect the UI Bakery MCP server using https://cloud.uibakery.io/api/mcp
```

{% endtab %}

{% tab title="Claude Code" %}

```shell
claude mcp add --transport http uibakery https://cloud.uibakery.io/api/mcp
```

Run `/mcp` inside Claude Code. Select `uibakery`, then complete browser authentication. For on-premise, replace the URL.
{% endtab %}

{% tab title="Codex" %}

```shell
codex mcp add uibakery --url https://cloud.uibakery.io/api/mcp
codex mcp login uibakery
```

{% endtab %}

{% tab title="Cursor" %}

```json
{
  "mcpServers": {
    "uibakery": {
      "url": "https://cloud.uibakery.io/api/mcp"
    }
  }
}
```

Save this as `.cursor/mcp.json` for one project. Save it as `~/.cursor/mcp.json` globally.

Open **Cursor Settings** → **MCP**. Connect `uibakery`, then complete browser authentication. For on-premise, replace the URL.
{% endtab %}
{% endtabs %}

### Agent Capabilities

| Access request       | Scope                 | What it enables                                                                                                                                                   |
| -------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Project management   | `projects:manage`     | View and create apps and modules; inspect and update supported project files and metadata; manage releases and restores; perform Git operations; delete projects. |
| Datasource discovery | `datasources:read`    | View available data sources and inspect their resources and structure. This access is read-only.                                                                  |
| Workspace management | `organization:manage` | View users and invitations; manage invitations, custom roles, and permissions; reset MFA for users.                                                               |

An agent receives only capabilities covered by approved scopes and the authorizing user's UI Bakery permissions. Scopes never bypass UI Bakery project or workspace permissions.

### Example agent tasks

#### **Build and update apps**

You can update your UI Bakery apps directly from your AI agent. Describe the change, wait for the agent to finish, then reload the app in UI Bakery.

```
Add a users table to the "Products Dashboard" app and populate it with data from the "My DB" data source.
```

#### **Manage Git integration**

You can connect projects to Git repositories, create branches, commit changes, and synchronize them.

```
Create a new GitHub repository named "ui-bakery-a" in my account and connect the "A" app to it. Show me the proposed repository and branch settings before applying them.
```

#### **Manage workspace users and roles**

You can create custom roles, configure permissions, and assign roles to workspace users.

```
Create a custom role named "App Viewer" with view-only access to apps "Users", "Products", and "Orders". Assign it to the users listed in the attached "list.xlsx" file.
```

### Permissions and security

* MCP acts on behalf of the authorizing user.
* Existing application and workspace permissions continue to apply.
* Grant clients only the required access groups.
* MCP tool calls are written to UI Bakery audit logs.

{% hint style="danger" %}
Releases, deletes, Git operations, and user or role changes can alter or remove data or access. Review them explicitly before approval.
{% endhint %}

### Troubleshooting

#### The endpoint returns 404 or reports that MCP is disabled

For Cloud, verify the endpoint is exactly `https://cloud.uibakery.io/api/mcp`. For on-premise, follow [Enable MCP server on-premise](https://docs.uibakery.io/on-premise/on-premise-features/mcp-server) and restart the instance after configuration.

#### The OAuth window does not open

Confirm the client supports OAuth for remote MCP servers and uses the public HTTPS endpoint. On-premise administrators should verify `UI_BAKERY_APP_SERVER_NAME` matches the externally reachable host.

#### The connection succeeds, but tools are missing

Check approved scopes and the user's UI Bakery role. Reconnect and authorize only the required additional scope, if necessary.

#### The agent receives a permission denied error

Confirm the authorizing user has the required project or organization permissions. MCP does not elevate access.

### Related documentation

* [Enable MCP server on-premise](/on-premise/additional-configurations/mcp-server.md)
* [Git source control](https://docs.uibakery.io/on-premise/git-source-control)
* [Release management](https://docs.uibakery.io/concepts/workspace-management/app-environments/release-management)
* [Roles in UI Bakery](https://docs.uibakery.io/concepts/workspace-management/roles-in-ui-bakery)
* [Role permissions](https://docs.uibakery.io/concepts/workspace-management/role-permissions)
* [Audit logs](https://docs.uibakery.io/concepts/workspace-management/audit-logs)


---

# 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.uibakery.io/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.
