MCP Apps for 23blocks API blocks. Each block (Forms, Content, Files, Jarvis) gets its own app that provides interactive UIs for AI chatbots.
SINGLE SOURCE OF TRUTH:
/Users/juanpelaez/23blocks/webApps/ai-agents-apps
GitHub: https://github.com/23blocks-OS/ai-agents-apps
MCP Apps is an extension to MCP that allows tools to return rich, interactive UIs. Key concepts:
- Server registers tool with UI metadata:
_meta.ui.resourceUri: "ui://forms/dashboard" - Server serves UI via
ui://scheme: Returns HTML/JS/CSS bundle - Client renders UI in iframe: Sandboxed, secure execution
- Two-way communication: UI can call back to server
┌─────────────────────────────────────────────────────────────────┐
│ 23blocks-OS/ai-agents-apps (PUBLIC) │
│ /Users/juanpelaez/23blocks/webApps/ai-agents-apps │
│ │
│ apps/ │
│ ├── forms-app/ (Forms Block UI) │
│ ├── content-app/ (Content Block UI) │
│ ├── files-app/ (Files Block UI) │
│ └── jarvis-app/ (Jarvis Block UI) │
│ │
│ packages/ │
│ ├── shared-ui/ (Common components) │
│ ├── api-client/ (23blocks API wrapper) │
│ └── mcp-utils/ (MCP Apps utilities) │
└─────────────────────────────────────────────────────────────────┘
Each app follows this structure:
apps/BLOCK-app/
├── package.json
├── tsconfig.json
├── src/
│ ├── server/ # MCP server
│ │ ├── index.ts # Server entry
│ │ ├── tools/ # Tool definitions
│ │ └── resources/ # UI resource handlers
│ └── ui/ # React UI
│ ├── index.html
│ ├── main.tsx
│ ├── App.tsx
│ └── components/
└── vite.config.ts
All API calls MUST use standardized env vars:
BLOCKS_API_KEY # API key (AppId header)
BLOCKS_AUTH_TOKEN # Bearer token
BLOCKS_API_URL # API base URL- MCP Apps SDK:
@modelcontextprotocol/ext-apps - React 18: UI framework
- Vite: Build tool
- TypeScript: Type safety
- pnpm: Package manager (workspaces)
| Repo | Purpose |
|---|---|
23blocks/ai-agents-mono |
Claude Code plugins (skills/agents) |
23blocks-OS/ai-agents |
Public plugin distribution |
23blocks-OS/ai-agents-apps |
MCP Apps (this repo) |
# Go to repo
cd /Users/juanpelaez/23blocks/webApps/ai-agents-apps
# Install deps
pnpm install
# Dev all apps
pnpm dev
# Build all apps
pnpm build
# Build specific app
pnpm --filter forms-app build- Copy
examples/minimal-apptoapps/BLOCK-app - Update
package.jsonname - Implement tools in
src/server/tools/ - Build UI in
src/ui/ - Register in root workspace
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { registerMcpAppsHandlers } from "@modelcontextprotocol/ext-apps";
const server = new McpServer({ name: "forms-app", version: "1.0.0" });
// Register UI handlers
registerMcpAppsHandlers(server);
// Tool with UI
server.tool(
"forms_dashboard",
"Open forms management dashboard",
{},
async () => ({
content: [{ type: "text", text: "Dashboard loaded" }],
_meta: {
ui: { resourceUri: "ui://forms/dashboard" }
}
})
);
// Serve UI resource
server.resource("ui://forms/dashboard", async () => ({
contents: [{
uri: "ui://forms/dashboard",
mimeType: "text/html",
text: "<html>...</html>"
}]
}));