### Install Dependencies and Setup Source: https://github.com/copilotkit/opengenerativeui/blob/main/README.md Use these commands to install dependencies and set up the project environment. Ensure you edit the .env file with your OpenAI API key. ```bash make setup # Install deps + create .env template # Edit apps/agent/.env with your real OpenAI API key make dev # Start all services ``` -------------------------------- ### Install and Run MCP Server Source: https://github.com/copilotkit/opengenerativeui/blob/main/apps/mcp/README.md Steps to install dependencies and start the development server for the MCP package. Includes a health check command. ```bash cd apps/mcp pnpm install pnpm dev # → MCP server running on http://localhost:3100/mcp curl http://localhost:3100/health # → {"status":"ok"} ``` -------------------------------- ### Install Dependencies and Setup Source: https://github.com/copilotkit/opengenerativeui/blob/main/CONTRIBUTING.md Use the Makefile to install dependencies and set up the environment, or perform these steps manually. Ensure you add your OpenAI API key to the agent's .env file. ```bash make setup # Installs deps + creates .env template ``` ```bash pnpm install echo 'OPENAI_API_KEY=your-key-here' > apps/agent/.env ``` -------------------------------- ### Agent Service Build and Start Commands Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/deployment.md Commands to install dependencies and start the Python agent service. Ensure the OPENAI_API_KEY environment variable is set. ```bash cd apps/agent pip install uv uv sync uv run uvicorn main:app --host 0.0.0.0 --port 8123 ``` -------------------------------- ### Install and Run Monorepo Source: https://context7.com/copilotkit/opengenerativeui/llms.txt Commands to clone the repository, install dependencies, set up environment variables, and start the development servers for the Next.js frontend and FastAPI backend. ```bash git clone https://github.com/CopilotKit/OpenGenerativeUI.git cd OpenGenerativeUI # Install all deps + create apps/agent/.env template make setup # Edit apps/agent/.env — add OPENAI_API_KEY and optionally LLM_MODEL echo "OPENAI_API_KEY=sk-..." > apps/agent/.env echo "LLM_MODEL=gpt-5.4-2026-03-05" >> apps/agent/.env # Start all services (Next.js :3000, FastAPI :8123) make dev # Start individually make dev-app # Next.js frontend only make dev-agent # Python agent only make dev-mcp # MCP server only (port 3100) ``` -------------------------------- ### Build and Start MCP Server for Production Source: https://github.com/copilotkit/opengenerativeui/blob/main/apps/mcp/README.md Commands to build the project for production and start the server. ```bash pnpm build pnpm start ``` -------------------------------- ### Start Individual Services Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/getting-started.md Optionally, start only the frontend, agent, or MCP server individually using specific make commands. ```bash make dev-app # Frontend only make dev-agent # Agent only make dev-mcp # MCP server only ``` -------------------------------- ### Manual Deployment: Frontend (Node) Source: https://context7.com/copilotkit/opengenerativeui/llms.txt Instructions for manually deploying the frontend service using Node.js and pnpm. This includes installing dependencies, building the application, and starting the server, while setting the `LANGGRAPH_DEPLOYMENT_URL` environment variable. ```bash # Frontend (Node) # From repo root: corepack enable && pnpm install LANGGRAPH_DEPLOYMENT_URL=http://your-agent-host:8123 \ pnpm --filter @repo/app build && \ pnpm --filter @repo/app start ``` -------------------------------- ### Install Frontend Packages with npm Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/bring-to-your-app.md Install the necessary CopilotKit and Zod packages for your React frontend. ```bash npm install @copilotkit/react-core @copilotkit/runtime zod ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/getting-started.md Clone the OpenGenerativeUI repository and install all project dependencies using the provided make command. This also sets up the .env file. ```bash git clone https://github.com/CopilotKit/OpenGenerativeUI.git cd OpenGenerativeUI # Install all dependencies and create .env make setup ``` -------------------------------- ### Run the Project Source: https://github.com/copilotkit/opengenerativeui/blob/main/CONTRIBUTING.md Start all project services (frontend, agent, mcp) using the Makefile, or run them individually. Alternatively, use pnpm commands for more granular control. ```bash make dev # Start all services (frontend + agent + mcp) ``` ```bash make dev-app # Next.js frontend on http://localhost:3000 ``` ```bash make dev-agent # LangGraph agent on http://localhost:8123 ``` ```bash make dev-mcp # MCP server ``` ```bash pnpm dev # All services ``` ```bash pnpm dev:app # Frontend only ``` ```bash pnpm dev:agent # Agent only ``` -------------------------------- ### Frontend Service Build and Start Commands Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/deployment.md Commands to build and start the Node.js frontend service. The LANGGRAPH_DEPLOYMENT_URL must point to the agent service host and port. ```bash # From repo root corepack enable pnpm install pnpm --filter @repo/app build LANGGRAPH_DEPLOYMENT_URL=http://your-agent-host:8123 pnpm --filter @repo/app start ``` -------------------------------- ### Start MCP Server Source: https://github.com/copilotkit/opengenerativeui/blob/main/CLAUDE.md Starts the MCP (Model Context Protocol) server. This is part of the backend infrastructure. ```bash pnpm dev:mcp # MCP server ``` -------------------------------- ### Start Next.js Frontend Source: https://github.com/copilotkit/opengenerativeui/blob/main/CLAUDE.md Starts the Next.js frontend application, typically accessible on port 3000. Use this command for frontend-specific development. ```bash # Start individually pnpm dev:app # Next.js frontend on port 3000 ``` -------------------------------- ### Run Development Server Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/getting-started.md Start the frontend and agent services simultaneously using the make dev command. This makes the application accessible at http://localhost:3000 and the agent at http://localhost:8123. ```bash # Start all services (frontend + agent) make dev ``` -------------------------------- ### Install Python Agent Dependencies Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/bring-to-your-app.md Install the required Python packages for setting up the CopilotKit agent and LangGraph. ```bash pip install copilotkit langgraph langchain langchain-openai fastapi uvicorn ag-ui-langgraph deepagents ``` -------------------------------- ### Start MCP HTTP Server Source: https://github.com/copilotkit/opengenerativeui/blob/main/README.md Start the standalone Model Context Protocol server for self-hosting. This server provides the design system, skill instructions, and an HTML document assembler. ```bash cd apps/mcp && pnpm dev ``` -------------------------------- ### Install Dependencies with pnpm Source: https://github.com/copilotkit/opengenerativeui/blob/main/CLAUDE.md Installs all project dependencies across the monorepo using pnpm. This command should be run at the root of the project. ```bash # Install dependencies (all apps) pnpm install ``` -------------------------------- ### Start All Monorepo Apps Source: https://github.com/copilotkit/opengenerativeui/blob/main/CLAUDE.md Starts all applications within the monorepo, including the Next.js frontend, LangGraph agent, and MCP server. This is a convenient command for running the entire project. ```bash # Start all apps (app, agent, mcp) pnpm dev ``` -------------------------------- ### Start MCP Server (Development) Source: https://github.com/copilotkit/opengenerativeui/blob/main/docs/mcp-integration.md Use this command to start the MCP server with hot reload for development. The server will be available at http://localhost:3100. ```bash make dev-mcp ``` -------------------------------- ### Assemble Document Tool Example Source: https://github.com/copilotkit/opengenerativeui/blob/main/apps/mcp/README.md Example of using the `assemble_document` tool to wrap an HTML fragment with OpenGenerativeUI's design system. The output is a complete HTML document. ```javascript const result = await client.callTool("assemble_document", { title: "Interactive Algorithm Visualizer", description: "Step-by-step visualization of the quicksort algorithm", html: `

Click to start visualization

` }); // result.content[0].text is a complete HTML document // Render in: