You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mcp-use/README.md
+98-1Lines changed: 98 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -532,7 +532,104 @@ server.listen(3000)
532
532
|**♻️ Hot Reload**| Development mode with automatic reloading |
533
533
|**📊 Observability**| Built-in logging and monitoring capabilities |
534
534
535
-
### Building UI Widgets
535
+
### MCP-UI Resources
536
+
537
+
MCP-Use provides a unified `uiResource()` method for registering interactive UI widgets that are compatible with MCP-UI clients. This automatically creates both a tool (for dynamic parameters) and a resource (for static access).
538
+
539
+
#### Quick Start
540
+
541
+
```ts
542
+
import { createMCPServer } from'mcp-use/server'
543
+
544
+
const server =createMCPServer('my-server', { version: '1.0.0' })
545
+
546
+
// Register a widget - creates both tool and resource automatically
547
+
server.uiResource({
548
+
type: 'externalUrl',
549
+
name: 'kanban-board',
550
+
widget: 'kanban-board',
551
+
title: 'Kanban Board',
552
+
description: 'Interactive task management board',
553
+
props: {
554
+
initialTasks: {
555
+
type: 'array',
556
+
description: 'Initial tasks',
557
+
required: false
558
+
},
559
+
theme: {
560
+
type: 'string',
561
+
default: 'light'
562
+
}
563
+
},
564
+
size: ['900px', '600px']
565
+
})
566
+
567
+
server.listen(3000)
568
+
```
569
+
570
+
This automatically creates:
571
+
-**Tool**: `ui_kanban-board` - Accepts parameters and returns UIResource
572
+
-**Resource**: `ui://widget/kanban-board` - Static access with defaults
0 commit comments