chipsxp
MCP Server
chipsxp
public

viewport control

viewport-control is a TypeScript-based MCP server that enables advanced browser automation for viewport management, screenshot capture, and content extraction. It is designed for integration with MCP clients (such as Claude Desktop) and provides a robust API for launching, resizing, and closing Chromium-based browser

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

About This Server

viewport-control is a TypeScript-based MCP server that enables advanced browser automation for viewport management, screenshot capture, and content extraction. It is designed for integration with MCP clients (such as Claude Desktop) and provides a robust API for launching, resizing, and closing Chromium-based browser

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

# viewport-control MCP Server

Advanced viewport management and browser control for Model Context Protocol (MCP) clients

## Overview
This TypeScript-based MCP server provides sophisticated browser viewport control capabilities. It enables clients to launch browsers with custom viewport configurations, resize viewports dynamically, and capture screenshots with various formatting options. Built on Puppeteer, it offers precise control over browser dimensions and rendering parameters.

## Core Features

### 1. Browser Launch Control
Launch browser instances with precise viewport configurations:
- Custom dimensions (320-3840px width, 240-2160px height)
- Device scale factor (1-3x pixel density)
- Mobile emulation toggle
- Screenshot capture options (format/quality)

### 2. Dynamic Viewport Resizing
Adjust viewport dimensions on active browser sessions:
- Real-time width/height adjustments
- Format-preserving screenshot capture
- Quality-adjustable image output (JPEG/WebP)

### 3. Comprehensive Browser Management
- Full lifecycle control (launch/close)
- OS-specific Chrome path detection
- Headless browser operation
- Network idle detection for page loading

## Tool Specifications

### `launch_browser`
**Parameters:**
```json
{
  "url": "https://example.com",
  "width": 1200,
  "height": 800,
  "deviceScaleFactor": 2,
  "isMobile": false,
  "imageFormat": "jpeg",
  "imageQuality": 85,
  "fullPage": true
}
```

**Capabilities:**
- Returns page content as markdown
- Provides base64-encoded screenshot
- Auto-detects Chrome installation path

### `resize_viewport`
**Parameters:**
```json
{
  "width": 800,
  "height": 600,
  "imageFormat": "png"
}
```

**Output:**
- Updated viewport dimensions
- New page content summary
- Screenshot in specified format

### `close_browser`
**Parameters:** None
**Functionality:** Cleanly terminates browser instance

## Development Workflow

### Setup Commands
```bash
# Install dependencies
npm install

# Build production version
npm run build

# Watch for changes during development
npm run watch

# Run with MCP inspector for debugging
npm run inspector
```

## Installation Guide

1. Clone repository:
```bash
git clone https://github.com/yourname/viewport-control.git
```

2. Configure MCP client (Claude Desktop):
```json
{
  "viewport-control": {
      "timeout": 60,
      "command": "node",
      "args": [ "C:\\Users\\$USRPROFILE$\\something-folder\\whatever-folder\\viewport-control\\build\\index.js" ],
      "transportType": "stdio"
    } 
}
```

**Platform Notes:**
- Windows: Auto-detects Chrome installation
- macOS: Requires Chrome at default path
- Linux: Requires manual Chrome installation

## Debugging with MCP Inspector

1. Start server in debug mode:
```bash
npm run inspector
```

2. Connect browser to provided URL

3. Use inspector features:
- Request/response tracing
- Resource access monitoring
- Tool execution visualization
- Error diagnostics

## Contributing
1. Fork the repository
2. Create feature branch
3. Implement changes
4. Add test cases
5. Submit pull request

## License
MIT License - See LICENSE file for details

Quick Start

1

Clone the repository

git clone https://github.com/chipsxp/viewport-control
2

Install dependencies

cd viewport-control
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerchipsxp
Repoviewport-control
Language
TypeScript
License-
Last fetched8/8/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation