StealthGuard 402 について
StealthGuard 402は、ウェブ抽出、市場シグナル、取引前チェックを必要とするエージェント向けのオープンソースMCPサーバーです。アンチボットスクレイピング、プロンプトインジェクション対策、Polymarketの注文フロー分析、コントラクトと流動性の確認を組み合わせます。
主な機能
- 01アンチボット対応のウェブスクレイピングと抽出
- 02取得コンテンツのプロンプトインジェクション対策
- 03Polymarketのオッズと大口注文フロー分析
- 04BaseとSolanaの取引前セキュリティチェック
活用シーン
- 01ウェブコンテンツを取得し、インジェクションを除去
- 02予測オッズと現物モメンタム、注文フローを比較
- 03取引前にトークンコントラクトとDEX流動性を確認
MCP 対応
stdioとStreamable HTTPで、`stealth_scrape_and_sanitize`、`polymarket_alpha_divergence`、`pre_trade_agent_gate`の3ツールを公開します。ホスト型リモートMCPエンドポイントも案内されています。
設定
リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。
https://stealthguard-402.onrender.com/mcpclaude mcp add --transport http ak10082247-max-stealthguard-402 https://stealthguard-402.onrender.com/mcp{"mcpServers":{"ak10082247-max-stealthguard-402":{"type":"http","url":"https://stealthguard-402.onrender.com/mcp"}}}Cursor で開く{"servers":{"ak10082247-max-stealthguard-402":{"type":"http","url":"https://stealthguard-402.onrender.com/mcp"}}}VS Code で開く{"mcpServers":{"ak10082247-max-stealthguard-402":{"type":"http","url":"https://stealthguard-402.onrender.com/mcp"}}}{"mcpServers":{"ak10082247-max-stealthguard-402":{"serverUrl":"https://stealthguard-402.onrender.com/mcp"}}}コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。
ツール
15| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
| url | string | はい | 対象 URL |
| render_js | boolean | いいえ | ステルスヘッドレスブラウザーのレンダリングを有効にします |
| strict_mode | boolean | いいえ | 決定的なサニタイズの厳格さ |
詳細
StealthGuard 402 🛡️ — Webスクレイピングと市場インテリジェンスのためのオープンソースMCPサーバー
このリポジトリには、StealthGuard 402 の完全なオープンソースModel Context Protocol(MCP)サーバー実装が含まれています。LLM エージェント(Claude Desktop、Cursor、Windsurf、LangChain)に、Cloudflareを回避するWebスクレイピング、プロンプトインジェクション対策ファイアウォールによるサニタイズ、Polymarketの大口注文板の乖離分析、クロスチェーンの取引前エージェントゲート用ツールを提供します。
🛠️ 実装済みのMCPツール
このMCPサーバーは、標準のstdioおよびストリーミング可能なHTTPトランスポートを通じて、以下のツールを提供します。
| ツール名 | 説明 | 主なパラメーター |
|---|---|---|
stealth_scrape_and_sanitize | Scraplingを使用してCloudflare Turnstile、Akamai、ボット対策を回避し、Webコンテンツを抽出して、LLMのコンテキストに取り込む前にプロンプトインジェクションの罠を取り除きます。 | url(string、必須)、render_js(boolean、デフォルト:false)、strict_mode(boolean、デフォルト:true) |
polymarket_alpha_divergence | Polymarketの予測市場をリアルタイムでスキャンし、予測オッズとオンチェーンのスポットモメンタムの乖離を算出して、大口注文板のフローを追跡します。 | category(string、例:crypto、politics、ai)、limit(int、デフォルト:25) |
pre_trade_agent_gate | 自律型エージェント向けの統合取引前セキュリティゲートです。コントラクトのバイトコードを監査し、BaseとSolana上のDEX LPの厚みを検証して、プロジェクトのメタデータをサニタイズします。 | token_or_service_address(string、必須)、chain(baseまたはsolana、デフォルト:base)、strict_mode(boolean) |
🚀 ソースから実行(ローカルstdioトランスポート)
PythonとModel Context Protocol 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エンドポイントへの接続
クラウドへのデプロイやリモートエージェントとの連携向けに、StealthGuardは高可用性インフラストラクチャ上で24時間365日稼働しています。
- リモートMCP URL:
https://stealthguard-402.onrender.com/mcp - プロトコル:Model Context Protocol(ストリーミング可能な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 Mainnet(eip155:8453)およびSolana Mainnet(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)で、ガス代不要の自動決済を100%サポートします。エージェントのウォレットにネイティブガス($0 ETH/$0 SOL)は必要ありません。
1. 自律型エージェントの自動決済クイックスタート(TypeScript)
標準のfetchを@x402/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. 自律型エージェントによる自動支払いのクイックスタート(Python)
AI エージェントのフレームワーク(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)
セルフホストではなく、クレジットカードで毎月定額請求される、すぐに利用できるマネージドインフラストラクチャをお求めのチーム向けです。
- MCPize Directory:mcpize.com/dashboard から接続できます
- Apify Pay-Per-Event:apify.com でのアクター配布
📄 ライセンス
このオープンソースプロジェクトは MIT License の下でライセンスされています。詳細は LICENSE ファイルをご覧ください。
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。