This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev- Start development server (Next.js)npm run build- Build for productionnpm run lint- Run ESLintnpx tambo init- Initialize Tambo configuration (creates .env.local)
This is a Next.js application built with the Tambo AI framework for generative UI and Model Context Protocol (MCP) integration.
Tambo Integration (src/lib/tambo.ts)
- Central configuration for Tambo components and tools
componentsarray: Registers UI components that AI can render (Graph, DataCards)toolsarray: Registers functions that AI can execute (canvas operations, MCP servers)- Components use Zod schemas for props validation
State Management
- Zustand store in
src/lib/canvas-storage.tsmanages canvas state - Canvas system allows multiple workspaces with draggable components
- Components are stored with metadata:
componentId,canvasId,_componentType,_inCanvas
Drag & Drop System
- Uses @dnd-kit for canvas interactions
- Components can be dragged between canvases
- Sortable within canvas using vertical list strategy
src/components/ui/components-canvas.tsxhandles all drag/drop logic
MCP (Model Context Protocol)
- Configure MCP servers at
/mcp-configroute - Servers stored in browser localStorage
- Wrapped with
TamboMcpProviderin chat interface - Supports SSE and HTTP MCP servers
src/lib/tambo.ts- Component/tool registrationsrc/lib/canvas-storage.ts- Canvas state managementsrc/tools/canvas-tools.ts- Canvas manipulation tools for AIsrc/components/ui/components-canvas.tsx- Drag/drop canvas UIsrc/components/ui/graph.tsx- Chart component using Rechartssrc/app/chat/page.tsx- Main chat interface
Components registered with Tambo must include:
name: Component identifierdescription: AI guidance for when/how to usecomponent: React componentpropsSchema: Zod schema for props validation
Copy example.env.local to .env.local and add:
NEXT_PUBLIC_TAMBO_API_KEY- Get from tambo.co/dashboard
AI can manipulate canvases through tools in src/tools/canvas-tools.ts:
createCanvas(name)- Create new canvasgetCanvases()- List all canvasesgetCanvasComponents(id)- Get components in canvas
Note: Update/delete canvas tools are commented out due to schema validation issues with Tambo.
This project uses Tambo AI for building AI assistants with generative UI and MCP support.
Documentation: https://docs.tambo.co/llms.txt
CLI: Use npx tambo to add UI components or upgrade. Run npx tambo help to learn more.