mcp-ui

MCP运维云端

提供方 jkk75

运维云端 stdio · 本地进程 未标注 社区 / 第三方 VS CodeZed
查看接入方式

mcp-ui is an SDK collection providing interactive web components for the Model Context Protocol (MCP), enabling server-side UI snippet definition and secure client-side rendering, ideal for enhanced AI interaction scenarios.

一句话选型结论

按资料字段整理

mcp-ui 属于运维云端类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,可直接接入 VS Code、Zed,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

Local Deployment UI Components MCP Protocol TypeScript Interactive Interface Multi-language SDK Remote DOM

支持客户端

适用场景

Local DeploymentUI ComponentsMCP Protocol

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
# using pip pip install mcp-ui-server # or uv uv add mcp-ui-server

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 VS Code、Zed,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 VS Code、Zed 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
mcp-ui当前 未标注 stdio · 本地进程 本地部署 有 2026-02-28
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方jkk75上游标注的维护方 jkk75
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-02-28上游最后核验时间

详细介绍

16.1 KB
来自项目仓库与上游目录的原文,未做删改

📦 Model Context Protocol UI SDK

What's mcp-ui? •
Core Concepts •
Installation •
Getting Started •
Walkthrough •
Examples •
Supported Hosts •
Security •
Roadmap •
Contributing •


mcp-ui brings interactive web components to the Model Context Protocol (MCP). Deliver rich, dynamic UI resources directly from your MCP server to be rendered by the client. Take AI interaction to the next level!

> This project is an experimental community playground for MCP UI ideas. Expect rapid iteration and enhancements!

💡 What's mcp-ui?

mcp-ui is a playground for the open spec of UI over MCP. It offers a collection of community SDKs comprising:

  • @mcp-ui/server (TypeScript): Utilities to generate UI resources (UIResource) on your MCP server.
  • @mcp-ui/client (TypeScript): UI components (e.g., ``) to render the UI resources and handle their events.
  • mcp_ui_server (Ruby): Utilities to generate UI resources on your MCP server in a Ruby environment.
  • mcp-ui-server (Python): Utilities to generate UI resources on your MCP server in a Python environment.

Together, they let you define reusable UI snippets on the server side, seamlessly and securely render them in the client, and react to their actions in the MCP host environment.

✨ Core Concepts

In essence, by using mcp-ui SDKs, servers and hosts can agree on contracts that enable them to create and render interactive UI snippets (as a path to a standardized UI approach in MCP).

UI Resource

The primary payload returned from the server to the client is the UIResource:```ts
interface UIResource {
type: 'resource';
resource: {
uri: string; // e.g., ui://component/id
mimeType: 'text/html' | 'text/uri-list' | 'application/vnd.mcp-ui.remote-dom'; // text/html for HTML content, text/uri-list for URL content, application/vnd.mcp-ui.remote-dom for remote-dom content (Javascript)
text?: string; // Inline HTML, external URL, or remote-dom script
blob?: string; // Base64-encoded HTML, URL, or remote-dom script
};
}


* **`uri`**: Unique identifier for caching and routing
  * `ui://…` — UI resources (rendering method determined by mimeType)
* **`mimeType`**: `text/html` for HTML content (iframe srcDoc), `text/uri-list` for URL content (iframe src), `application/vnd.mcp-ui.remote-dom` for remote-dom content (Javascript)
  * **MCP-UI requires a single URL**: While `text/uri-list` format supports multiple URLs, MCP-UI uses only the first valid `http/s` URL and warns if additional URLs are found
* **`text` vs. `blob`**: Choose `text` for simple strings; use `blob` for larger or encoded content.

### Resource Renderer

The UI Resource is rendered in the `` component. It automatically detects the resource type and renders the appropriate component.

It is available as a React component and as a Web Component.

**React Component**

It accepts the following props:
- **`resource`**: The resource object from an MCP Tool response. It must include `uri`, `mimeType`, and content (`text`, `blob`)
- **`onUIAction`**: Optional callback for handling UI actions from the resource:```typescript
  { type: 'tool', payload: { toolName: string, params: Record<string, unknown> }, messageId?: string } |
  { type: 'intent', payload: { intent: string, params: Record<string, unknown> }, messageId?: string } |
  { type: 'prompt', payload: { prompt: string }, messageId?: string } |
  { type: 'notify', payload: { message: string }, messageId?: string } |
  { type: 'link', payload: { url: string }, messageId?: string }
  ```
  When actions include a `messageId`, the iframe automatically receives response messages for asynchronous handling.
