mcp-web-validator 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +682 -0
- package/dist/index.js.map +1 -0
- package/dist/screenshot.d.ts +18 -0
- package/dist/screenshot.js +65 -0
- package/dist/screenshot.js.map +1 -0
- package/dist/seo-auditor.d.ts +24 -0
- package/dist/seo-auditor.js +233 -0
- package/dist/seo-auditor.js.map +1 -0
- package/dist/w3c-validator.d.ts +23 -0
- package/dist/w3c-validator.js +62 -0
- package/dist/w3c-validator.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AKzar1el
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# mcp-web-validator
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/mcp-web-validator)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Part of the **[DigestSEO](https://digestseo.com/)** suite of open-source SEO tools.
|
|
7
|
+
|
|
8
|
+
Product home: [digestseo.com/validator-mcp](https://digestseo.com/validator-mcp/)
|
|
9
|
+
ยท Support: [digestseo.com/support](https://digestseo.com/support/)
|
|
10
|
+
|
|
11
|
+
The public, read-only ChatGPT app is hosted at
|
|
12
|
+
`https://web-validator-mcp.digestseo.com/mcp`. It accepts HTML, CSS, and authorized public
|
|
13
|
+
URLs you explicitly supply; the local MCP described below remains the option
|
|
14
|
+
for workspace files and responsive screenshots.
|
|
15
|
+
|
|
16
|
+
A **Model Context Protocol (MCP) server** that empowers AI coding assistants (like Claude, Cursor, ChatGPT, etc.) to validate HTML/CSS markup against the official W3C specification engine and perform technical SEO/accessibility audits directly inside local workspaces.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ๐ฌ How It Works (Visual Flow)
|
|
21
|
+
|
|
22
|
+
Imagine asking your AI coding assistant:
|
|
23
|
+
|
|
24
|
+
> **User:** *"I just finished building my homepage. Can you validate it, check for SEO issues, and take responsive screenshots to see if it looks correct?"*
|
|
25
|
+
|
|
26
|
+
Here is the exact flow of how the assistant uses `mcp-web-validator` to audit the code and present results:
|
|
27
|
+
|
|
28
|
+
### 1๏ธโฃ Step 1: Technical & SEO Score Card
|
|
29
|
+
The assistant automatically runs `generate_validation_report` which aggregates standard specs and outputs a unified PageSpeed-style scorecard directly in your chat:
|
|
30
|
+
|
|
31
|
+
# ๐ Web Validation & SEO Audit Report โ ๐ข **92**/100
|
|
32
|
+
*Generated for: `index.html`*
|
|
33
|
+
|
|
34
|
+
#### โก Page Health Scores (PageSpeed Inspired)
|
|
35
|
+
| Score Card | Status | Score |
|
|
36
|
+
| :--- | :---: | :---: |
|
|
37
|
+
| **W3C HTML Validation** | ๐ Needs Work | **88** / 100 |
|
|
38
|
+
| **SEO & Accessibility** | ๐ Warnings | **88** / 100 |
|
|
39
|
+
| **Links Integrity** | ๐ข All Good | **100** / 100 |
|
|
40
|
+
|
|
41
|
+
### 2๏ธโฃ Step 2: Responsive Viewport Screenshot Audits
|
|
42
|
+
The assistant launches local Puppeteer using `capture_screenshots` to render the page across multiple devices:
|
|
43
|
+
|
|
44
|
+
| Desktop (1440x900) | Tablet (768x1024) | Mobile (375x812) |
|
|
45
|
+
| :---: | :---: | :---: |
|
|
46
|
+
| ๐ฅ๏ธ `desktop.png` | ๐ `tablet.png` | ๐ฑ `mobile.png` |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## โจ Features
|
|
51
|
+
|
|
52
|
+
- **HTML Validation**: Leverages the official W3C Nu HTML Checker API (no API keys required).
|
|
53
|
+
- **CSS Validation**: Calls the W3C Jigsaw CSS Validator API to debug stylesheets.
|
|
54
|
+
- **Technical SEO Check**: Audits title/description lengths, viewport responsiveness, heading hierarchies, Open Graph metadata, and image alt attributes.
|
|
55
|
+
- **Broken Link Checker**: Scans HTML documents for broken internal or external URLs.
|
|
56
|
+
- **Schema Validator**: Parses and validates embedded JSON-LD structured schemas.
|
|
57
|
+
- **Visual Viewport Audits**: Uses a headless Puppeteer browser locally to capture responsive layout screenshots (desktop, tablet, mobile) for design auditing.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ๐ ๏ธ Tools Exposed
|
|
62
|
+
|
|
63
|
+
1. `validate_local_html`
|
|
64
|
+
- **Arguments**: `filePath: string` (Absolute or relative path to the local HTML file)
|
|
65
|
+
- **Description**: Submits local HTML to the W3C Nu Checker and returns syntax errors/warnings.
|
|
66
|
+
2. `validate_url`
|
|
67
|
+
- **Arguments**: `url: string` (The live public URL to audit)
|
|
68
|
+
- **Description**: Validates live page markup against W3C standards.
|
|
69
|
+
3. `validate_local_css`
|
|
70
|
+
- **Arguments**: `filePath: string` (Absolute or relative path to the CSS file)
|
|
71
|
+
- **Description**: Checks local CSS syntax against the W3C Jigsaw API.
|
|
72
|
+
4. `audit_seo_metadata`
|
|
73
|
+
- **Arguments**: `htmlContent: string` (Raw HTML string)
|
|
74
|
+
- **Description**: Performs a fast, local SEO audit (titles, descriptions, headings, images, alt tags).
|
|
75
|
+
5. `check_broken_links`
|
|
76
|
+
- **Arguments**: `htmlContent: string`, `baseUrl?: string`
|
|
77
|
+
- **Description**: Tests all links in the document to detect 404s or broken URLs.
|
|
78
|
+
6. `validate_schema_markup`
|
|
79
|
+
- **Arguments**: `htmlContent: string`
|
|
80
|
+
- **Description**: Validates JSON-LD schema syntax.
|
|
81
|
+
7. `generate_validation_report`
|
|
82
|
+
- **Arguments**: `htmlFilePath: string`, `cssFilePath?: string`, `baseUrl?: string`
|
|
83
|
+
- **Description**: Automatically runs all checks (HTML/CSS syntax, SEO audit, JSON-LD, broken links) and generates a unified Markdown report card styled with PageSpeed-inspired scoring.
|
|
84
|
+
8. `capture_screenshots`
|
|
85
|
+
- **Arguments**: `targetPath: string` (Path to local HTML file or HTTP(S) URL), `outputDir?: string`, `viewports?: Array<{ name: string, width: number, height: number }>`
|
|
86
|
+
- **Description**: Renders the target in a local headless browser and saves screenshots across desktop, tablet, and mobile views.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ๐ Configuration
|
|
91
|
+
|
|
92
|
+
### 1. Claude Desktop
|
|
93
|
+
Add this to your `claude_desktop_config.json`:
|
|
94
|
+
|
|
95
|
+
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
96
|
+
* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"mcp-web-validator": {
|
|
102
|
+
"command": "npx",
|
|
103
|
+
"args": ["-y", "mcp-web-validator"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2. Cursor
|
|
110
|
+
To use this inside **Cursor**, navigate to **Settings > Features > MCP**:
|
|
111
|
+
1. Click **+ Add New MCP Server**.
|
|
112
|
+
2. Set Name: `mcp-web-validator`
|
|
113
|
+
3. Set Type: `command`
|
|
114
|
+
4. Set Command: `npx -y mcp-web-validator`
|
|
115
|
+
|
|
116
|
+
### 3. Development / Local Execution
|
|
117
|
+
To run and test the server locally:
|
|
118
|
+
```bash
|
|
119
|
+
git clone https://github.com/AKzar1el/mcp-web-validator.git
|
|
120
|
+
cd mcp-web-validator
|
|
121
|
+
npm install
|
|
122
|
+
npm run build
|
|
123
|
+
node dist/index.js
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## ๐ License
|
|
129
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
package/dist/index.d.ts
ADDED