Skip to main content
Glama
Web Proxy MCP Server

Web Proxy MCP Server

by mako10k

Web Proxy MCP Server

Intelligent HTTP/HTTPS proxy server with Model Context Protocol (MCP) integration for automated traffic monitoring, analysis, and browser setup.

🌟 Features

Core Proxy Capabilities

  • Selective Proxying: Only monitor specific domains while allowing direct access to others

  • HTTP/HTTPS Support: Full support for HTTP requests and HTTPS tunneling via CONNECT

  • PAC File Generation: Automatic Proxy Auto-Configuration file generation

  • Traffic Capture: Detailed request/response logging with optional header/body capture

MCP Integration

  • 16 MCP Tools: Complete automation via Model Context Protocol

  • Dynamic Configuration: Add/remove monitored domains at runtime

  • Real-time Analysis: Traffic pattern analysis and performance metrics

  • HAR Export: Standard HTTP Archive format for external analysis

Browser Setup Automation

  • Multi-Browser Support: Chrome, Firefox, cURL, and system-wide proxy setup

  • Script Generation: Automated setup script generation for different platforms

  • One-Click Configuration: Simple browser proxy configuration

Related MCP server: Android Proxy MCP

šŸš€ Quick Start

Installation

cd /home/solar/docker-appliance/mcp-servers/web-proxy-mcp
npm install

Basic Usage

# Start the proxy server
npm start

# Or run directly
node index.js

Add to VS Code MCP Configuration

Add to your VS Code mcp.json:

{
  "mcpServers": {
    "web-proxy-mcp": {
      "command": "node",
      "args": ["/home/solar/docker-appliance/mcp-servers/web-proxy-mcp/index.js"],
      "env": {}
    }
  }
}

šŸ”§ MCP Tools

Target Management

  • proxy_add_target: Add domains to monitor

  • proxy_remove_target: Remove domains from monitoring

  • proxy_list_targets: List all configured targets

  • proxy_update_target: Update target configuration

Server Control

  • proxy_start_server: Start the proxy server

  • proxy_stop_server: Stop the proxy server

  • proxy_server_status: Get server status and statistics

Browser Setup

  • proxy_generate_setup: Generate browser setup scripts

  • proxy_get_pac_file: Get PAC file content

Traffic Analysis

  • proxy_get_traffic_log: View captured traffic

  • proxy_export_har: Export traffic as HAR file

  • proxy_clear_traffic_log: Clear traffic logs

  • proxy_analyze_traffic: Analyze traffic patterns

Configuration

  • proxy_import_config: Import configuration from file

  • proxy_export_config: Export configuration to file

Advanced Analysis

  • proxy_analyze_traffic: Traffic pattern analysis

  • proxy_get_performance_metrics: Performance monitoring

šŸ“Š Usage Examples

1. Monitor Specific API

// Add target domain
await mcp.callTool('proxy_add_target', {
  domain: 'api.example.com',
  description: 'Main API endpoint',
  captureHeaders: true,
  captureBody: true
});

// Start proxy server
await mcp.callTool('proxy_start_server', {
  port: 8080,
  host: 'localhost'
});

// Generate browser setup
await mcp.callTool('proxy_generate_setup', {
  proxyHost: 'localhost',
  proxyPort: 8080
});

2. Traffic Analysis

// Get traffic log
const traffic = await mcp.callTool('proxy_get_traffic_log', {
  domain: 'api.example.com',
  limit: 50
});

// Analyze patterns
const analysis = await mcp.callTool('proxy_analyze_traffic', {
  domain: 'api.example.com',
  timeframe: '24h',
  groupBy: 'method'
});

// Export HAR file
await mcp.callTool('proxy_export_har', {
  domain: 'api.example.com',
  filename: 'api-traffic-analysis'
});

3. Browser Configuration

// Get PAC file for manual setup
const pac = await mcp.callTool('proxy_get_pac_file', {
  proxyHost: 'localhost',
  proxyPort: 8080
});

// Generate all setup scripts
const setup = await mcp.callTool('proxy_generate_setup', {
  browsers: ['chrome', 'firefox', 'system']
});

šŸ”„ Workflow Integration

Development Debugging

  1. Add your development domains to the proxy

  2. Start the proxy server

  3. Configure your browser to use the proxy

  4. Monitor API calls and responses in real-time

  5. Export traffic logs for analysis

