ከProxyHub MCP በእያንዳንዱ መስመር አንድ IP:port ለማውጣት ከቻት በተቀዳ ጽሑፍ ሳይሆን በሙሉ የJSON-RPC ምላሽ ይጀምሩ።

  1. በMCP ደንበኛዎ list_proxiesን ይጥሩ፣ typeንም ወደ http ያቀናብሩ።
  2. ሙሉ ምላሹን እንደ mcp-response.json ያስቀምጡ።
  3. የሚከተለውን መደበኛ ቤተ መጻሕፍት የሚጠቀም መቀየሪያ ከምላሹ አጠገብ እንደ mcp-to-file.py ያስቀምጡ።
import json
from ipaddress import IPv4Address
from pathlib import Path

reply = json.loads(
    Path("mcp-response.json").read_text(encoding="utf-8")
)
if "error" in reply:
    raise RuntimeError("MCP returned a JSON-RPC error")

result = reply["result"]
if result.get("isError"):
    raise RuntimeError("The proxy tool reported an error")

data = result["structuredContent"]
endpoints = []
seen = set()

for row in data["proxies"]:
    if row["type"] != "http":
        continue
    host = str(IPv4Address(row["ip"]))
    port = row["port"]
    if type(port) is not int or not 1 <= port <= 65535:
        raise ValueError("Invalid proxy port")
    endpoint = f"{host}:{port}"
    if endpoint not in seen:
        seen.add(endpoint)
        endpoints.append(endpoint)

text = "\n".join(endpoints)
Path("http-proxies.txt").write_text(
    text + ("\n" if text else ""),
    encoding="utf-8",
)
print(f"Saved {len(endpoints)} HTTP endpoints")

በዚያው ማውጫ ያስኬዱት፦

uv run --no-project python mcp-to-file.py

የታተመውን ብዛትና http-proxies.txtን ይፈትሹ። ዋናው ምላሽ ይቀመጣል። የJSON-RPC ስህተቶችና በመሣሪያ ደረጃ ያሉ isError ምላሾች ስህተት ያስነሳሉ፤ ተመሳሳይ ንጥል የሌለው የተሳካ ምላሽ ባዶ ፋይል ይጽፋልና ዜሮ ያሳያል። የመሣሪያው ገደብ በአንድ ጥሪ እስከ 100 ንጥሎች ነው፤ ስለዚህ ውጤቱ የተመለሰውን ምርጫ እንጂ የግድ ሙሉውን የHTTP ፕሮክሲ ዝርዝር አይወክልም።

መቀየሪያው እንደ http የተገለጹ ረድፎችን ብቻ ይቀበላል፣ አሁን ያለው ሰብሳቢ ከሚጠቀምበት የIPv4 ቅርጸት ጋር በመስማማት የIPv4 አጻጻፍንና የወደብ ክልልን ይፈትሻል። ለሌላ ፕሮቶኮል ያንን መረጃ ያቆዩ ወይም የተለየ ፋይል ይጠቀሙ፤ ቀላል የተቀላቀለ IP:port ፋይል ለተቀባዩ ደንበኛ የትኛውን የሰላምታ ልውውጥ መጠቀም እንዳለበት አይነግረውም።

ወደ ፋይል የወጣ ረድፍ አሁንም ውሂብ ነው። updated_at የተቀመጠው ውሂብ የተዘመነበትን ጊዜ ይመዘግባል፣ ከእርስዎ አውታረ መረብ የተደረገ ቀጥታ ጥያቄ አይደለም። የተመረጡትን መገናኛዎች ወደሚያስፈልገው መድረሻ ገደብ ባለው የHTTP ፕሮክሲ ጥያቄ ይሞክሩ። የMCP ጥሪው ካልተሳካ ውሂብ ማምጣቱን ይመርምሩ፤ በኋላ በወጣው መገናኛ የሚደረግ ጥያቄ ካልተሳካ፣ ያንን የተለየ የፕሮክሲ ግንኙነት ይመርምሩ።

ተዛማጅ ጽሑፎች