⚛️ Client SDK
React components and hooks for seamless frontend integration. Render interactive UI resources with the UIResourceRenderer component and handle UI actions effortlessly.
Build rich, dynamic user interfaces for your MCP applications with TypeScript SDKs that bring UI to AI interactions.
React components and hooks for seamless frontend integration. Render interactive UI resources with the UIResourceRenderer component and handle UI actions effortlessly.
Powerful utilities to construct interactive UI for MCP servers. Create HTML, React, Web Components, and external app UI with ergonomic API.
All remote code executes in sandboxed iframes, ensuring host and user security while maintaining rich interactivity.
Support for multiple content types, including iframes and Remote DOM components that match your host's look-and-feel.
Server Side - Create interactive resources to return in your MCP tool results:
import { createUIResource } from '@mcp-ui/server';
const interactiveForm = createUIResource({
uri: 'ui://user-form/1',
content: {
type: 'externalUrl',
iframeUrl: 'https://yourapp.com'
},
delivery: 'text',
});
Client Side - Render with one component:
import { UIResourceRenderer } from '@mcp-ui/client';
function MyApp({ mcpResource }) {
return (
<UIResourceRenderer
resource={mcpResource.resource}
onUIAction={(action) => {
console.log('User action:', action);
return { status: 'ok' };
}}
/>
);
}