API Testing

  1. Configure proxy for your test endpoints

  2. Run automated tests through the proxy

  3. Capture all HTTP traffic automatically

  4. Analyze response times and error patterns

  5. Export detailed HAR files for reporting

Security Analysis

  1. Monitor specific domains for security testing

  2. Capture detailed request/response headers

  3. Analyze traffic patterns for anomalies

  4. Export logs for security review

šŸ“ Project Structure

web-proxy-mcp/
ā”œā”€ā”€ index.js                 # Main MCP server entry point
ā”œā”€ā”€ package.json             # Node.js dependencies
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ proxy/
│   │   ā”œā”€ā”€ target-manager.js   # Domain target management
│   │   └── proxy-server.js     # HTTP/HTTPS proxy server
│   ā”œā”€ā”€ traffic/
│   │   └── traffic-analyzer.js # Traffic capture and analysis
│   ā”œā”€ā”€ setup/
│   │   └── browser-setup.js    # Browser configuration scripts
│   └── tools/
│       ā”œā”€ā”€ tool-definitions.js # MCP tool schemas
│       └── tool-handlers.js    # MCP tool implementations
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ targets.json         # Persistent target configuration
│   └── traffic-log.json     # Persistent traffic logs
└── setup-scripts/           # Generated browser setup scripts
    ā”œā”€ā”€ chrome-proxy-setup.sh
    ā”œā”€ā”€ firefox-proxy-setup.sh
    ā”œā”€ā”€ curl-proxy-setup.sh
    ā”œā”€ā”€ system-proxy-setup.sh
    └── proxy.pac

āš™ļø Configuration

Target Configuration

Targets are stored in data/targets.json:

{
  "httpbin.org": {
    "domain": "httpbin.org",
    "description": "HTTP testing service",
    "enabled": true,
    "captureHeaders": true,
    "captureBody": false,
    "createdAt": "2025-01-11T10:00:00.000Z"
  }
}

Traffic Analysis

  • Max Entries: 5,000 traffic entries (configurable)

  • Persistence: Automatic save/load from data/traffic-log.json

  • HAR Export: Standard HTTP Archive format

  • Real-time Metrics: Performance and usage statistics

Proxy Server

  • Default Port: 8080 (configurable)

  • PAC File: Automatic generation at /proxy.pac

  • Protocol Support: HTTP and HTTPS (via CONNECT tunneling)

  • Performance Monitoring: Built-in metrics collection

šŸ”’ Security Considerations

  • Local Only: Default configuration binds to localhost only

  • Selective Monitoring: Only configured domains are proxied

  • No Body Capture by Default: Sensitive data protection

  • Configurable Headers: Optional header capture for debugging

šŸ¤ Integration with Other Tools

VS Code Workflow

  1. Add to MCP configuration in VS Code

  2. Use AI assistant to manage proxy configuration

  3. Automate traffic analysis through AI commands

  4. Generate reports and documentation automatically

Development Workflow

  1. Monitor local development APIs

  2. Test staging environment interactions

  3. Debug production API calls (headers only)

  4. Performance testing and analysis

šŸ“ˆ Performance

  • Minimal Overhead: Only proxied domains incur processing cost

  • Efficient Storage: Configurable traffic log retention

  • Background Processing: Non-blocking traffic capture

  • Memory Management: Automatic cleanup of old entries

šŸ› ļø Advanced Features

Custom PAC Generation

The proxy generates intelligent PAC files that only route monitored domains through the proxy, maintaining normal browsing speed for other sites.

Traffic Pattern Analysis

Built-in analysis tools help identify:

  • API usage patterns

  • Response time trends

  • Error rate monitoring

  • Domain-specific metrics

Multi-Browser Support

Automated setup scripts for:

  • Chrome (with security flags for testing)

  • Firefox (with custom profile)

  • System-wide proxy (Linux/macOS)

  • Command-line tools (cURL)

šŸ”§ Troubleshooting

Common Issues

  1. Port in use: Change the proxy port in server configuration

  2. Browser not using proxy: Verify PAC file URL or manual proxy settings

  3. HTTPS issues: Check certificate handling in browser settings

  4. No traffic captured: Ensure domains are added to target list

Debug Mode

Run with debug logging:

