Development Documentation
Development Documentation
Section titled “Development Documentation”Everything you need to know to develop and contribute to Puppeteer MCP.
Development Guides
Section titled “Development Guides”Standard development practices:
- Setup instructions
- Development cycle
- Code review process
- Release procedures
- Maintenance tasks
William Zujkowski’s coding standards:
- TypeScript standards
- Testing requirements
- Security standards
- Documentation standards
- Code quality metrics
Comprehensive testing practices:
- Unit testing
- Integration testing
- E2E testing
- Performance testing
- Test coverage requirements
AI-assisted development patterns:
- Task delegation
- Subagent patterns
- Context management
- Code generation
- Review workflows
Quick Start Development
Section titled “Quick Start Development”1. Clone Repository
Section titled “1. Clone Repository”git clone https://github.com/williamzujkowski/puppeteer-mcp.gitcd puppeteer-mcp
2. Install Dependencies
Section titled “2. Install Dependencies”npm install
3. Set Up Environment
Section titled “3. Set Up Environment”# Copy example environmentcp .env.example .env
# Edit with your settingsnano .env
4. Run Development Server
Section titled “4. Run Development Server”npm run dev
5. Run Tests
Section titled “5. Run Tests”npm testnpm run test:watch # Watch modenpm run test:coverage # With coverage
Development Commands
Section titled “Development Commands”Build & Compile
Section titled “Build & Compile”npm run build # Build projectnpm run typecheck # Check TypeScriptnpm run lint # Run ESLintnpm run lint:fix # Fix ESLint issues
Testing
Section titled “Testing”npm test # Run all testsnpm run test:unit # Unit tests onlynpm run test:integration # Integration testsnpm run test:e2e # End-to-end tests
Development Tools
Section titled “Development Tools”npm run dev # Start dev servernpm run debug # Start with debuggingnpm run watch # Watch for changesnpm run clean # Clean build artifacts
Project Structure
Section titled “Project Structure”puppeteer-mcp/├── src/ # Source code│ ├── auth/ # Authentication│ ├── grpc/ # gRPC implementation│ ├── mcp/ # MCP server│ ├── puppeteer/ # Browser automation│ ├── routes/ # REST API routes│ ├── store/ # Session management│ ├── utils/ # Utilities│ └── ws/ # WebSocket server├── test/ # Test files│ ├── unit/ # Unit tests│ ├── integration/ # Integration tests│ └── e2e/ # End-to-end tests├── docs/ # Documentation├── scripts/ # Build scripts└── config/ # Configuration
Code Quality Standards
Section titled “Code Quality Standards”TypeScript Requirements
Section titled “TypeScript Requirements”- ✅ Strict mode enabled
- ✅ No
any
types (migrate tounknown
) - ✅ All functions documented
- ✅ Interfaces over type aliases
- ✅ Explicit return types
Testing Requirements
Section titled “Testing Requirements”- ✅ 85%+ code coverage
- ✅ Test-first development
- ✅ Descriptive test names
- ✅ Isolated unit tests
- ✅ Comprehensive E2E tests
Security Requirements
Section titled “Security Requirements”- ✅ Input validation (Zod)
- ✅ Authentication on all endpoints
- ✅ NIST control tags
- ✅ Security headers
- ✅ Rate limiting
Development Workflow
Section titled “Development Workflow”1. Feature Development
Section titled “1. Feature Development”# Create feature branchgit checkout -b feature/your-feature
# Make changes# Write tests first (TDD)# Implement feature# Update documentation
# Run checksnpm run typechecknpm run lintnpm test
2. Code Review
Section titled “2. Code Review”- Create pull request
- Ensure CI passes
- Request review
- Address feedback
- Merge when approved
3. Release Process
Section titled “3. Release Process”# Update versionnpm version patch|minor|major
# Build and testnpm run buildnpm test
# Publishnpm publish
Common Development Tasks
Section titled “Common Development Tasks”Adding a New API Endpoint
Section titled “Adding a New API Endpoint”- Define route in
src/routes/
- Add validation schema (Zod)
- Implement business logic
- Add tests
- Update OpenAPI spec
- Document in API reference
Adding a New MCP Tool
Section titled “Adding a New MCP Tool”- Define tool in
src/mcp/tools/
- Add parameter schema
- Implement tool logic
- Add to tool registry
- Write tests
- Update MCP documentation
Fixing a Bug
Section titled “Fixing a Bug”- Write failing test
- Fix the bug
- Ensure test passes
- Check for regressions
- Update changelog
Debugging
Section titled “Debugging”Enable Debug Logging
Section titled “Enable Debug Logging”# All debug outputDEBUG=* npm run dev
# Specific namespacesDEBUG=puppeteer:* npm run devDEBUG=mcp:*,session:* npm run dev
Chrome DevTools
Section titled “Chrome DevTools”// Enable DevTools in developmentconst browser = await puppeteer.launch({ headless: false, devtools: true,});
VS Code Debugging
Section titled “VS Code Debugging”{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Debug Server", "program": "${workspaceFolder}/src/index.ts", "preLaunchTask": "tsc: build", "outFiles": ["${workspaceFolder}/dist/**/*.js"], "env": { "DEBUG": "*" } } ]}
Contributing
Section titled “Contributing”Before Contributing
Section titled “Before Contributing”- Read Contributing Guide
- Review Coding Standards
- Check existing issues
- Discuss major changes
Contribution Process
Section titled “Contribution Process”- Fork repository
- Create feature branch
- Make changes with tests
- Submit pull request
- Address review feedback
Resources
Section titled “Resources”Internal Documentation
Section titled “Internal Documentation”- Development Workflow - Detailed workflow
- Coding Standards - Code quality standards
- Testing Guide - Testing best practices
- AI Patterns - AI development
External Resources
Section titled “External Resources”Getting Help
Section titled “Getting Help”- Check existing documentation
- Search GitHub issues
- Ask in discussions
- Contact maintainers