Legacy Device Debugger MCP Server
Provides curl-like HTTP header analysis for debugging legacy device web interfaces, inspecting response headers, redirects, and proxy-blocking issues.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Legacy Device Debugger MCP ServerAnalyze this legacy device at http://192.168.1.100:8080"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Legacy Device Debugger MCP Server
An MCP (Model Context Protocol) server specifically designed for debugging legacy devices behind proxies in OT (Operational Technology) environments. This server helps support teams identify and fix proxy-related issues independently using custom header rewrite rules, eliminating the need to escalate to development teams.
Overview
Legacy devices in OT environments often have issues working behind proxies due to hardcoded IP addresses, hostname references, and outdated web technologies. This MCP server automates the debugging process and generates appropriate rewrite rules to fix these issues.
Related MCP server: Android Proxy MCP
Features
🔍 Automated Page Analysis
Loads device web interfaces using Playwright
Detects network errors, console errors, and loading issues
Identifies broken resources and problematic URL patterns
Checks for WebSocket connection problems
🛠️ Custom Header Rewrite Rules Generation
Automatically generates proxy configuration rules
Supports various rule types: header manipulation, body rewriting, redirects
Handles common issues like device IP references and broken links
📋 Systematic Debugging Workflow
Follows established OT debugging procedures
Provides step-by-step analysis and recommendations
Generates actionable results for support teams
🌐 Network Analysis
Performs curl-like header analysis
Detects redirects to device IP/hostname
Identifies CSP and other proxy-blocking headers
Installation
# Clone the repository
git clone <repository-url>
cd legacy-device-debugger-mcp
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install chromium
# Build the project
npm run buildUsage
As an MCP Server
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"legacy-device-debugger": {
"command": "node",
"args": ["/absolute/path/to/legacy-device-debugger-mcp/build/index.js"]
}
}
}Available Tools
1. analyze-device-page
Comprehensive analysis of a device's web interface.
Parameters:
deviceUrl(string): URL of the legacy device's web interfacetimeout(number, optional): Timeout in milliseconds (default: 30000)
Example:
Please analyze this legacy device: http://192.168.1.100:80802. curl-analysis
HTTP header analysis similar to curl commands.
Parameters:
deviceUrl(string): URL of the legacy device
Example:
Perform curl analysis on http://192.168.1.100:80803. generate-rewrite-rules
Generate specific rewrite rules for common issues.
Parameters:
issueType: Type of issue (device_ip_references, broken_links, image_loading, etc.)deviceUrl: Device URLproblemPattern(optional): Specific pattern causing issuestargetPath(optional): Specific path needing rewriting
Example:
Generate rewrite rules for broken_links issue on http://192.168.1.100:80804. debug-workflow
Complete debugging workflow following OT best practices.
Parameters:
deviceUrl: URL of the legacy devicedeviceIP(optional): Device IP address if knowndeviceHostname(optional): Device hostname if known
Example:
Run complete debug workflow for http://rtp-acl-bms:8080Debugging Workflow
The server follows this systematic approach:
Enable Default Rules & Basic Analysis
Check if web page loads at all
Identify partial loading issues
Detect broken images and resources
Network Error Detection
Monitor 404/500 errors
Check for connection failures
Identify requests to device IP/hostname
Header Analysis
Perform curl-like analysis
Check response headers for problematic patterns
Identify redirects and CSP issues
Generate Rewrite Rules
Create appropriate proxy configuration
Handle common patterns like device IP references
Generate header manipulation rules
Provide Recommendations
Actionable steps for support teams
Escalation guidance if needed
Direct access testing procedures
Common Use Cases
1. Device References Hardcoded IPs
Issue: Device web interface references its own IP address in resources Solution: Body rewrite rules to replace IP with external FQDN
2. Broken CSS/JS Loading
Issue: Stylesheets and scripts fail to load through proxy Solution: Header rewrite rules and resource path corrections
3. WebSocket Connection Issues
Issue: WebSocket connections bypass proxy or fail Solution: Protocol upgrade rules and hostname rewriting
4. Redirect to Device IP
Issue: Device redirects users to its internal IP Solution: Location header rewrite rules
Rewrite Rule Types
Header Rules
{
"type": "header",
"action": "add|replace|remove|append",
"headerName": "X-Forwarded-Host",
"headerValue": "{{DEVICE_EXTERNAL_FQDN}}"
}Body Rules
{
"type": "body",
"action": "find_replace",
"pattern": "rtp-acl-bms/static/jquery.min.js",
"replacement": "{{DEVICE_EXTERNAL_FQDN}}/static/jquery.min.js"
}Redirect Rules
{
"type": "redirect",
"action": "replace",
"pattern": "{{DEVICE_IP}}",
"replacement": "{{DEVICE_EXTERNAL_FQDN}}"
}Development
Project Structure
├── src/
│ └── index.ts # Main MCP server implementation
├── build/ # Compiled JavaScript
├── .vscode/
│ └── mcp.json # MCP server configuration
├── .github/
│ └── copilot-instructions.md
└── README.mdBuilding
npm run buildTesting
# Test the server directly
npm run dev
# Test with MCP client
node build/index.jsConfiguration Variables
The server uses these placeholder variables in generated rules:
{{DEVICE_EXTERNAL_FQDN}}: External FQDN for the device{{DEVICE_INTERNAL_IP}}: Internal IP address of the device{{DEVICE_IP}}: Generic device IP placeholder
Troubleshooting
Common Issues
Playwright Installation
npx playwright install chromiumPermission Errors
chmod +x build/index.jsModule Resolution Ensure
package.jsonhas"type": "module"
Debug Mode
Set environment variable for verbose logging:
DEBUG=1 node build/index.jsContributing
Follow the established debugging workflow patterns
Add appropriate error handling for network operations
Generate actionable rewrite rules in the correct format
Include comprehensive documentation
License
ISC License - see LICENSE file for details.
Support
For issues with legacy device debugging:
Use the complete debug workflow first
Check generated rewrite rules
Test with direct device access
Escalate to DevOps team with analysis results
Available Tools
1 toollegacydevicedebugthinkingA
A comprehensive sequential thinking tool for debugging legacy OT devices behind proxies following the exact production workflow used by support teams.
This tool implements the precise OT debugging sequence from the production environment:
STEP 1: Enable default rules (automatic on initialization) STEP 2: Analyze page loading status (not loaded / partially loaded / fully loaded) STEP 3: Analyze resources (broken images pointing to device IP, broken links) STEP 4: Analyze WebSocket connections and proxy requirements STEP 5: Analyze redirects and port issues (curl-based analysis) STEP 6: Analyze network failures (404/500) and console errors (MIME type, bootstrap.js) STEP 7: Perform detailed curl analysis for request/response headers
The tool detects and handles these specific OT device issues:
Hostname requirements (Error 400 hostname invalid) → Host header rewrite
Real IP address requirements → X-Real-IP header addition
Bootstrap.js HTTPS protocol issues → https→spdy replacement (DSD-3756)
MIME type mismatches → Content-Type header fixes
Private API calls requiring JSON body rewrite → Body rewrite with JSON
Device IP/hostname references in resources → Body find/replace rules
Redirect loops and wrong port onboarding → Location header rewrites
WebSocket proxy configuration issues → WebSocket-specific rules
"Try again" errors after device upgrades → Comprehensive rule application
Generates production-ready rewrite rules with ALL action types:
HEADER REWRITE: find_replace, add, replace, remove, append
BODY REWRITE: find_replace for device IP/hostname references
JSON BODY REWRITE: Special handling for private-api calls
DEFAULT RULES: Enable baseline proxy configuration
Production workflow triggers:
"Start debugging for http://device-url" → Initialize browser + enable default rules
"Check page loading" → Analyze login page, detect "Try again" errors, check 400 hostname invalid
"Analyze images and links" → Find broken resources pointing to device IP/hostname
"Check WebSocket" → Detect WebSocket connections and generate proxy rules
"Check redirects" → Analyze port redirects, suggest correct onboarding ports
"Check network and console errors" → Find 404/500 errors, MIME type issues, bootstrap.js problems
"Perform curl analysis" → Detailed header analysis for Location header issues
"Generate final report" → Complete analysis with all rules and recommendations
Automatic detection includes:
Device hostname/IP pattern matching
Private API endpoint identification (/private-api/, /api/private/, /internal/)
Bootstrap.js protocol conflicts
MIME type mismatch patterns
WebSocket connection requirements
Redirect loop detection
Static resource loading failures
Perfect for OT support teams following established troubleshooting procedures. Generates actionable rewrite rules for immediate application to RA portal. Follows the exact workflow: Enable defaults → Check loading → Analyze resources → Check WebSocket → Check redirects → Network/console errors → Curl analysis.
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | Your current debugging step description (include device URL to start debugging) | |
| branchId | No | Branch identifier for alternative analysis | |
| isRevision | No | Whether this revises previous analysis | |
| thoughtNumber | Yes | Current debugging step number | |
| totalThoughts | Yes | Estimated total debugging steps needed | |
| revisesThought | No | Which debugging step is being reconsidered | |
| branchFromThought | No | Branching point step number | |
| needsMoreThoughts | No | If more debugging steps are needed | |
| nextThoughtNeeded | Yes | Whether another debugging step is needed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of disclosing behavior. It clearly enumerates the 7-step sequence, the issue types detected, and that it generates production-ready rewrite rules. Some ambiguity remains about whether the tool actually executes curl/browser actions or only reasons about them, but the 'thinking tool' framing makes the intent fairly clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely long and repetitive. The numbered workflow, trigger list, automatic-detection list, and closing recap largely restate the same information. While it is well organized with sections and bullets, it would benefit from substantial trimming; every sentence does not earn its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is complex, has no annotations, and no output schema, so the description must do heavy lifting. It covers purpose, workflow, triggers, detection patterns, and output type (rewrite rules). It does not explicitly describe the return structure or how the final report is delivered, which keeps it from a 5.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline applies. The description adds domain context but does not provide extra meaning for the individual parameters such as thoughtNumber, totalThoughts, branchFromThought, or revisesThought. The schema already covers those adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('debugging') and a clearly defined resource ('legacy OT devices behind proxies'), and further narrows scope by describing a production support workflow. It is immediately evident what this tool is for and how it differs from a generic thinking tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives strong context for when to use the tool: debugging legacy OT devices behind proxies using the exact support-team workflow. It also provides concrete trigger phrases like 'Start debugging for http://device-url' and 'Check page loading'. It stops short of explicit when-not or alternative-tool guidance, though no sibling tools exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
legacydevicedebugthinking
TDQS
Scored across 1 tool
With exactly one tool exposed, there is no possibility of selecting between overlapping tools. The tool set is unambiguous at the selection level, even though the single tool's internal workflow is broad.
The single tool name 'legacydevicedebugthinking' is one long concatenated identifier, not an action-based verb_noun name, so no naming pattern can be inferred for the server as a set. It is not inconsistent with other tools because there are none, but it is not a predictive convention.
One tool is too few for the stated scope: the description lists eight distinct workflow stages and many issue-specific analyses that would be more naturally exposed as separate invocable operations. The monolithic design reduces flexibility for an agent that only needs to run one stage.
The tool's description covers the end-to-end debugging workflow, from enabling default rules through loading checks, resource analysis, WebSocket handling, redirects, network errors, curl analysis, and final report generation. The main gap is the lack of any separate tool to apply or verify the generated rewrite rules, and the suboperations are not independently callable.
Maintenance
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
2,000+ MCP servers read at source level. Know what one does before you connect. Free, no key.
Turn any public website into an MCP server for agents to search, read and navigate.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- FlicenseAqualityDmaintenanceIntelligent HTTP/HTTPS proxy server with MCP integration for automated traffic monitoring, analysis, and browser setup.22-
- AlicenseAqualityFmaintenanceAn 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.11233MIT
- AlicenseCqualityBmaintenanceAn MCP server for JavaScript reverse engineering that enables AI to perform browser debugging, script analysis, and automated hook injection. It streamlines complex workflows like deobfuscation, network tracing, and risk assessment through direct browser integration.3521 npm1,020Apache 2.0
- FlicenseBqualityBmaintenanceMCP server for high-fidelity code audits, refactoring, and architectural analysis using specialized Proxy Experts.85-