Skip to content

Commit 9773267

Browse files
committed
docs: update core concepts
1 parent 79ed124 commit 9773267

3 files changed

Lines changed: 78 additions & 3 deletions

File tree

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,32 @@ Together, they let you define reusable UI snippets on the server side, seamlessl
4242

4343
## ✨ Core Concepts
4444

45-
The primary component for rendering MCP resources is `<ResourceRenderer />`. It automatically detects the resource type and renders the appropriate component.
45+
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).
46+
47+
### HTML Resource Block
48+
The primary payload returned from the server to the client is the `HtmlResourceBlock`:
49+
50+
```ts
51+
interface HtmlResourceBlock {
52+
type: 'resource';
53+
resource: {
54+
uri: string; // ui://component/id
55+
mimeType: 'text/html' | 'text/uri-list'; // text/html for HTML content, text/uri-list for URL content
56+
text?: string; // Inline HTML or external URL
57+
blob?: string; // Base64-encoded HTML or URL
58+
};
59+
}
60+
```
61+
62+
* **`uri`**: Unique identifier for caching and routing
63+
* `ui://…` — UI resources (rendering method determined by mimeType)
64+
* **`mimeType`**: `text/html` for HTML content (iframe srcDoc), `text/uri-list` for URL content (iframe src)
65+
* **MCP-UI requires a single URL**: While `text/uri-list` format supports multiple URLs, MCP-UI uses only the first valid URL and logs others
66+
* **`text` vs. `blob`**: Choose `text` for simple strings; use `blob` for larger or encoded content.
67+
68+
### Resource Renderer
69+
70+
The HTML Resource Block is rendered in the `<ResourceRenderer />` component. It automatically detects the resource type and renders the appropriate component.
4671

4772
It accepts the following props:
4873
- **`resource`**: The resource object from an MCP response. Should include `uri`, `mimeType`, and content (`text`, `blob`, or `content`)

packages/client/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,32 @@ Together, they let you define reusable UI snippets on the server side, seamlessl
4242

4343
## ✨ Core Concepts
4444

45-
The primary component for rendering MCP resources is `<ResourceRenderer />`. It automatically detects the resource type and renders the appropriate component.
45+
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).
46+
47+
### HTML Resource Block
48+
The primary payload returned from the server to the client is the `HtmlResourceBlock`:
49+
50+
```ts
51+
interface HtmlResourceBlock {
52+
type: 'resource';
53+
resource: {
54+
uri: string; // ui://component/id
55+
mimeType: 'text/html' | 'text/uri-list'; // text/html for HTML content, text/uri-list for URL content
56+
text?: string; // Inline HTML or external URL
57+
blob?: string; // Base64-encoded HTML or URL
58+
};
59+
}
60+
```
61+
62+
* **`uri`**: Unique identifier for caching and routing
63+
* `ui://…` — UI resources (rendering method determined by mimeType)
64+
* **`mimeType`**: `text/html` for HTML content (iframe srcDoc), `text/uri-list` for URL content (iframe src)
65+
* **MCP-UI requires a single URL**: While `text/uri-list` format supports multiple URLs, MCP-UI uses only the first valid URL and logs others
66+
* **`text` vs. `blob`**: Choose `text` for simple strings; use `blob` for larger or encoded content.
67+
68+
### Resource Renderer
69+
70+
The HTML Resource Block is rendered in the `<ResourceRenderer />` component. It automatically detects the resource type and renders the appropriate component.
4671

4772
It accepts the following props:
4873
- **`resource`**: The resource object from an MCP response. Should include `uri`, `mimeType`, and content (`text`, `blob`, or `content`)

packages/server/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,32 @@ Together, they let you define reusable UI snippets on the server side, seamlessl
4242

4343
## ✨ Core Concepts
4444

45-
The primary component for rendering MCP resources is `<ResourceRenderer />`. It automatically detects the resource type and renders the appropriate component.
45+
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).
46+
47+
### HTML Resource Block
48+
The primary payload returned from the server to the client is the `HtmlResourceBlock`:
49+
50+
```ts
51+
interface HtmlResourceBlock {
52+
type: 'resource';
53+
resource: {
54+
uri: string; // ui://component/id
55+
mimeType: 'text/html' | 'text/uri-list'; // text/html for HTML content, text/uri-list for URL content
56+
text?: string; // Inline HTML or external URL
57+
blob?: string; // Base64-encoded HTML or URL
58+
};
59+
}
60+
```
61+
62+
* **`uri`**: Unique identifier for caching and routing
63+
* `ui://…` — UI resources (rendering method determined by mimeType)
64+
* **`mimeType`**: `text/html` for HTML content (iframe srcDoc), `text/uri-list` for URL content (iframe src)
65+
* **MCP-UI requires a single URL**: While `text/uri-list` format supports multiple URLs, MCP-UI uses only the first valid URL and logs others
66+
* **`text` vs. `blob`**: Choose `text` for simple strings; use `blob` for larger or encoded content.
67+
68+
### Resource Renderer
69+
70+
The HTML Resource Block is rendered in the `<ResourceRenderer />` component. It automatically detects the resource type and renders the appropriate component.
4671

4772
It accepts the following props:
4873
- **`resource`**: The resource object from an MCP response. Should include `uri`, `mimeType`, and content (`text`, `blob`, or `content`)

0 commit comments

Comments
 (0)