URL Reputation and Validity Checker

URL Reputation and Validity Checker

Validates URLs and checks their reputation to help identify AI hallucinations and verify web page authenticity.

Category
访问服务器

README

URL Reputation and Validity Checker

A FASTMCP 2.0-based service that validates URLs and checks their reputation to help identify AI hallucinations and verify web page authenticity.

Features

  • URL Validation: Verify that URLs resolve to actual web pages
  • Reputation Scoring: 0-100 score based on domain age, web archive presence, and technical factors
  • Link Extraction: Extract and validate links from HTML or text content
  • Historical Analysis: Check domain age via WHOIS and Wayback Machine
  • AI Hallucination Detection: Identify patterns common in AI-generated URLs
  • Caching: Redis-based caching for improved performance
  • Docker Support: Easy deployment with Docker and docker-compose

Quick Start

Using Docker (Recommended)

  1. Clone the repository:
git clone <repository-url>
cd reputation-and-validity-checker
  1. Start the services:
docker-compose up -d

The MCP server will be available at http://localhost:5000.

Local Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Start Redis (optional, for caching):
docker run -d -p 6379:6379 redis:7-alpine
  1. Run the server:
python -m url_reputation_checker.server

MCP Tools

check_links_reputation

Check reputation for a list of URLs.

Parameters:

  • urls: List of URLs to validate

Returns:

  • List of validation results with reputation scores

Example:

result = await check_links_reputation([
    "https://example.com",
    "https://github.com"
])

extract_and_check_links

Extract links from content and check their reputation.

Parameters:

  • content: HTML or text content
  • content_type: "html", "text", or "auto" (default: "auto")

Returns:

  • Extracted links with validation results and summary

Example:

result = await extract_and_check_links(
    "<a href='https://example.com'>Link</a>",
    content_type="html"
)

validate_url

Validate a single URL.

Parameters:

  • url: URL to validate

Returns:

  • Detailed validation information

get_domain_history

Get historical information about a domain.

Parameters:

  • domain: Domain name or URL

Returns:

  • Domain creation date, WHOIS info, and Wayback Machine data

Reputation Scoring

The reputation score (0-100) is calculated based on:

  • Domain Age (0-30 points):

    • 5+ years: 30 points
    • 2-5 years: 20 points
    • 1-2 years: 15 points
    • 6-12 months: 10 points
    • 3-6 months: 5 points
    • <3 months: 2 points
  • Web Archive Presence (0-20 points):

    • 100+ snapshots: 20 points
    • 50-99 snapshots: 15 points
    • 20-49 snapshots: 10 points
    • 5-19 snapshots: 5 points
    • 1-4 snapshots: 2 points
  • Technical Factors (0-25 points):

    • Valid SSL: 10 points
    • Fast response (<1s): 10 points
    • HTTP 200 status: 5 points
  • Consistency (0-25 points):

    • No warnings: 25 points
    • 1 warning: 15 points
    • 2 warnings: 10 points
    • 3 warnings: 5 points

AI Hallucination Detection

The service checks for patterns commonly seen in AI-generated URLs:

  • Overly specific blog paths (e.g., /blog/2023/03/15/specific-topic)
  • Version-specific API documentation URLs
  • Excessive path depth (>6 levels)
  • Over-hyphenated product names
  • Typosquatting attempts
  • Excessive subdomains

Configuration

Environment variables:

  • REDIS_URL: Redis connection URL (default: redis://localhost:6379)
  • MCP_SERVER_HOST: Server host (default: 0.0.0.0)
  • MCP_SERVER_PORT: Server port (default: 5000)

Development

  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest
  1. Format code:
black url_reputation_checker/
  1. Lint code:
ruff url_reputation_checker/

Docker Build

Build the Docker image:

docker build -t url-reputation-checker .

Run with docker-compose:

docker-compose up -d

View logs:

docker-compose logs -f

Example Usage

Python Client Example

import asyncio
from fastmcp import FastMCPClient

async def main():
    async with FastMCPClient("http://localhost:5000") as client:
        # Check a list of URLs
        results = await client.call_tool(
            "check_links_reputation",
            urls=[
                "https://github.com",
                "https://example-fake-site-12345.com"
            ]
        )
        
        for result in results:
            print(f"{result['url']}: {result['reputation_score']}/100")
        
        # Extract and check links from HTML
        html_content = """
        <html>
            <body>
                <a href="https://google.com">Google</a>
                <a href="https://fake-news-site.com">Fake News</a>
            </body>
        </html>
        """
        
        extraction_result = await client.call_tool(
            "extract_and_check_links",
            content=html_content,
            content_type="html"
        )
        
        print(f"Found {extraction_result['summary']['total_links']} links")
        print(f"Average reputation: {extraction_result['summary']['average_reputation_score']}")

if __name__ == "__main__":
    asyncio.run(main())

API Endpoints

The MCP server exposes tools that can be called via the MCP protocol. Additionally, it provides resources:

  • /url_validation_report: Get a formatted report of all validated URLs
  • /cache_stats: Get cache statistics

Troubleshooting

Redis Connection Issues

If Redis is not available, the service will continue to work without caching. To disable Redis entirely, set:

export REDIS_URL=""

WHOIS Lookup Failures

Some domains may not have WHOIS information available due to privacy protection or registry limitations. The service will continue with other checks.

Wayback Machine Rate Limiting

The Wayback Machine API may rate limit requests. The service handles this gracefully and will skip historical data if unavailable.

License

MIT License - see LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选