mcpField
S
StealthGuard 402

StealthGuard 402

远程服务
stealthguard-402.onrender.com金融数据0今天更新

关于 StealthGuard 402

StealthGuard 402 是面向需要网页提取、市场信号和交易前检查的 Agent 的开源 MCP 服务。其工具结合反机器人抓取与提示注入过滤、Polymarket 订单流分析,以及合约和流动性检查。

主要功能

  1. 01反机器人网页抓取与内容提取
  2. 02过滤抓取内容中的提示注入
  3. 03Polymarket 概率与大户订单流分析
  4. 04Base 和 Solana 交易前安全检查

适用场景

  1. 01抓取网页内容并过滤注入陷阱
  2. 02对比预测概率、现货动能与订单流
  3. 03交易前检查代币合约和 DEX 流动性

MCP 相关

该服务通过 stdio 和 Streamable HTTP 提供三个工具:`stealth_scrape_and_sanitize`、`polymarket_alpha_divergence` 和 `pre_trade_agent_gate`。文档还列出托管的远程 MCP 端点。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://stealthguard-402.onrender.com/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

工具

15
参数类型必填说明
urlstring是目标网址
render_jsboolean否启用隐身无头浏览器渲染
strict_modeboolean否确定性净化严格程度

详细介绍

StealthGuard 402 🛡️ — 用于网页抓取与市场情报的开源 MCP 服务

License: MIT MCP Standard Python Base Mainnet Solana Mainnet Glama

此仓库包含 StealthGuard 402 的完整开源模型上下文协议(MCP)服务实现。它为大模型 Agent(Claude Desktop、Cursor、Windsurf、LangChain)提供以下工具:绕过 Cloudflare 的网页抓取、提示词注入防火墙净化、Polymarket 巨鲸订单簿背离分析,以及跨链交易前 Agent 门控。


🛠️ 已实现的 MCP 工具

此 MCP 服务通过标准的 stdio 和流式 HTTP 传输提供以下工具:

工具名称描述关键参数
stealth_scrape_and_sanitize使用 Scrapling 绕过 Cloudflare Turnstile、Akamai 和反机器人保护,提取干净的网页内容,并在将内容纳入大模型上下文前清除提示词注入陷阱。url(字符串,必需)、render_js(布尔值,默认:false)、strict_mode(布尔值,默认:true)
polymarket_alpha_divergence扫描 Polymarket 实时预测市场,计算预测赔率与链上现货动能之间的背离,并追踪巨鲸订单簿流向。category(字符串,例如 crypto、politics、ai)、limit(整数,默认:25)
pre_trade_agent_gate面向自主 Agent 的统一交易前安全门:审计合约字节码、验证 Base 和 Solana 上的 DEX LP 深度,并净化项目元数据。token_or_service_address(字符串,必需)、chain(base 或 solana,默认:base)、strict_mode(布尔值)

🚀 从源代码运行(本地 Stdio 传输)

你可以使用 Python 和模型上下文协议 SDK,从源代码在本地运行此 MCP 服务。

1. 安装
# Clone the open-source repository
git clone https://github.com/ak10082247-max/stealthguard-402.git
cd stealthguard-402

# Set up virtual environment
python -m venv .venv

# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.\.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
2. 配置 Claude Desktop

将此服务添加到你的 claude_desktop_config.json:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:%APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "stealthguard-402": {
      "command": "python",
      "args": [
        "-m",
        "src.mcp_server"
      ],
      "cwd": "/absolute/path/to/stealthguard-402"
    }
  }
}

或者通过 uv 运行:

{
  "mcpServers": {
    "stealthguard-402": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/stealthguard-402",
        "python",
        "-m",
        "src.mcp_server"
      ]
    }
  }
}
3. 配置 Cursor 或 Windsurf

添加到你的工作区 .cursor/mcp.json 或 Windsurf 设置中:

{
  "mcpServers": {
    "stealthguard-402": {
      "command": "python",
      "args": ["-m", "src.mcp_server"]
    }
  }
}

🌐 连接托管的远程 MCP 端点

对于云部署和远程 Agent 集成,StealthGuard 通过高可用基础设施全天候运行:

  • 远程 MCP URL:https://stealthguard-402.onrender.com/mcp
  • 协议:模型上下文协议(可流式传输的 HTTP / SSE JSON-RPC 2.0)
  • 发现清单:https://stealthguard-402.onrender.com/.well-known/mcp/server-card.json
  • x402 清单:https://stealthguard-402.onrender.com/.well-known/x402.json

🏛️ 系统架构

