aiworkflow-mcp
Version:
MCP Server for BRD β Miro β Figma β Full-Stack Application Workflow
449 lines (349 loc) β’ 12.3 kB
Markdown
# AIWorkflow MCP Server
**Transform Business Requirements into Full-Stack Applications**
An MCP (Model Context Protocol) server that automates the complete workflow from Business Requirements Document (BRD) to production-ready full-stack applications through Miro visualization and Figma UX design.
## π Features
- **π BRD Parsing** - AI-powered analysis of business requirements documents
- **π¨ Miro Visualization** - Automatic creation of visual requirement boards
- **πΌοΈ Figma Design** - UX design generation from requirements
- **β‘ Full-Stack Generation** - Complete application code generation
- **π€ AI-Enhanced** - Uses GPT-4/Claude for intelligent analysis
- **π§ Customizable** - Flexible tech stack selection
## π Quick Start
**πͺ Windows Users**: Installing via npm? See [WINDOWS_NPM_INSTALL.md](./WINDOWS_NPM_INSTALL.md) first!
### Prerequisites
- Node.js 20.x or higher
- npm or pnpm
- Miro account and API access (see [SETUP_MIRO.md](./SETUP_MIRO.md))
- Figma account and API access (see [SETUP_FIGMA.md](./SETUP_FIGMA.md))
- OpenAI API key (or Anthropic API key)
### Installation
#### Option 1: Install from npm (Recommended)
```bash
npm install -g aiworkflow-mcp
```
**β οΈ Windows Users**: See [WINDOWS_NPM_INSTALL.md](./WINDOWS_NPM_INSTALL.md) for Windows-specific setup instructions.
#### Option 2: Use with npx (No Installation - Most Reliable)
No installation needed! Configure Cursor to use npx (see configuration below).
#### Option 3: Install from Source
1. **Clone and install**
```bash
git clone https://github.com/srivatsanlakshmanan/aiworkflow-mcp.git
cd aiworkflow-mcp
npm install
npm run build
```
### Configuration
Create or edit `~/.cursor/mcp.json` (Windows: `C:\Users\YourName\.cursor\mcp.json`):
#### Recommended: Using npx (Works on All Platforms)
```json
{
"mcpServers": {
"aiworkflow": {
"command": "npx",
"args": ["-y", "aiworkflow-mcp"],
"env": {
"MIRO_ACCESS_TOKEN": "your_token",
"FIGMA_ACCESS_TOKEN": "your_token",
"OPENAI_API_KEY": "your_key"
}
}
}
}
```
**Why npx?** Works reliably on Windows, macOS, and Linux without path issues.
#### Alternative: If installed globally (Linux/macOS)
```json
{
"mcpServers": {
"aiworkflow": {
"command": "aiworkflow-mcp",
"env": {
"MIRO_ACCESS_TOKEN": "your_token",
"FIGMA_ACCESS_TOKEN": "your_token",
"OPENAI_API_KEY": "your_key"
}
}
}
}
```
**β οΈ Note**: This may not work on Windows. Use npx method above instead.
#### If installed from source:
```json
{
"mcpServers": {
"aiworkflow": {
"command": "node",
"args": ["/absolute/path/to/aiworkflow-mcp/dist/index.js"]
}
}
}
```
**Note**: See `.env.example` for all available environment variables.
### Restart Cursor
After configuration, completely close and reopen Cursor to load the MCP server.
## π Complete Setup Guides
### API Setup
1. **Miro API Setup** - See [SETUP_MIRO.md](./SETUP_MIRO.md)
- Create Miro app
- Get access token
- Enable AI features
2. **Figma API Setup** - See [SETUP_FIGMA.md](./SETUP_FIGMA.md)
- Generate personal access token
- Get team ID
- Optional: Set up Figma Plugin
## π οΈ Available MCP Tools
### 1. `parse_brd`
Parse and analyze Business Requirements Documents.
**Input:**
\`\`\`typescript
{
source: string; // File path or text content
sourceType: 'file' | 'text'; // Source type
options?: {
includeAIAnalysis: boolean;
extractDataModels: boolean;
generateComponentSuggestions: boolean;
};
}
\`\`\`
**Output:** Structured BRD data with user stories, requirements, entities, and components.
### 2. `create_miro_board`
Create visual Miro board from parsed BRD.
**Input:**
\`\`\`typescript
{
brdData: ParsedBRD; // From parse_brd tool
options?: {
enableAI: boolean;
autoShare: boolean;
generateFlowDiagrams: boolean;
generateJourneyMaps: boolean;
};
}
\`\`\`
**Output:** Miro board URL and structure data.
### 3. `convert_brd_to_miro_format`
Convert parsed BRD data into a structured format optimized for Miro boards. This tool transforms BRD data into JSON with frames, items (sticky notes, cards), and connectors that can be easily imported into Miro or used with the Miro API.
**Input:**
\`\`\`typescript
{
brdData: ParsedBRD; // From parse_brd tool
options?: {
includeConnectors: boolean; // Include connector relationships between items
includeColors: boolean; // Include color coding for items based on priority/complexity
compactMode: boolean; // Use compact layout with more items per row
};
}
\`\`\`
**Output:** Structured Miro board format with:
- **Frames**: Organized sections (Overview, User Stories, Requirements, Data Entities, Components, Stakeholders, Business Rules)
- **Items**: Sticky notes, cards, and text elements with proper positioning
- **Connectors**: Relationships between items (dependencies, flows, associations)
- **Layout**: Ready-to-use positioning and styling for Miro boards
**Use Case**: Perfect for preparing BRD data before creating Miro boards, or for exporting structured data that can be manually imported into Miro or processed by other tools.
### 4. `export_miro_data`
Export structured data from Miro board.
**Input:**
\`\`\`typescript
{
boardId: string; // Miro board ID
}
\`\`\`
**Output:** Structured data for Figma design generation.
### 5. `generate_figma_design`
Generate Figma UX design specification.
**Input:**
\`\`\`typescript
{
miroData: MiroExportData; // From export_miro_data
options?: {
includeDesignSystem: boolean;
generateResponsive: boolean;
createPrototype: boolean;
componentLibrary: 'custom' | 'material-ui' | 'chakra' | 'tailwind';
};
}
\`\`\`
**Output:** Figma design specification (JSON).
### 6. `select_tech_stack`
Configure technology stack for application.
**Input:**
\`\`\`typescript
{
projectType: 'web' | 'mobile' | 'desktop' | 'fullstack';
frontend: {
framework: 'react' | 'vue' | 'nextjs' | ...;
language: 'typescript' | 'javascript';
styling: 'tailwind' | 'mui' | ...;
};
backend: {
framework: 'express' | 'fastify' | 'django' | ...;
language: 'typescript' | 'python' | ...;
apiStyle: 'rest' | 'graphql' | ...;
};
database: {
type: 'postgresql' | 'mongodb' | 'mysql' | ...;
migrations: boolean;
};
}
\`\`\`
**Output:** Tech stack configuration.
### 7. `generate_application`
Generate complete full-stack application.
**Input:**
\`\`\`typescript
{
brdData: ParsedBRD;
designSpec: FigmaDesignSpec;
techStack: TechStackConfig;
options?: {
includeTests: boolean;
includeDocumentation: boolean;
includeDocker: boolean;
gitInit: boolean;
};
}
\`\`\`
**Output:** Complete project with all files generated.
## π‘ Usage Example
### Full Workflow in Cursor
1. **Parse BRD**
\`\`\`
Use parse_brd tool to analyze my BRD file at ./docs/requirements.pdf
\`\`\`
2. **Convert to Miro Format** (Recommended)
\`\`\`
Use convert_brd_to_miro_format with the parsed BRD data to get structured JSON format that Miro can easily read and understand. This creates organized frames, items, and connectors.
\`\`\`
3. **Create Miro Board**
\`\`\`
Use create_miro_board with the parsed BRD data (or the converted Miro format) to visualize requirements on a Miro board
\`\`\`
4. **Generate Figma Design**
\`\`\`
Use export_miro_data for board [board-id], then generate_figma_design with Tailwind component library
\`\`\`
5. **Select Tech Stack**
\`\`\`
Use select_tech_stack with React + TypeScript + Tailwind for frontend, Express + TypeScript for backend, and PostgreSQL for database
\`\`\`
6. **Generate Application**
\`\`\`
Use generate_application with all the data to create the complete application
\`\`\`
## π Project Structure
\`\`\`
AIWorkflowMCP/
βββ src/
β βββ index.ts # Main MCP server
β βββ tools/ # MCP tool implementations
β β βββ parse-brd.tool.ts
β β βββ convert-brd-to-miro-format.tool.ts
β β βββ create-miro-board.tool.ts
β β βββ export-miro-data.tool.ts
β β βββ generate-figma-design.tool.ts
β β βββ select-tech-stack.tool.ts
β β βββ generate-application.tool.ts
β βββ services/ # Core business logic
β β βββ brd-service.ts
β β βββ miro-converter.ts
β β βββ miro-service.ts
β β βββ figma-service.ts
β β βββ codegen-service.ts
β β βββ code-templates/ # Code generation templates
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
βββ SETUP_MIRO.md # Miro API setup guide
βββ SETUP_FIGMA.md # Figma API setup guide
βββ package.json
βββ tsconfig.json
βββ README.md
\`\`\`
## π§ Configuration
### Environment Variables
See \`.env.example\` for all available configuration options:
- **Miro**: MIRO_ACCESS_TOKEN, MIRO_TEAM_ID
- **Figma**: FIGMA_ACCESS_TOKEN, FIGMA_TEAM_ID
- **AI**: OPENAI_API_KEY, AI_PROVIDER, AI_MODEL
- **Features**: ENABLE_MIRO_AI, ENABLE_TESTING_GENERATION, etc.
### Tech Stack Support
#### Frontend
- React, Vue, Angular, Svelte, Next.js, Nuxt.js
- TypeScript, JavaScript
- Tailwind, MUI, Chakra UI, Styled Components
#### Backend
- Express, Fastify, NestJS (Node.js)
- Django, Flask, FastAPI (Python)
- Go Gin, Spring Boot
#### Database
- PostgreSQL, MySQL, MongoDB, SQLite
- Firebase, Supabase
## π§ͺ Development
### Run in Development Mode
\`\`\`bash
npm run dev
\`\`\`
### Run Tests
\`\`\`bash
npm test
npm run test:coverage
\`\`\`
### Lint and Format
\`\`\`bash
npm run lint
npm run format
\`\`\`
## π Generated Application Structure
When you generate an application, you'll get:
\`\`\`
generated-apps/
βββ your-project/
βββ frontend/ # React/Vue/etc application
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Page components
β β βββ App.tsx
β βββ package.json
βββ backend/ # Express/Django/etc API
β βββ src/
β β βββ routes/ # API routes
β β βββ controllers/ # Business logic
β β βββ models/ # Database models
β β βββ index.ts
β βββ package.json
βββ docker-compose.yml # Docker orchestration
βββ README.md # Project documentation
βββ .gitignore
\`\`\`
## π€ Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
## π License
MIT License - see [LICENSE](./LICENSE) file for details.
## π Acknowledgments
- Built with [Model Context Protocol SDK](https://github.com/anthropics/mcp)
- Uses [Miro API](https://developers.miro.com/)
- Integrates with [Figma API](https://www.figma.com/developers/api)
- Powered by OpenAI GPT-4 or Anthropic Claude
## π Support
- **Issues**: [GitHub Issues](https://github.com/your-repo/issues)
- **Documentation**: See \`SETUP_*.md\` files
- **Examples**: Check \`examples/\` directory
## πΊοΈ Roadmap
- [ ] Support for more frontend frameworks
- [ ] GraphQL API generation
- [ ] Mobile app generation (React Native, Flutter)
- [ ] Enhanced Figma Plugin for direct file creation
- [ ] CI/CD pipeline templates
- [ ] Real-time collaboration features
**Made with β€οΈ for developers who want to move fast**