10 days ago
Overview
MCP Server
@compare-html/cli also provides an MCP (Model Context Protocol) server for AI assistants to compare HTML values programmatically.
Start the MCP Server
npx @compare-html/cli --mcp
Online Playground
Try it out at https://comparehtml.com
Available Tools
compare_html
Compare two HTML values and return their structural differences.
Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
baseHTML | string | No | Base HTML string |
baseHTMLFilePath | string | No | Base HTML file path |
contrastHTML | string | No | Contrast HTML string |
contrastHTMLFilePath | string | No | Contrast HTML file path |
At least one base and one contrast input must be provided.
Output:
Returns an array of HTMLValueDifference objects:
{
"differences": [
{
"pathSegments": ["0", "@class"],
"pathString": "0.@class",
"contrastPathString": "0.@class",
"displayPath": "div > @class",
"pathBelongsTo": "both",
"diffType": "valueChanged"
}
]
}
Server Config
{
"mcpServers": {
"compare-html": {
"command": "npx",
"args": [
"@compare-html/cli@latest",
"--mcp"
]
}
}
}