DEBUG=web-proxy-mcp node index.js

Logs Location

  • Server logs: Console output

  • Traffic logs: data/traffic-log.json

  • Target config: data/targets.json

šŸ“ License

This project is part of the Docker Appliance MCP server collection and follows the same licensing terms.

šŸ¤– AI Assistant Integration

This proxy is designed to work seamlessly with AI assistants through MCP:

  • Natural Language Control: "Start monitoring api.example.com"

  • Automated Analysis: "Analyze the last hour of API traffic"

  • Report Generation: "Export traffic data for the payment API"

  • Configuration Management: "Set up Chrome to use the proxy"

The MCP integration makes this proxy particularly powerful for AI-assisted development and debugging workflows.

Available Tools

22 tools
proxy_add_targetC

Add a new target domain for proxy monitoring

Inputs: domain (required), description, enabled, captureHeaders, +1 more.

proxy_analyze_trafficC

Analyze captured traffic patterns and statistics

Inputs: domain, timeframe, groupBy.

proxy_clear_traffic_logC

Clear the traffic log

Inputs: confirm (required), domain.

proxy_export_configC

Export current proxy configuration to file

Inputs: filepath, includeTrafficLog.

proxy_export_harC

Export traffic log as HAR (HTTP Archive) format

Inputs: domain, since, filename.

proxy_generate_setupC

Generate browser and system proxy setup scripts

Inputs: proxyHost, proxyPort, browsers.

proxy_get_pac_fileB

Get the current PAC (Proxy Auto-Configuration) file content

Inputs: proxyHost, proxyPort.

proxy_get_performance_metricsC

Get proxy server performance metrics

Inputs: reset.

proxy_get_traffic_logC

Get captured traffic log with filtering options

Inputs: domain, method, limit, since.

proxy_import_configC

Import proxy configuration from file

Inputs: filepath (required), merge.

proxy_list_targetsC

List all target domains and their status

Inputs: status.

proxy_remove_targetC

Remove a target domain from proxy monitoring

Inputs: domain (required).

proxy_server_statusB

Get proxy server status and statistics including SSL bumping status

Inputs: no named parameters.

proxy_start_serverC

Start the proxy server with optional SSL bumping

Inputs: port, host, enableSSLBumping.

proxy_stop_serverB

Stop the proxy server

Inputs: no named parameters.

proxy_update_targetC

Update target domain configuration

Inputs: domain (required), description, enabled, captureHeaders, +1 more.

ssl_ca_statusB

Get current CA status and configuration

Inputs: no named parameters.

ssl_create_caC

Create a new Certificate Authority for SSL bumping

Inputs: caName, description, overwrite, subject.

ssl_generate_certificateC

Generate server certificate for specific domain

Inputs: domain (required), altNames.

ssl_get_ca_certificateB

Get CA certificate and installation instructions

Inputs: no named parameters.

ssl_list_casB

List all available Certificate Authorities

Inputs: no named parameters.

ssl_switch_caC

Switch to a different Certificate Authority

Inputs: caName (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 22 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. For example, proxy_start_server and proxy_stop_server handle server lifecycle, while ssl_create_ca and ssl_generate_certificate manage SSL operations, all with non-overlapping functions.

    Naming Consistency5/5

    Tool names follow a consistent verb_noun pattern throughout, with clear prefixes (proxy_ or ssl_) for grouping. All tools use snake_case and descriptive names like proxy_export_har and ssl_list_cas, making them predictable and readable.

    Tool Count4/5

    With 22 tools, the count is slightly high but reasonable for the comprehensive web proxy domain, covering server management, traffic monitoring, SSL handling, and configuration. It's well-scoped, though could be streamlined without losing core functionality.

    Completeness5/5

    The tool set provides complete coverage for web proxy operations, including CRUD for targets (add, list, update, remove), server lifecycle (start, stop, status), traffic analysis (analyze, get, clear, export), SSL management (CA creation, certificates, switching), and configuration handling (import, export, setup). No obvious gaps exist.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables AI assistants to capture and analyze HTTP/HTTPS traffic from Android devices. It supports smart searching of network requests and provides tools for detailed traffic analysis via natural language.
      11
      246
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI agents to intercept, inspect, and modify HTTP traffic, with tools for searching, filtering, and managing captured requests and interceptors.
      8
      MIT