sequenceDiagram
    autonumber
    actor LLM as Claude / Agent / Cursor
    participant MCP as StealthGuard MCP Server
    participant Scrapling as Scrapling Anti-Bot Engine
    participant Firewall as CanaryGuard Heuristic Filter
    participant Target as Destination Web Page

    LLM->>MCP: tools/call ("stealth_scrape_and_sanitize", { url })
    MCP->>Scrapling: Fetch Destination (Bypass Cloudflare)
    Scrapling->>Target: HTTP Request with Dynamic Fingerprinting
    Target-->>Scrapling: HTML Payload
    Scrapling->>Firewall: Extract Text & Scan for Injections
    Firewall-->>MCP: Sanitized Text + Safety Receipt
    MCP-->>LLM: Safe Content Payload (Zero Prompt Leaks)

📦 开发者集成与自主自动付款

StealthGuard 支持在 Base 主网(eip155:8453)和 Solana 主网(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)上实现 100% 免 Gas 自动结算。Agent 钱包无需持有原生 Gas($0 ETH / $0 SOL)。

1. 自主 Agent 自动付款快速入门(TypeScript)

使用 @x402/fetch 包装标准 fetch,自动检测 HTTP 402、签署 EIP-712 付款授权,并解锁完整、未经删减的抓取与情报数据流:

npm install @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:8453", new ExactEvmScheme(account));

const xFetch = wrapFetchWithPayment(fetch, client);
const res = await xFetch("https://stealthguard-402.onrender.com/v1/stealth_scrape_and_sanitize", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: "https://example.com", strict_mode: true }),
});
const data = await res.json();
console.log("Full Sanitized Content:", data);
2. 自主 Agent 自动支付快速入门(Python)

AI Agent 框架(LangChain、CrewAI、AutoGen)可在 Python 中自动完成 402 挑战的结算:

pip install requests eth-account
import base64, json, secrets, time, requests
from eth_account import Account
from eth_account.messages import encode_typed_data

def paid_stealth_scrape(target_url: str, private_key: str):
    account = Account.from_key(private_key)
    endpoint = "https://stealthguard-402.onrender.com/v1/stealth_scrape_and_sanitize"
    payload = {"url": target_url, "strict_mode": True}

    # Step 1: Initial probe (triggers 402 with structured 50% teaser + challenge)
    res = requests.post(endpoint, json=payload)
    if res.status_code == 200:
        return res.json()

    # Step 2: Auto-sign EIP-712 transfer authorization (100% gasless on Base)
    raw_pr = res.headers.get("PAYMENT-REQUIRED") or res.headers.get("X-Payment-Required")
    pr_json = json.loads(base64.b64decode(raw_pr).decode("utf-8"))
    accepted = next(a for a in pr_json["accepts"] if "8453" in str(a.get("network", "")))

    now = int(time.time())
    nonce = secrets.token_bytes(32)
    types = {"TransferWithAuthorization": [
        {"name": "from", "type": "address"}, {"name": "to", "type": "address"},
        {"name": "value", "type": "uint256"}, {"name": "validAfter", "type": "uint256"},
        {"name": "validBefore", "type": "uint256"}, {"name": "nonce", "type": "bytes32"},
    ]}
    domain = {"name": "USD Coin", "version": "2", "chainId": 8453, "verifyingContract": accepted["asset"]}
    msg = {"from": account.address, "to": accepted["payTo"], "value": int(accepted["amount"]), "validAfter": 0, "validBefore": now + 300, "nonce": nonce}
    sig = account.sign_message(encode_typed_data(domain_data=domain, message_types=types, message_data=msg)).signature.hex()
    
    payment_b64 = base64.b64encode(json.dumps({
        "x402Version": 2, "resource": pr_json.get("resource"), "accepted": accepted,
        "payload": {"signature": "0x" + sig.lstrip("0x"), "authorization": {
            "from": account.address, "to": accepted["payTo"], "value": str(accepted["amount"]),
            "validAfter": "0", "validBefore": str(now + 300), "nonce": "0x" + nonce.hex()
        }}
    }).encode()).decode()

    # Step 3: Replay with PAYMENT-SIGNATURE
    paid_res = requests.post(endpoint, json=payload, headers={"PAYMENT-SIGNATURE": payment_b64})
    return paid_res.json()
3. 直接调用 REST API(cURL)
# Returns 402 with structured 50% free preview + unlock instructions:
curl -X POST https://stealthguard-402.onrender.com/v1/stealth_scrape_and_sanitize \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "strict_mode": true}'

# Polymarket whale orderflow
curl -X POST https://stealthguard-402.onrender.com/v1/polymarket-odds-pulse \
  -H "Content-Type: application/json" \
  -d '{"category": "crypto"}'

💳 可选云订阅(MCPize / Apify)

对于希望使用开箱即用的托管基础设施,并通过信用卡按月固定计费而非自托管的团队:


📄 许可证

此开源项目采用 MIT License 授权,详情请参阅 LICENSE 文件。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。