Skip to content

Commit 454934e

Browse files
committed
docs: add missing Ruby references
1 parent c01c6a6 commit 454934e

1 file changed

Lines changed: 55 additions & 31 deletions

File tree

docs/src/guide/getting-started.md

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ This guide will help you get started with the MCP-UI SDK, which provides tools f
44

55
## Prerequisites
66

7-
- Node.js (v22.x recommended)
8-
- pnpm (v9 or later recommended)
7+
- Node.js (v22.x recommended for the Typescript SDK)
8+
- pnpm (v9 or later recommended for the Typescript SDK)
9+
- Ruby (v3.x recommended for the Ruby SDK)
910

1011
## Installation
1112

13+
This project is a monorepo that includes the server and client SDKs.
14+
15+
### For Typescript SDKs (`@mcp-ui/server` and `@mcp-ui/client`)
16+
1217
1. **Clone the Monorepo**:
1318

1419
```bash
@@ -23,6 +28,26 @@ This guide will help you get started with the MCP-UI SDK, which provides tools f
2328
```
2429
This command installs dependencies for all packages (`shared`, `client`, `server`, `docs`) and links them together using pnpm.
2530

31+
### For Ruby SDK (`mcp_ui_server`)
32+
33+
Add this line to your application's Gemfile:
34+
35+
```ruby
36+
gem 'mcp_ui_server'
37+
```
38+
39+
And then execute:
40+
41+
```bash
42+
$ bundle install
43+
```
44+
45+
Or install it yourself as:
46+
47+
```bash
48+
$ gem install mcp_ui_server
49+
```
50+
2651
## Building Packages
2752
2853
To build all library packages (`shared`, `client`, `server`):
@@ -51,9 +76,9 @@ pnpm run coverage
5176
5277
Once built, you can typically import from the packages as you would with any other npm module, assuming your project is set up to resolve them.
5378
54-
### In a Node.js Project (Server-Side Example)
55-
56-
```typescript
79+
### In a Server-Side Project
80+
::: code-group
81+
```typescript [TypeScript]
5782
// main.ts (your server-side application)
5883
import { createUIResource } from '@mcp-ui/server';
5984
@@ -65,9 +90,23 @@ const resourceBlock = createUIResource({
6590
encoding: 'text',
6691
});
6792
68-
6993
// Send this resourceBlock as part of your MCP response...
7094
```
95+
```ruby [Ruby]
96+
# main.rb (your server-side application)
97+
require 'mcp_ui_server'
98+
99+
my_html_payload = "<h1>Hello from Server!</h1><p>Timestamp: #{Time.now.iso8601}</p>"
100+
101+
resource_block = McpUiServer.create_ui_resource(
102+
uri: 'ui://server-generated/item1',
103+
content: { type: :raw_html, htmlString: my_html_payload },
104+
encoding: :text
105+
)
106+
107+
# Send this resource_block as part of your MCP response...
108+
```
109+
:::
71110
72111
### In a React Project (Client-Side Example)
73112
@@ -155,27 +194,6 @@ Next, explore the specific guides for each SDK package to learn more about their
155194

156195
To build specifically this package from the monorepo root:
157196

158-
```bash
159-
pnpm build -w @mcp-ui/server
160-
```
161-
162-
Explore the server-side SDK's practical examples for creating UI resources:
163-
164-
<div class="language-code-blocks">
165-
<div class="language-typescript">
166-
167-
[View TypeScript Usage & Examples](./server/typescript/usage-examples.md)
168-
169-
</div>
170-
<div class="language-ruby">
171-
172-
[View Ruby Usage & Examples](./server/ruby/usage-examples.md)
173-
174-
</div>
175-
</div>
176-
177-
To build specifically this package from the monorepo root:
178-
179197
```bash
180198
pnpm build -w @mcp-ui/client
181199
```
@@ -184,7 +202,9 @@ See the following pages for more details:
184202

185203
## Basic Setup
186204

187-
For MCP servers, ensure you have `@mcp-ui/server` available in your Node.js project. If you're working outside this monorepo, you would typically install them.
205+
For MCP servers, you can use one of the server-side SDKs:
206+
- **`@mcp-ui/server`** for Node.js projects
207+
- **`mcp_ui_server`** for Ruby projects
188208

189209
For MCP clients, ensure `@mcp-ui/client` and its peer dependencies (`react` and potentially `@modelcontextprotocol/sdk`) are installed in your React project.
190210

@@ -194,11 +214,14 @@ npm i @mcp-ui/client
194214

195215
## Key Components
196216

197-
### Server Side (`@mcp-ui/server`)
198-
- **`createUIResource`**: Creates UI resource objects for MCP tool responses
217+
### Server-Side SDKs
218+
- **`@mcp-ui/server` (TypeScript)**:
219+
- **`createUIResource`**: Creates UI resource objects for MCP tool responses
220+
- **`mcp_ui_server` (Ruby)**:
221+
- **`McpUiServer.create_ui_resource`**: Creates UI resource objects for MCP tool responses
199222
- Handles HTML content, external URLs, Remote DOM JS, and encoding options
200223

201-
### Client Side (`@mcp-ui/client`)
224+
### Client-Side (`@mcp-ui/client`)
202225
- **`<UIResourceRenderer />`**: Main component for rendering all types of MCP-UI resources
203226
- **`<HTMLResourceRenderer />`**: Internal component for HTML resources
204227
- **`<RemoteDOMResourceRenderer />`**: Internal component for Remote DOM resources
@@ -223,3 +246,4 @@ All resource types are handled automatically by `<UIResourceRenderer />`.
223246
- **Protocol & Components**:
224247
- [Protocol Details](./protocol-details.md)
225248
- [UIResourceRenderer Component](./client/resource-renderer.md)
249+

0 commit comments

Comments
 (0)