- **`supportedContentTypes`**: Optional array to restrict which content types are allowed (`['rawHtml', 'externalUrl', 'remoteDom']`)
- **`htmlProps`**: Optional props for the internal ``
  - **`style`**: Optional custom styles for the iframe
  - **`iframeProps`**: Optional props passed to the iframe element
  - **`iframeRenderData`**: Optional `Record` to pass data to the iframe upon rendering. This enables advanced use cases where the parent application needs to provide initial state or configuration to the sandboxed iframe content.
  - **`autoResizeIframe`**: Optional `boolean | { width?: boolean; height?: boolean }` to automatically resize the iframe to the size of the content.
- **`remoteDomProps`**: Optional props for the internal ``
  - **`library`**: Optional component library for Remote DOM resources (defaults to `basicComponentLibrary`)
  - **`remoteElements`**: remote element definitions for Remote DOM resources.

**Web Component**

The Web Component is available as ``. It accepts the same props as the React component, but they must be passed as strings.

Example:```html
<ui-resource-renderer
  resource='{ "mimeType": "text/html", "text": "<h2>Hello from the Web Component!</h2>" }'
></ui-resource-renderer>

The onUIAction prop can be handled by attaching an event listener to the component:```javascript
const renderer = document.querySelector('ui-resource-renderer');
renderer.addEventListener('onUIAction', (event) => {
console.log('Action:', event.detail);
});


The Web Component is available in the `@mcp-ui/client` package at `dist/ui-resource-renderer.wc.js`.

### Supported Resource Types

#### HTML (`text/html` and `text/uri-list`)

Rendered using the internal `` component, which displays content inside an ``. This is suitable for self-contained HTML or embedding external apps.

*   **`mimeType`**:
    *   `text/html`: Renders inline HTML content.
    *   `text/uri-list`: Renders an external URL. MCP-UI uses the first valid `http/s` URL.

#### Remote DOM (`application/vnd.mcp-ui.remote-dom`)

Rendered using the internal `` component, which utilizes Shopify's `remote-dom`. The server responds with a script that describes the UI and events. On the host, the script is securely rendered in a sandboxed iframe, and the UI changes are communicated to the host in JSON, where they're rendered using the host's component library. This is more flexible than iframes and allows for UIs that match the host's look-and-feel.

* **`mimeType`**: `application/vnd.mcp-ui.remote-dom+javascript; framework={react | webcomponents}`

### UI Action

UI snippets must be able to interact with the agent. In `mcp-ui`, this is done by hooking into events sent from the UI snippet and reacting to them in the host (see `onUIAction` prop). For example, an HTML may trigger a tool call when a button is clicked by sending an event which will be caught handled by the client.

### Platform Adapters

MCP-UI SDKs includes adapter support for host-specific implementations, enabling your open MCP-UI widgets to work seamlessly regardless of host. Adapters automatically translate between MCP-UI's `postMessage` protocol and host-specific APIs. Over time, as hosts become compatible with the open spec, these adapters wouldn't be needed.

#### Available Adapters

##### Apps SDK Adapter

For Apps SDK environments (e.g., ChatGPT), this adapter translates MCP-UI protocol to Apps SDK API calls (e.g., `window.openai`).

**How it Works:**
- Intercepts MCP-UI `postMessage` calls from your widgets
- Translates them to appropriate Apps SDK API calls
- Handles bidirectional communication (tools, prompts, state management)
- Works transparently - your existing MCP-UI code continues to work without changes

**Usage:**```ts
import { createUIResource } from '@mcp-ui/server';

const htmlResource = createUIResource({
  uri: 'ui://greeting/1',
  content: {
    type: 'rawHtml',
    htmlString: `
      <button onclick="window.parent.postMessage({ type: 'tool', payload: { toolName: 'myTool', params: {} } }, '*')">
        Call Tool
      </button>
    `
  },
  encoding: 'text',
  // Enable adapters
  adapters: {
    appsSdk: {
      enabled: true,
      config: ...
    }
    // Future adapters can be enabled here
  }
});

Supported Actions:
- ✅ Tool calls - { type: 'tool', payload: { toolName, params } }
- ✅ Prompts - { type: 'prompt', payload: { prompt } }
- ✅ Intents - { type: 'intent', payload: { intent, params } } (converted to prompts)
- ✅ Notifications - { type: 'notify', payload: { message } }
- ✅ Render data - Access to toolInput, toolOutput, widgetState, theme, locale
- ⚠️ Links - { type: 'link', payload: { url } } (may not be supported, returns error in some environments)

Advanced Usage

You can manually wrap HTML with adapters or access adapter scripts directly:```ts
import { wrapHtmlWithAdapters, getAppsSdkAdapterScript } from '@mcp-ui/server';

