Skip to content

Development Documentation

Everything you need to know to develop and contribute to Puppeteer MCP.

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
Terminal window
git clone https://github.com/williamzujkowski/puppeteer-mcp.git
cd puppeteer-mcp
Terminal window
npm install
Terminal window
# Copy example environment
cp .env.example .env
# Edit with your settings
nano .env
Terminal window
npm run dev
Terminal window
npm test
npm run test:watch # Watch mode
npm run test:coverage # With coverage
Terminal window
npm run build # Build project
npm run typecheck # Check TypeScript
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
Terminal window
npm test # Run all tests
npm run test:unit # Unit tests only
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
Terminal window
npm run dev # Start dev server
npm run debug # Start with debugging
npm run watch # Watch for changes
npm run clean # Clean build artifacts
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
  • ✅ Strict mode enabled
  • ✅ No any types (migrate to unknown)
  • ✅ All functions documented
  • ✅ Interfaces over type aliases
  • ✅ Explicit return types
  • ✅ 85%+ code coverage
  • ✅ Test-first development
  • ✅ Descriptive test names
  • ✅ Isolated unit tests
  • ✅ Comprehensive E2E tests
  • ✅ Input validation (Zod)
  • ✅ Authentication on all endpoints
  • ✅ NIST control tags
  • ✅ Security headers
  • ✅ Rate limiting
Terminal window
# Create feature branch
git checkout -b feature/your-feature
# Make changes
# Write tests first (TDD)
# Implement feature
# Update documentation
# Run checks
npm run typecheck
npm run lint
npm test
  • Create pull request
  • Ensure CI passes
  • Request review
  • Address feedback
  • Merge when approved
Terminal window
# Update version
npm version patch|minor|major
# Build and test
npm run build
npm test
# Publish
npm publish
  1. Define route in src/routes/
  2. Add validation schema (Zod)
  3. Implement business logic
  4. Add tests
  5. Update OpenAPI spec
  6. Document in API reference
  1. Define tool in src/mcp/tools/
  2. Add parameter schema
  3. Implement tool logic
  4. Add to tool registry
  5. Write tests
  6. Update MCP documentation
  1. Write failing test
  2. Fix the bug
  3. Ensure test passes
  4. Check for regressions
  5. Update changelog
Terminal window
# All debug output
DEBUG=* npm run dev
# Specific namespaces
DEBUG=puppeteer:* npm run dev
DEBUG=mcp:*,session:* npm run dev
// Enable DevTools in development
const browser = await puppeteer.launch({
headless: false,
devtools: true,
});
.vscode/launch.json
{
"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": "*"
}
}
]
}
  1. Read Contributing Guide
  2. Review Coding Standards
  3. Check existing issues
  4. Discuss major changes
  1. Fork repository
  2. Create feature branch
  3. Make changes with tests
  4. Submit pull request
  5. Address review feedback
  • Check existing documentation
  • Search GitHub issues
  • Ask in discussions
  • Contact maintainers