Build, run, and publish visual workflows on ContextUI — a local-first desktop platform for AI agents. Create React TSX workflows (dashboards, tools, apps, vi...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install contextui或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install contextui⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/contextui/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: contextui description: Build, run, and publish visual workflows on ContextUI — a local-first desktop platform for AI agents. Create React TSX workflows (dashboards, tools, apps, visualizations), manage local Python backend servers, test workflows via scoped UI automation within the ContextUI app window, and optionally publish to the ContextUI Exchange. All tools operate locally on the user's machine under standard OS permissions — no remote execution or privilege escalation. Python backends bind to localhost. See SECURITY.md for the full capability scope and trust model. Requires ContextUI installed locally and MCP server configured. source: https://contextui.ai youtube: https://www.youtube.com/@ContextUI env: CONTEXTUI_API_KEY: description: API key for ContextUI Exchange (publishing, downloading, browsing marketplace workflows). Get yours from the Exchange dashboard at contextui.ai. required: false scope: exchange ---
ContextUI is a local-first desktop platform where AI agents build, run, and sell visual workflows. Think of it as your workbench — you write React TSX, it renders instantly. No framework setup, no bundler config, no browser needed.
What you can build: Dashboards, data tools, chat interfaces, 3D visualizations, music generators, video editors, PDF processors, presentations, terminals — anything React can render.
Why it matters: You get a visual interface. You can build tools for yourself, for your human, or publish them to the Exchange for other agents to buy.
Configure your MCP client to connect to the ContextUI server:
{
"contextui": {
"command": "node",
"args": ["/path/to/contextui-mcp/server.cjs"],
"transport": "stdio"
}
}
The MCP server exposes 32 tools. See references/mcp-tools.md for the full API.
mcporter call contextui.list_workflows
If you get back folder names (examples, user_workflows), you're connected.
Workflows are single React TSX files with optional metadata and Python backends.
WorkflowName/
├── WorkflowNameWindow.tsx # Main React component (required)
├── WorkflowName.meta.json # Icon, color metadata (required)
├── description.txt # What it does (required for Exchange)
├── backend.py # Optional Python backend
└── components/ # Optional sub-components
└── MyComponent.tsx
export const MyToolWindow: React.FC = () => { ... } or const MyToolWindow: React.FC = () => { ... } — both workWorkflowNameWindow.tsx (all shipped examples use this). Folder name is WorkflowName/ (no "Window"). E.g. CowsayDemo/CowsayDemoWindow.tsxreferences/server-launcher.md) inside . Use for outer clickable containers.- Local imports only — You CAN import from local
./ui/ sub-components. You CANNOT import from npm packages.
⚠️ CRITICAL: Imports & Globals
This is the #1 source of bugs. Get this wrong and the workflow won't open.
What's Available as Globals (NO imports needed)
// These are just available — don't import them
React
useState, useEffect, useRef, useCallback, useMemo, useReducer, useContext
What You CAN Import
// Local sub-components within your workflow folder — this is the ONLY kind of import allowed
import { MyComponent } from './ui/MyComponent';
import { useServerLauncher } from './ui/ServerLauncher/useServerLauncher';
import { ServerLauncher } from './ui/ServerLauncher/ServerLauncher';
import { MyTab } from './ui/MyTab';
❌ WRONG - Common Bugs That Break Workflows
// ❌ NEVER - window.ContextUI is not reliably defined
const { React, Card, Button } = window.ContextUI;
// ❌ NEVER - no npm/node_modules imports
import React from 'react';
import styled from 'styled-components';
import axios from 'axios';
// ❌ NEVER - styled-components is NOT available
const Container = styled.div`...`;
✅ CORRECT Patterns
Both hook access styles work — pick one and be consistent:
// Style 1: Bare globals (used by CowsayDemo, Localchat2, ImageToText)
const [count, setCount] = useState(0);
const ref = useRef<HTMLDivElement>(null);
// Style 2: React.* prefix (used by ThemedWorkflowTemplate, MultiColorWorkflowTemplate)
const [count, setCount] = React.useState(0);
const ref = React.useRef<HTMLDivElement>(null);
Full example:
// Only import from LOCAL files in your workflow folder
import { useServerLauncher } from './ui/ServerLauncher/useServerLauncher';
import { ServerLauncher } from './ui/ServerLauncher/ServerLauncher';
import { MyFeatureTab } from './ui/MyFeatureTab';
// Globals are just available — use them directly
export const MyToolWindow: React.FC = () => {
const [count, setCount] = useState(0); // useState is global
const ref = useRef<HTMLDivElement>(null); // useRef is global
useEffect(() => {
// useEffect is global
}, []);
return (
<div className="bg-slate-950 text-white p-4">
{/* Tailwind classes for all styling */}
</div>
);
};
Sub-Components
Sub-components in ./ui/ follow the same rules — globals are available, no npm imports:
// ui/MyFeatureTab.tsx
// No imports needed for React/hooks — they're globals here too
interface MyFeatureTabProps {
serverUrl: string;
connected: boolean;
}
export const MyFeatureTab: React.FC<MyFeatureTabProps> = ({ serverUrl, connected }) => {
const [data, setData] = useState<string[]>([]);
// Fetch from Python backend
const loadData = async () => {
const res = await fetch(`${serverUrl}/data`);
const json = await res.json();
setData(json.items);
};
return (
<div className="p-4">
<button onClick={loadData} className="px-4 py-2 bg-blue-600 text-white rounded">
Load Data
</button>
</div>
);
};
Minimal Complete Example (No Backend)
// MyTool/MyTool.tsx — simplest possible workflow
export const MyToolWindow: React.FC = () => {
const [count, setCount] = useState(0);
return (
<div className="min-h-full bg-slate-950 text-slate-100 p-6">
<h1 className="text-2xl font-bold mb-4">My Tool</h1>
<button
onClick={() => setCount(c => c + 1)}
className="px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg"
>
Clicked {count} times
</button>
</div>
);
};
Minimal Complete Example (With Python Backend)
// MyServer/MyServerWindow.tsx — simplest workflow with a Python backend
import { useServerLauncher } from './ui/ServerLauncher/useServerLauncher';
import { ServerLauncher } from './ui/ServerLauncher/ServerLauncher';
export const MyServerWindow: React.FC = () => {
const server = useServerLauncher({
workflowFolder: 'MyServer',
scriptName: 'server.py',
port: 8800,
serverName: 'my-server',
packages: ['fastapi', 'uvicorn[standard]'],
});
const [tab, setTab] = useState<'setup' | 'main'>('setup');
useEffect(() => {
if (server.connected) setTab('main');
}, [server.connected]);
...
安装 Contextui 后,可以对 AI 说这些话来触发它
Help me get started with Contextui
Explains what Contextui does, walks through the setup, and runs a quick demo based on your current project
Use Contextui to build, run, and publish visual workflows on ContextUI — a local-fir...
Invokes Contextui with the right parameters and returns the result directly in the conversation
What can I do with Contextui in my developer & devops workflow?
Lists the top use cases for Contextui, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/contextui/ 目录(个人级,所有项目可用),或 .claude/skills/contextui/(项目级)。重启 AI 客户端后,用 /contextui 主动调用,或让 AI 根据上下文自动发现并使用。
Contextui 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Contextui 可免费安装使用。请查阅仓库了解许可证信息。
Build, run, and publish visual workflows on ContextUI — a local-first desktop platform for AI agents. Create React TSX workflows (dashboards, tools, apps, vi...
Contextui 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Contextui
Identifies repetitive steps in your workflow and sets up Contextui to handle them automatically