// Manually wrap HTML with adapters
const wrappedHtml = wrapHtmlWithAdapters(
'<button>Click me</button>',
{
appsSdk: {
enabled: true,
config: { intentHandling: 'ignore' }
}
}
);

// Get a specific adapter script
const appsSdkScript = getAppsSdkAdapterScript({ timeout: 60000 });


## 🏗️ Installation

### TypeScript```bash
# using npm
npm install @mcp-ui/server @mcp-ui/client

# or pnpm
pnpm add @mcp-ui/server @mcp-ui/client

# or yarn
yarn add @mcp-ui/server @mcp-ui/client

Ruby```bash

gem install mcp_ui_server


### Python```bash
# using pip
pip install mcp-ui-server

# or uv
uv add mcp-ui-server

🚀 Getting Started

You can use GitMCP to give your IDE access to mcp-ui's latest documentation!

TypeScript

  1. Server-side: Build your UI resources```ts
    import { createUIResource } from '@mcp-ui/server';
    import {
    createRemoteComponent,
    createRemoteDocument,
    createRemoteText,
    } from '@remote-dom/core';

// Inline HTML
const htmlResource = createUIResource({
uri: 'ui://greeting/1',
content: { type: 'rawHtml', htmlString: '<p>Hello, MCP UI!</p>' },
encoding: 'text',
});

// External URL
const externalUrlResource = createUIResource({
uri: 'ui://greeting/1',
content: { type: 'externalUrl', iframeUrl: 'https://example.com' },
encoding: 'text',
});

// remote-dom
const remoteDomResource = createUIResource({
uri: 'ui://remote-component/action-button',
content: {
type: 'remoteDom',
script: const button = document.createElement(&#x27;ui-button&#x27;); button.setAttribute(&#x27;label&#x27;, &#x27;Click me for a tool call!&#x27;); button.addEventListener(&#x27;press&#x27;, () =&gt; { window.parent.postMessage({ type: &#x27;tool&#x27;, payload: { toolName: &#x27;uiInteraction&#x27;, params: { action: &#x27;button-click&#x27;, from: &#x27;remote-dom&#x27; } } }, &#x27;*&#x27;); }); root.appendChild(button);,
framework: 'react', // or 'webcomponents'
},
encoding: 'text',
});
```

  1. Client-side: Render in your MCP host```tsx
    import React from 'react';
    import { UIResourceRenderer } from '@mcp-ui/client';

function App({ mcpResource }) {
if (
mcpResource.type === 'resource' &&
mcpResource.resource.uri?.startsWith('ui://')
) {
return (
<UIResourceRenderer
resource={mcpResource.resource}
onUIAction={(result) => {
console.log('Action:', result);
}}
/>
);
}
return <p>Unsupported resource</p>;
}
```

Python

Server-side: Build your UI resources```python
from mcp_ui_server import create_ui_resource

# Inline HTML
html_resource = create_ui_resource({
"uri": "ui://greeting/1",
"content": { "type": "rawHtml", "htmlString": "<p>Hello, from Python!</p>" },
"encoding": "text",
})

# External URL
external_url_resource = create_ui_resource({
"uri": "ui://greeting/2",
"content": { "type": "externalUrl", "iframeUrl": "https://example.com" },
"encoding": "text",
})
```

Ruby

Server-side: Build your UI resources```ruby
require 'mcp_ui_server'

# Inline HTML
html_resource = McpUiServer.create_ui_resource(
uri: 'ui://greeting/1',
content: { type: :raw_html, htmlString: '<p>Hello, from Ruby!</p>' },
encoding: :text
)

# External URL
external_url_resource = McpUiServer.create_ui_resource(
uri: 'ui://greeting/2',
content: { type: :external_url, iframeUrl: 'https://example.com' },
encoding: :text
)

# remote-dom
remote_dom_resource = McpUiServer.create_ui_resource(
uri: 'ui://remote-component/action-button',
content: {
type: :remote_dom,
script: "
const button = document.createElement('ui-button');
button.setAttribute('label', 'Click me from Ruby!');
button.addEventListener('press', () => {
window.parent.postMessage({ type: 'tool', payload: { toolName: 'uiInteraction', params: { action: 'button-click', from: 'ruby-remote-dom' } } }, '*');
});
root.appendChild(button);
",
framework: :react,
},
encoding: :text
)
```

