This document contains all technical details, development information, and advanced configuration for the AI Assistant Chrome Extension.
power-apps/
βββ backend/ # Node.js Express server
β βββ services/ # AI service integrations
β βββ routes/ # API endpoints
β βββ mcp-servers/ # MCP tool implementations
β βββ tests/ # Backend tests
βββ chrome-extension/ # React Chrome extension
β βββ src/ # React components and services
β βββ public/ # Extension manifest and assets
β βββ dist/ # Built extension (generated)
βββ README.md # Main documentation
- Node.js (v16 or higher)
- npm or yarn
- Chrome browser (for extension)
For automated testing and deployment, see the GitHub Actions Setup Guide.
The project includes three main workflows:
- CI Pipeline: Main testing and build verification
- Auto Fix CI: Automatic CI failure resolution
- Store Coverage Enforcer: Automatic test coverage improvement to 100%
cd backend
# Install dependencies
npm install
# Copy environment template
cp env.example .env
# Edit .env with your API keys
# Start the server
npm run devThe backend server will start on http://localhost:3001
cd chrome-extension
# Install dependencies
npm install
# Copy environment template
cp env.example .env
# Edit .env with your settings
# Build the extension
npm run build:extensionCreate a .env file in the backend/ directory:
# Required API Keys
OPENAI_API_KEY=sk-your-actual-openai-key-here
GEMINI_API_KEY=AIza-your-actual-gemini-key-here
NOTION_API_KEY=ntn_your-actual-notion-key-here
FIRECRAWL_API_KEY=fc-your-actual-firecrawl-key-here
# Server Configuration
PORT=3001
NODE_ENV=development
# CORS Configuration
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000Create a .env file in the chrome-extension/ directory:
# App Configuration
VITE_APP_NAME=AI Copilot
VITE_API_BASE_URL=http://localhost:3001
VITE_DEFAULT_MODEL=gemini-2.5-flash
# Development Settings
VITE_DEBUG_MODE=trueThe backend provides RESTful APIs:
GET /health- Health checkPOST /api/chat/stream- Stream chat responsesGET /api/chat/models- Get available AI modelsPOST /api/chat/non-stream- Non-streaming chat responses
The system includes built-in MCP tools:
- check-creator: Get project creator information
- get-project-info: Get comprehensive project details
cd backend
# Test MCP integration
npm run test-mcp
# Test specific MCP servers
node tests/test-notion-article-correction-mcp.js
node tests/test-openai-cost-mcp.js
node tests/test-web-page-summary-for-firecrawl-mcp.jscd chrome-extension
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test suites
npm run test:stores
npm run test:componentsnpm start- Start production servernpm run dev- Start development server with nodemonnpm run mcp-server- Start MCP server manuallynpm run test-mcp- Test MCP integrationnpm run demo-mcp- Run MCP usage examples
npm run dev- Start Vite development servernpm run build- Build React applicationnpm run build:extension- Build complete Chrome extensionnpm test- Run test suitenpm run lint- Lint code
cd backend
# Development with auto-reload
npm run dev
# Start MCP server manually (if needed)
npm run mcp-server
# Run example MCP usage
npm run demo-mcpcd chrome-extension
# Development mode
npm run dev
# Build for production
npm run build
# Build extension package
npm run build:extension
# Lint code
npm run lintBackend won't start:
- Check that all required environment variables are set in
.env - Verify API keys are valid and have sufficient credits
- Ensure port 3001 is not in use
Chrome extension not loading:
- Make sure the extension is built:
npm run build:extension - Check that Developer Mode is enabled in Chrome
- Verify the
distfolder contains all necessary files
CORS errors:
- Verify
ALLOWED_ORIGINSin backend.envincludes your frontend URL - Check that backend is running on the expected port
API key errors:
- Ensure API keys are correctly formatted (no extra spaces/quotes)
- Verify API keys have sufficient credits and are not expired
- Check API key permissions and rate limits
Enable debug logging:
Backend: Set NODE_ENV=development in .env
Chrome Extension: Set VITE_DEBUG_MODE=true in .env
This section provides a comprehensive index of all documentation files in the project:
- Environment Setup Guide - Comprehensive setup instructions
- Backend README - Backend development guide
- Backend Environment Setup - Backend-specific configuration
- Chat Sessions - Session management system
- Chrome Extension README - Extension development guide
- Chrome Extension Environment - Extension configuration
- Chrome Extension Tests - Testing documentation
- Chrome Extension Stores - State management documentation
- ForceConfigModal Component - Force configuration modal documentation
- MCP Integration Guide - Model Context Protocol setup and usage
- MCP Servers Overview - MCP servers documentation
- Firecrawl MCP Server - Web page summary MCP server
- Notion MCP Server - Notion article correction MCP server
- OpenAI Cost MCP Server - OpenAI cost tracking MCP server
- Turbo Mode Documentation - Multi-model comparison feature
- Screenshot Capture Guide - Screen capture functionality
- Screenshot Fix Guide - Screenshot functionality fixes
- Settings Management - Extension settings and preferences
- Coverage Enforcer - Automatic test coverage improvement workflow
- Fake Stream Debug Tool - Simulate and debug streaming responses
- Migration Complete - Migration documentation
- State Refactor Improvement - State management improvements
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- OpenAI for GPT models
- Google for Gemini models
- Model Context Protocol for tool integration
- React for the frontend framework
- Ant Design for UI components
- Express.js for the backend framework
MIT License - see the LICENSE file for details.