README.md•1.56 kB
# Broken Link Checker MCP Server
An MCP (Model Context Protocol) server that scans web pages and domains to identify broken links.
## Features
- **Single Page Checking**: Scan all links on a single page
- **Domain-Wide Crawling**: Recursively check all pages within a domain
- **Comprehensive Link Detection**: Checks hyperlinks, images, scripts, stylesheets, and media
- **robots.txt Compliance**: Respects website crawling rules
- **Structured Output**: Returns detailed results with link status and locations
## Installation
```bash
pip install -e .
```
## Usage
Start the MCP server with HTTP transport:
```bash
python src/server.py
```
The server will run on `http://127.0.0.1:8000` by default.
## MCP Tools
### check_page
Check all links on a single page.
**Parameters:**
- `url` (string): The URL of the page to check
### check_domain
Recursively check all pages within a domain.
**Parameters:**
- `url` (string): The root URL of the domain to check
- `max_depth` (integer, optional): Maximum crawl depth (-1 for unlimited, default: -1)
## Output Format
Results are returned in the following structure:
```json
{
"results": [
{
"page_url": "https://example.com/page",
"link_reference": "Click here",
"link_url": "https://broken.com/404",
"status": "Bad"
}
],
"summary": {
"total_links": 150,
"good_links": 145,
"bad_links": 5,
"pages_scanned": 10
}
}
```
## Development
Install development dependencies:
```bash
pip install -e ".[dev]"
```
Run tests:
```bash
pytest
```