Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,60 @@ make dev # Start all services

You can also use `pnpm` directly (`pnpm dev`, `pnpm dev:app`, `pnpm dev:agent`, etc.).

## MCP Server (Self-Hosted)

The repo includes a standalone [Model Context Protocol](https://modelcontextprotocol.io) server that exposes the design system, skill instructions, and an HTML document assembler to any MCP-compatible client — including Claude Desktop, Claude Code, and Cursor.

### What it provides

- **`assemble_document` tool** — wraps HTML fragments with the full design system CSS and bridge JS, returning an iframe-ready document
- **Skill resources** — browse and read skill instruction documents (`skills://list`, `skills://{name}`)
- **Prompt templates** — pre-composed prompts for widgets, SVG diagrams, and advanced visualizations

### Claude Desktop (stdio)

Add to your Claude Desktop config (`claude_desktop_config.json`):

```json
{
"mcpServers": {
"open-generative-ui": {
"command": "node",
"args": ["dist/stdio.js"],
"cwd": "/path/to/apps/mcp"
}
}
}
```

### Claude Code / HTTP clients

```bash
# Start the HTTP server
cd apps/mcp && pnpm dev
```

Add to `.mcp.json`:

```json
{
"openGenerativeUI": {
"url": "http://localhost:3100/mcp"
}
}
```

See [apps/mcp/README.md](apps/mcp/README.md) for full configuration, Docker deployment, and API reference.

## Architecture

Turborepo monorepo with two apps:
Turborepo monorepo with three packages:

```
apps/
├── app/ Next.js 16 frontend (CopilotKit v2, React 19, Tailwind 4)
└── agent/ LangGraph Python agent (GPT-5.4, CopilotKit middleware)
├── agent/ LangGraph Python agent (GPT-5.4, CopilotKit middleware)
└── mcp/ Standalone MCP server (design system + skills + document assembler)
```

### How It Works
Expand Down
9 changes: 9 additions & 0 deletions apps/mcp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
npm-debug.log
.git
.gitignore
README.md
.env.example
.DS_Store
dist/
.turbo/
12 changes: 12 additions & 0 deletions apps/mcp/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Server Configuration
MCP_PORT=3100
NODE_ENV=development

# CORS (comma-separated origins, default: * for development)
ALLOWED_ORIGINS=*

# Skills directory (default: ./skills relative to package root)
SKILLS_DIR=./skills

# Logging
LOG_LEVEL=info
11 changes: 11 additions & 0 deletions apps/mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/
dist/
.env
.env.local
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
.turbo/
.venv/
53 changes: 53 additions & 0 deletions apps/mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Multi-stage build for production
FROM node:20-alpine AS builder

WORKDIR /app

# Install build dependencies
RUN apk add --no-cache python3 make g++

# Copy package files
COPY package.json pnpm-lock.yaml ./

# Install pnpm
RUN npm install -g pnpm@9

# Install dependencies
RUN pnpm install --frozen-lockfile

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: --prod flag breaks the build step

--prod skips devDependencies, but tsc (used on line 23 via pnpm build) is listed under devDependencies. This Docker build will fail at the RUN pnpm build step.

Should be:

RUN pnpm install --frozen-lockfile

Or split into two stages — full install for build, then prune to prod for the runtime image.

# Copy source
COPY tsconfig.json ./
COPY src ./src
COPY skills ./skills

# Build
RUN pnpm build

# Production image
FROM node:20-alpine

WORKDIR /app

# Install dumb-init for proper signal handling
RUN apk add --no-cache dumb-init

# Copy built application from builder
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/skills ./skills
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./

# Non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001

USER nodejs

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:${MCP_PORT:-3100}/health || exit 1

EXPOSE 3100

ENTRYPOINT ["/sbin/dumb-init", "--"]
CMD ["node", "dist/index.js"]
Loading
Loading