🚶 Walkthrough

For a detailed, simple, step-by-step guide on how to integrate mcp-ui into your own server, check out the full server walkthroughs on the mcp-ui documentation site:

  • TypeScript Server Walkthrough
  • Ruby Server Walkthrough
  • Python Server Walkthrough

These guides will show you how to add a mcp-ui endpoint to an existing server, create tools that return UI resources, and test your setup with the ui-inspector!

🌍 Examples

Client Examples
* Goose - open source AI agent that supports mcp-ui.
* LibreChat - enhanced ChatGPT clone that supports mcp-ui.
* ui-inspector - inspect local mcp-ui-enabled servers.
* MCP-UI Chat - interactive chat built with the mcp-ui client. Check out the hosted version!
* MCP-UI RemoteDOM Playground (examples/remote-dom-demo) - local demo app to test RemoteDOM resources
* MCP-UI Web Component Demo (examples/wc-demo) - local demo app to test the Web Component integration in hosts

Server Examples
* TypeScript: A full-featured server that is deployed to a hosted environment for easy testing.
* typescript-server-demo: A simple Typescript server that demonstrates how to generate UI resources.
* server: A full-featured Typescript server that is deployed to a hosted Cloudflare environment for easy testing.
* HTTP Streaming: https://remote-mcp-server-authless.idosalomon.workers.dev/mcp
* SSE: https://remote-mcp-server-authless.idosalomon.workers.dev/sse
* Ruby: A barebones demo server that shows how to use mcp_ui_server and mcp gems together.
* Python: A simple demo server that shows how to use the mcp-ui-server Python package.
* XMCP - Typescript MCP framework with mcp-ui starter example.

Drop those URLs into any MCP-compatible host to see mcp-ui in action. For a supported local inspector, see the ui-inspector.

💻 Supported Hosts

mcp-ui is supported by a growing number of MCP-compatible clients. Feature support varies by host:

Host · Rendering · UI Actions · Notes
Nanobot · ✅ · ✅
ChatGPT · ✅ · ⚠️ · Guide
Postman · ✅ · ⚠️
Goose · ✅ · ⚠️
LibreChat · ✅ · ⚠️
Smithery · ✅ · ❌
MCPJam · ✅ · ✅
fast-agent · ✅ · ❌
VSCode (TBA) · ? · ?

Legend:
- ✅: Supported
- ⚠️: Partial Support
- ❌: Not Supported (yet)

🔒 Security

Host and user security is one of mcp-ui's primary concerns. In all content types, the remote code is executed in a sandboxed iframe.

🛣️ Roadmap

  • [X] Add online playground
  • [X] Expand UI Action API (beyond tool calls)
  • [X] Support Web Components
  • [X] Support Remote-DOM
  • [ ] Add component libraries (in progress)
  • [ ] Add SDKs for additional programming languages (in progress; Ruby, Python available)
  • [ ] Support additional frontend frameworks
  • [ ] Explore providing a UI SDK (in addition to the client and server one)
  • [ ] Add declarative UI content type
  • [ ] Support generative UI?

Core Team

mcp-ui is a project by Ido Salomon, in collaboration with Liad Yosef.

🤝 Contributing

Contributions, ideas, and bug reports are welcome! See the contribution guidelines to get started.

📄 License

Apache License 2.0 © The MCP-UI Authors

Disclaimer

This project is provided "as is", without warranty of any kind. The mcp-ui authors and contributors shall not be held liable for any damages, losses, or issues arising from the use of this software. Use at your own risk.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
mcp-ui 怎么安装?

在客户端按下面的安装命令接入:# using pip pip install mcp-ui-server # or uv uv add mcp-ui-server。装完在客户端配置里引用同一个包或端点。

mcp-ui 怎么在 VS Code、Zed 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

mcp-ui 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

mcp-ui 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

mcp-ui 支持哪些客户端?

资料标注支持 VS Code、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

mcp-ui 能提供哪些能力?

资料显示能力标签包括 Local Deployment、UI Components、MCP Protocol、TypeScript、Interactive Interface、Multi-language SDK。具体工具清单以官方文档为准。

mcp-ui 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

mcp-ui 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-02-28。