323 ንባቦች
323 ንባቦች

MCP + OpenAI Agents SDK: እንዴት ጠንካራ AI Agent ለመፍጠር

Bright Data18m2025/05/27
Read on Terminal Reader

በጣም ረጅም፤ ማንበብ

የ OpenAI አዲስ Agents SDK መተግበሪያዎች የተወሰነ መተግበሪያዎችን ለመፍጠር ቀላል ይቻላል, እና MCP (Model Context Protocol) እነዚህን መተግበሪያዎችን በይነገጽ ውሂብ መዳረሻ ይሰጣል. ይህ መመሪያ በ Bright Data's MCP server እና Gemini LLM በመጠቀም እነዚህን መተግበሪያዎችን እንዴት በመተግበሪያዎችን ለመፍጠር ይቻላል.
featured image - MCP + OpenAI Agents SDK: እንዴት ጠንካራ AI Agent ለመፍጠር
Bright Data HackerNoon profile picture
0-item
1-item

አረንጓዴው አግኝቷል ጊዜAgents SDKከሁለት ሳምንታት በፊት, በዓለም ዙሪያ የ devs hyped ነበር - እና ለስላሳ ምክንያት! በመጨረሻም, አንድ ቀላል መንገድ በእርግጥ መውሰድ እና መውሰድ ይችላሉ ንድፍ የተመሠረተ AI አግኝቷልየሥራ ተደርጓል

ነገር ግን አብዛኛውን ጊዜ ተመሳሳይ ስሜት ውስጥ,MCPይህ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ ጓደኛ

በዚህ መመሪያ ውስጥ,we're going to forge a formidable AI agentየ OpenAI Agents SDK መተግበሪያዎችን በመጠቀም እና በቀጥታ በ MCP ደንበኞች የተጠበቀ የዓለም መሣሪያዎች ላይ ያግኙ. የእርስዎ የ AI አቅርቦት ለመፍጠር ይመዝገቡ!

የ MCP + OpenAI Agents SDK Integration (MCP + የ OpenAI Agents SDK Integration (MCP + የ OpenAI Agents SDK Integration) (የ MCP + የ OpenAI Agents SDK Integration) (የ MCP + የ OpenAI Agents SDK) (የ MCP + የ OpenAI Agents SDK Integration) (የ MCP + የ OpenAI Agents SDK)

የ OpenAI Agents SDK በጣም ታዋቂ Python መሣሪያዎች መካከል አንዱ ነው ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወንዶች ለወ

MCP እንደ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስ የዩናይትድ ስቴትስማንኛውምየአየር ውሂብ ምንጮች ወይም መሣሪያዎች-አካባቢ ፋይሎች, APIs, databases, you name it.

በ OpenAI Agents SDK ጋር MCP መተግበሪያዎችን ያካትታል, የእርስዎ መተግበሪያዎች በይነገጽ ጊዜ, በይነገጽ ሁኔታ ያገኛሉ, በይነገጽ ነገር ግን በይነገጽ bots ወደ የ Powerhouse Data Explorers እና Action-takers ያደርጋሉ!

በ OpenAI Agents SDK በመጠቀም MCP Integration ጋር አንድ AI Agent ለመፍጠር

“እርስዎ ማግኘት ይችላሉ—MCP የ AI አግኝተዋል እንደ እነርሱ ናቸው”የ Iron Manበኮምፒውተር ውስጥ በኮምፒውተር ውስጥ


Your AI agent with MCP superpowers


በዚህ ደረጃ-ጥፍ-ጥፍ ክፍል ውስጥ, የ OpenAI Agents SDK - yep, የ OpenAI አዲስ Python SDK - በ MCP መተግበሪያ ጋር አንድ የ AI መተግበሪያ ለመፍጠር ይሆናል. Why OpenAI Agents SDK and not another library?native MCP supportከባድ ከባድ ከባድ ከባድ ከባድ ከባድየኃይልሰከንዶች ውስጥ

አሁን, አነስተኛ አግኝተዋል: OpenAI የ API ነፃ አይደለም. 😅 ስለዚህ በዚህ መመሪያ ውስጥ,we’ll run it using Gemini as the LLM engine instead(ወደቁም - እኛ በ OpenAI ወይም ሌሎች ሞዴሎች ውስጥ እንዴት መተግበሪያ ይሆናል ).

የ MCP Server እንዴት ይጠቀማል?

ጥሩ ጥያቄ! ፈጣን ለመጀመር, እኛ ወደ መጫወትየ MCP Server አጠቃቀም— አንድ MCP ደንበኞች የድር መተግበሪያ እና ውሂብ ሥራ ለማግኘት የተመሰረተ ነው. ይህ የእርስዎ የ AI Agent ለመፈለግ, ለመጎብኘት, መተግበሪያዎችን ይጠቀማል, እና በይነገጽ ላይ የይነገጽ ውሂብ ያውቃል - CAPTCHAs እናየኮምፒውተር ፎቶዎች.

በ Bright Data MCP Server ️ የተመሠረተ ሁሉንም መሣሪያዎች ዝርዝር ያካትታል:

Tool

Description

search_engine

Scrape SERP data (from Google, Bing, Yandex, and more)

scrape_as_markdown

Scrape a URL and return content in clean Markdown

scrape_as_html

Scrape a URL and return full HTML content

session_stats

View tool usage during the current session

web_data_amazon_product

Get Amazon product info by URL

web_data_amazon_product_reviews

Fetch Amazon reviews for a product

web_data_linkedin_person_profile

Grab LinkedIn profile data

web_data_linkedin_company_profile

Fetch LinkedIn company data

web_data_zoominfo_company_profile

Get ZoomInfo company profile

web_data_instagram_profiles

Fetch Instagram profile details

web_data_instagram_posts

Get Instagram post data

web_data_instagram_reels

Grab Instagram reel data

web_data_instagram_comments

Fetch comments from an Instagram post

web_data_facebook_posts

Extract Facebook post info

web_data_facebook_marketplace_listings

Get Facebook Marketplace listings

web_data_facebook_company_reviews

Scrape Facebook business reviews

web_data_x_posts

Fetch data from X (formerly Twitter) posts

web_data_zillow_properties_listing

Get Zillow property listings

web_data_booking_hotel_listings

Fetch Booking.com hotel listings

web_data_youtube_videos

Extract YouTube video metadata

scraping_browser_navigate

Navigate to a new URL in a virtual browser

scraping_browser_go_back

Go back one page in the browser

scraping_browser_go_forward

Go forward one page in the browser

scraping_browser_click

Click a page element (needs selector)

scraping_browser_links

Get all links and selectors on the page

scraping_browser_type

Type into a form or input

scraping_browser_wait_for

Wait for an element to appear

scraping_browser_screenshot

Capture a screenshot of the current page

scraping_browser_get_html

Get raw HTML from the page

scraping_browser_get_text

Extract text content from the page

search_engine

SERP ውሂብ (የ Google, Bing, Yandex እና ሌሎች)

scrape_as_markdown

አንድ URL መቁረጥ እና ንጥረ Markdown ውስጥ ንጥረ ንጥረ ንጥረ ንጥረ ንጥረ

scrape_as_html

አንድ URL መቁረጥ እና ሙሉ የ HTML ይዘት ይመልከቱ

session_stats

የኮምፒውተር አጠቃቀም በሳምንት ውስጥ ይመልከቱ

web_data_amazon_product

Amazon ምርቶች መረጃ በ URL

web_data_amazon_product_reviews

ምርቶች ለ Amazon ግምገማዎች

web_data_linkedin_person_profile

የ LinkedIn profil መረጃ ያግኙ

web_data_linkedin_company_profile

የ LinkedIn ኩባንያ መረጃ

web_data_zoominfo_company_profile

የ ZoomInfo ኩባንያ profil ያግኙ

web_data_instagram_profiles

የ Instagram profil ዝርዝር

web_data_instagram_posts

Instagram ልጥፍ መረጃ ያግኙ

web_data_instagram_reels

Instagram Real ውሂብ ያግኙ

web_data_instagram_comments

የ Instagram ልጥፎች ላይ አስተያየት ያግኙ

web_data_facebook_posts

የፌስቡክ ልጥፍ Info

web_data_facebook_marketplace_listings

የ Facebook Marketplace Listings ያግኙ

web_data_facebook_company_reviews

Facebook የንግድ ግምገማዎች Scrape

web_data_x_posts

የ X (ወደቱ Twitter) ልጥፎች ከ Data Fetch

web_data_zillow_properties_listing

Zillow መኖሪያ ቤት ዝርዝር ማግኘት

web_data_booking_hotel_listings

ፌስቡክBooking.com ላይሆቴል ዝርዝር

web_data_youtube_videos

የ YouTube ቪዲዮ ማተሚያ

scraping_browser_navigate

በዩናይትድ ስቴትስ ውስጥ አዲስ URL ወደ መጓጓጓዣ

scraping_browser_go_back

በ browser ውስጥ አንድ ገጽ ይጎብኙ

scraping_browser_go_forward

በ browser ውስጥ አንድ ገጽ ይጎብኙ

scraping_browser_click

አንድ ገጽ ክፍሎች ጠቅ ያድርጉ (needs selector)

scraping_browser_links

ሁሉንም አገናኞች እና selectors በ ገጽ ላይ ያግኙ

scraping_browser_type

አንድ ቅርጸት ወይም input

scraping_browser_wait_for

አንድ ንጥረ ነገር ይመልከቱ

scraping_browser_screenshot

የመጨረሻው ገጽ አንድ ስሪት ፎቶ ያግኙ

scraping_browser_get_html

የእርስዎ ገጽ ከ Raw HTML ያግኙ

scraping_browser_get_text

ጽሑፍ ይዘት ከ ገጽ

የ MCP Server ዎን ያግኙን እንዴት ያግኙ?

ደረጃ #1: የፕሮጀክት መፍጠር

በዚህ tutorial ክፍል ጋር ተከተል ለማረጋገጥ የሚከተሉትን መስፈርቶች አለዎት:

  • Python 3.10+ በአካባቢው ላይ ተጫዋች
  • Node.js በአካባቢው መጫን
  • የ OpenAI Agents SDK ለ supported LLM አቅራቢ ከ አንድ API ቁልፍ (እኛ ይህን ለ Gemini ይሰጣል)

የእርስዎን የ Python ፕሮጀክቱ በይፋ መፍጠር እና የ Python ፕሮጀክቱ በይፋ መፍጠር ይሆናል:


/openai-agents-mcp
├── venv/
├── .env
└── agent.py


አሁን የእርስዎ ምናባዊ መኖሪያ ቤት (venv/) እና የሚፈልጉትን ፓኬቶች መጫን:


pip install openai-agents python-dotenv


እንዴት ነው:

  • openai-agents ነው የ OpenAI Agents Python SDK—እርስዎ የ AI Agent Magic Gateway
  • python-dotenv አንድ .env ፋይሎችን ከ ግምገማዎችን ያውቃል

ቀጣይ: Openagent.pyእና የእርስዎን መተግበሪያዎችን ያግኙ. ጊዜ እነዚህን የአካባቢ ተለዋዋዋጭዎችን ያንብቡ እና መኪና ለመጀመር ለመፍጠር ይጀምራል:


import asyncio
from dotenv import load_dotenv
import os
from agents import (
    Runner,
    Agent,
    OpenAIChatCompletionsModel,
    set_default_openai_client,
    set_tracing_disabled
)
from openai import AsyncOpenAI
from agents.mcp import MCPServerStdio

# Load environment variables from the .env file
load_dotenv()

async def run():
    # AI Agent logic goes here...
    pass

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

ቦም! እርስዎ ከባድ ጋር ይጀምራል.

ደረጃ #2: Bright Data MCP Server ጋር ይጀምራል

አንተየእርስዎ የ AI Agent ከ MCP Server ጋር መገናኘት ይፈልጋሉ?

እርስዎ መጀመሪያ አንድ MCP ደንበኞች ይፈልጋሉ (እና,ምናልባት ካፒታልፎቶዎን ይመልከቱ!


Thanks, Captain Obvious!

ከባድዎ ከባድዎ ከባድዎ ከባድዎ ከባድዎ ከባድዎ ከባድዎ ከባድዎBright Data MCP Serverበመጀመሪያ, በዚህ ክፍል,የእርስዎ የ API ቁልፍ ያግኙ እና በ Official Bright Data MCP Server Docs መሠረት ወደ ደንበኞች መጀመር.

አንድ ጊዜ መጀመር, ይህ ኮምፒውተር በመጠቀም ይጀምራል:


npx -y @brightdata/mcp 


ሁሉም ነገር ትክክለኛ ነው ከሆነ, እንደዚህ ተመሳሳይ ውፅዓት ይመልከቱ:


Checking for required zones...
Required zone "mcp_unlocker" already exists
Starting server...


አግኝቷል!

አሁን, አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል አግኝተዋል.envያግኙ እና እነዚህ ሁለት መስመሮች ያግኙ:

BRIGHT_DATA_API_TOKEN="<YOUR_BRIGHT_DATA_API_TOKEN>"
BRIGHT_DATA_BROWSER_AUTH="<BRIGHT_DATA_BROWSER_AUTH>"

በ Bright Data MCP server docs ውስጥ ያካትታሉትን ጥቅሞች ጋር ቦታዎች ይቀላቀሉ.

መኖሪያ ቤትagent.pyከሁለት ክፍሎች ውስጥ እንደዚህ ይመልከቱ:


BRIGHT_DATA_API_TOKEN = os.getenv("BRIGHT_DATA_API_TOKEN")
BRIGHT_DATA_BROWSER_AUTH = os.getenv("BRIGHT_DATA_BROWSER_AUTH")


ከኮድ ከ MCP መገናኘት በመጀመሪያ ጊዜ እነዚህን ዋጋዎችን ይጠቀማል.

እና እንደ ይህ — bam 💥 — የእርስዎን MCP ደንበኞች ላይ ነው, ይጀምራል, እና የእርስዎን ኤች.ኤ.ኤ. ኤ. ደንበኞች እንደ ደንበኞች ይገልጻል.

ደረጃ #3: የእርስዎ AI Agent ለመፍጠር

በዚህ ክፍል ውስጥ መተግበሪያ ውስጥ እንደገና, እኛ በ OpenAI Agents SDK ጋር Gemini (የ Google የተሻለ LLM) መጠቀም ይሆናል.

የመጀመሪያው -እርስዎ ይህን ማድረግ ይችላሉ?ሁለቱም -ለምን በ OpenAI ብቻ መጠቀም አይችልም?

Responseአዎ, እርስዎ ይህን ማድረግ ይችላሉ!Gemini exposes an OpenAI-compatible APIበ OpenAI Agents SDK እንደ የ Drop-in ክፍያ እንደ እርስዎ መውሰድ ይችላሉ.It’s free—በ OpenAI, እርስዎ በቶኮን በመስጠት ይወዳሉ.


Approved!

ስለዚህ, እዚህ በ OpenAI helyett በ Gemini በመጠቀም ፍላጎት ነው! 💡

አግኝቷልGemini API Key ከ Google AI Studioእርስዎ ላይ ያግኙ.envፋይል :


GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>"


ከዚያም ውስጥagent.pyይህ መለያ እንደዚህ ይመልከቱ:


GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")


አሁን ሁሉም ነገር ያካትታሉ አንድ ተግባር ለመፍጠር - የGemini model, OpenAI SDK, and the MCP server(እኛ ️ ወደ ኮድ ውስጥ ይመዝገቡ) :


async def create_mcp_ai_agent(mcp_server):
    # Initialize Gemini client using its OpenAI-compatible interface
    gemini_client = AsyncOpenAI(
        api_key=GEMINI_API_KEY,
        base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
    )

    # Set the default OpenAI client to Gemini
    set_default_openai_client(gemini_client)
    # Disable tracing to avoid tracing errors being logged in the terminal
    set_tracing_disabled(True)

    # Create an agent configured to use the MCP server and Gemini model
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant",
        model=OpenAIChatCompletionsModel(
            model="gemini-2.0-flash",
            openai_client=gemini_client,
        ),
        mcp_servers=[mcp_server]
    )

    return agent


ከሌሎች ተስማሚ ሞዴሎች (እንደ Claude, Mistral ወይም ሌሎች ሞዴሎች) ለመጠቀም ይፈልጋሉ.base_urlእና ሞዴል ስም መሠረት.

Extra: እርስዎ የ OpenAI መጠቀም ይፈልጋሉ? ምንም ችግር አይደለም. ብቻ እርስዎን ያግኙOPENAI_API_KEYከላይ የሚከተሉትን ቅርጸት ይቀላቀሉ:


async def create_mcp_ai_agent(mcp_server):
    # Create an agent configured to use the MCP server and Gemini model
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant",
        mcp_servers=[mcp_server]
    )

    return agent


ቀላል swap, ተመሳሳይ መተግበሪያ — ይህ የ SDK ጥራት ነው ... 😎

እርስዎ የሚፈልጉ ከሆነ, እንዴት ነውmcp_serverመግቢያ መውሰድ ከ - እኛ ቀጣይ ደረጃ ውስጥ ይጀምራል ( spoiler alert). Continue reading!

ደረጃ #4: የ MCP Server መጀመር

የእርስዎ ውስጥrun()async ተግባር, በ Bright Data MCP Server በመጠቀምnpxእንደ ይህ:


async with MCPServerStdio(
    name="Bright Data web data MCP server, via npx",
    params={
        "command": "npx",
        "args": ["-y", "@brightdata/mcp"],
        "env": {
            "API_TOKEN": BRIGHT_DATA_API_TOKEN,
            "BROWSER_AUTH": BRIGHT_DATA_BROWSER_AUTH,
        }
    },
    client_session_timeout_seconds=180   # To avoid timeout errors
) as server:
    # Create and initialize the AI agent with the running MCP server
    agent = await create_mcp_ai_agent(server)

    # AI agent loop logic...


️ እዚህ ምን ይሆናል? ይህ የ MCP Server በመጠቀም ይጀምራልnpx -y @brightdata/mcpየእርስዎን ግምገማዎችን በመስመር ላይ በመስመር ላይ ያግኙ.

አግኝተዋል: የ Bump አግኝተዋልclient_session_timeout_secondsፎቶ180ሰከንዶች (የመደበኛ ነው)5(በእነርሱእውነተኛ ጊዜ scraping, CAPTCHA መፍትሔ, እና anti-bot ninja movesየ Bright Data MCP Server ጊዜ ይወስዳል .

✅ ቀላል! ብቻ ነገር የ AI Agent ሉህ ለመፍጠር ነው ... እባክዎን ይሸፍናል.

ደረጃ #5: የ AI Agent Loop ማዘጋጀት

በ MCP server async block ውስጥ, REPL (Read-Eval-Print) መስኮት ያውቃሉ, ስለዚህ ተጠቃሚዎች የእርስዎን ጥያቄዎች መውሰድ, የ MCP-powered agent በኩል ያውቃሉ, እና የ Magic ✨ ማግኘት ይችላሉ:


while True:
    # Read the user's request
    request = input("Your request -> ")

    # Exit condition
    if request.lower() == "exit":
        print("Exiting the agent...")
        break

    # Run the request through the agent
    output = await Runner.run(agent, input=request)

    # Print the result to the user
    print(f"Output -> \n{output.final_output}\n\n")


ይህ አነስተኛ Python ስሪት የእርስዎ የ AI ኤጀንሲ ኮምፒዩት ማዕከል ነው. እርስዎን ትዕዛዞችን ይታያል, ወደ ኤጀንሲን ያግኙ, ከዚያም መጨረሻው, ታዋቂ ውጤት ይሰጣል. የእርስዎን የ AI ጓደኛን ለወደፊቱ የቁማር ኮንሰል እንደ ያውቃሉ, እርስዎ "ወደፊቱ" ይደውሉ ድረስ ትዕዛዞችን ያግኙ .

ይህ “WHOA” ጊዜ አላቸው?አይችልም ከሆነ, እባክዎን ያውቃሉ:you just wired up a full AI agent loop using the OpenAI Agents SDK + Bright Data’s MCP server + Gemini!

አሁን ሙሉ ኮድ ይመልከቱ እርስዎ የተሻለ Frankenstein የ AI አውቶማቲኬሽን አስደሳች እንደ ሁሉ ተስማሚ ነው.

ደረጃ #6: ሁሉም ነገር ጋር ያድርጉ

ይህ የ OpenAI Agents SDK + MCP መተግበሪያ (የ Gemini የተመሠረተ ገንዘብ ለመጠበቅ ) ለ መጨረሻ Python ስኬት ነው:


import asyncio
from dotenv import load_dotenv
import os
from agents import (
    Runner,
    Agent,
    OpenAIChatCompletionsModel,
    set_default_openai_client,
    set_tracing_disabled
)
from openai import AsyncOpenAI
from agents.mcp import MCPServerStdio

# Load environment variables from the .env file
load_dotenv()

# Read the required secrets envs from environment variables
BRIGHT_DATA_API_TOKEN = os.getenv("BRIGHT_DATA_API_TOKEN")
BRIGHT_DATA_BROWSER_AUTH = os.getenv("BRIGHT_DATA_BROWSER_AUTH")
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")

async def create_mcp_ai_agent(mcp_server):
    # Initialize Gemini client using its OpenAI-compatible interface
    gemini_client = AsyncOpenAI(
        api_key=GEMINI_API_KEY,
        base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
    )

    # Set the default OpenAI client to Gemini
    set_default_openai_client(gemini_client)
    # Disable tracing to avoid tracing errors being logged in the terminal
    set_tracing_disabled(True)

    # Create an agent configured to use the MCP server and Gemini model
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant",
        model=OpenAIChatCompletionsModel(
            model="gemini-2.0-flash",
            openai_client=gemini_client,
        ),
        mcp_servers=[mcp_server]
    )

    return agent

async def run():
    # Start the Bright Data MCP server via npx
    async with MCPServerStdio(
        name="Bright Data web data MCP server, via npx",
        params={
            "command": "npx",
            "args": ["-y", "@brightdata/mcp"],
            "env": {
                "API_TOKEN": BRIGHT_DATA_API_TOKEN,
                "BROWSER_AUTH": BRIGHT_DATA_BROWSER_AUTH,
            }
        },
        client_session_timeout_seconds=180  # To avoid timeout errors
    ) as server:
        # Create and initialize the AI agent with the running MCP server
        agent = await create_mcp_ai_agent(server)

        # Main REPL loop to process user requests
        while True:
            # Read the user's request
            request = input("Your request -> ")

            # Exit condition
            if request.lower() == "exit":
                print("Exiting the agent...")
                break

            # Run the request through the agent
            output = await Runner.run(agent, input=request)

            # Print the result to the user
            print(f"Output -> \n{output.final_output}\n\n")

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


ብቻ 81 መስመሮች ኮድ. እናንተ ምን ያገኛሉ? የድር ላይ ለመርዳት, የ anti-bots ለመርዳት, እውነተኛ ጊዜ ውሂብ ያካትታል, እና መልስ ይደውሉ - እንደ ይህ ትልቅ ነገር አይደለም. በተጨማሪም Superman ይህን ሊሆን ይችላል. ♂️

አዲስ ጓደኛየፕሮቶኮችእንደ OpenAI Agents SDK እና Bright Data MCP, የ AI አውቶማሽን አሁን ... በጣም ቀላል ነው.

ደረጃ #7: የ MCP-Powered AI Agent ለመሞከር

የእርስዎ ኤች ኤች ኤች ኤን ከ терминаሎች ጋር ይጀምራል:


python agent.py


በ Linux / MacOS ላይ:


python3 agent.py


እርስዎ እንደ ተስማሚ እባክዎን ይደውሉ:


Your request ->


ለምሳሌ, የ MCP መሣሪያዎች አጠቃቀም አግኝተዋል:


What tools are you linked to through MCP?


እርስዎ እንደ ነገር ማግኘት ይሆናል:

The reply from the AI agent


ካለዎት, የእርስዎ የ AI ኤጀንቲ እርስዎ ጋር መገናኘት ይችላሉ ሁሉንም Bright Data MCP መሣሪያዎችን ያውቃል - እና እርስዎ እነሱን ለመጠቀም የተሻለ ነው!

ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎችን ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች ለስላሳ የ MCP መሣሪያዎች :


The PS5 Amazon page


ይህን ለማግኘት, እርስዎ እንደ:


From the Amazon product page "https://www.amazon.com/PlayStation%C2%AE5-console-slim-PlayStation-5/dp/B0CL61F39H/", extract the main info and return it in JSON format


ያግኙ እና ውጤት ይሆናል:

The MCP-powered AI agent in action


በእርግጥ, ውፅዓት እንደ አንድ ነገር መሆን አለበት:


{
  "title": "PlayStation®5 console (slim)",
  "seller_name": "Amazon.com",
  "brand": "Sony",
  "description": "The PS5 console unleashes new gaming possibilities that you never anticipated. Experience lightning fast loading with an ultra-high speed SSD, deeper immersion with support for haptic feedback, adaptive triggers, and 3D Audio*, and an all-new generation of incredible PlayStation games. Lightning Speed - Harness the power of a custom CPU, GPU, and SSD with Integrated I/O that rewrite the rules of what a PlayStation console can do. Stunning Games - Marvel at incredible graphics and experience new PS5 features. Play a back catalog of supported PS4 games. Breathtaking Immersion - Discover a deeper gaming experience with support for haptic feedback, adaptive triggers, and 3D Audio technology. Vertical stand sold separately. *3D audio via built-in TV speakers or analog/USB stereo headphones. Set up and latest system software update required.",
  "initial_price": 499,
  "currency": "USD",
  "availability": "In Stock",
  "reviews_count": 6759,
  "categories": [
    "Video Games",
    "PlayStation 5",
    "Consoles"
  ],
  "asin": "B0CL61F39H",
  "buybox_seller": "Amazon.com",
  "number_of_sellers": 1,
  "root_bs_rank": 18,
  "answered_questions": 0,
  "domain": "https://www.amazon.com/",
  "images_count": 5,
  "url": "https://www.amazon.com/PlayStation%C2%AE5-console-slim-PlayStation-5/dp/B0CL61F39H?th=1&psc=1&language=en_US&currency=USD",
  "video_count": 6,
  "image_url": "https://m.media-amazon.com/images/I/41ECK5cY-2L._SL1000_.jpg",
  "item_weight": "10.6 pounds",
  "rating": 4.7,
  "product_dimensions": "14 x 17 x 7 inches; 10.6 Pounds",
  "seller_id": "ATVPDKIKX0DER",
  "date_first_available": "December 10, 2023",
  "model_number": "CFI-2015",
  "manufacturer": "Sony",
  "department": "Video Games",
  "plus_content": true,
  "video": true,
  "final_price": 499,
  "delivery": [
    "FREE delivery Monday, May 26",
    "Or Prime members get FREE delivery Tomorrow, May 22. Order within 15 hrs 43 mins. Join Prime"
  ],
  "features": [
    "Model Number CFI-2000",
    "Includes DualSense Wireless Controller, 1TB SSD, Disc Drive, 2 Horizontal Stand Feet, HDMI Cable, AC power cord, USB cable, printed materials, ASTRO’s PLAYROOM (Pre-installed game)",
    "Vertical Stand sold separately"
  ],
  "bought_past_month": 8000,
  "is_available": true,
  "root_bs_category": "Video Games",
  "bs_category": "PlayStation  Consoles",
  "bs_rank": 15,
  "badge": "Amazon's  Choice",
  "subcategory_rank": [
    {
      "subcategory_name": "PlayStation 5 Consoles",
      "subcategory_rank": 1
    }
  ],
  "amazon_choice": true,
  "product_details": [
    {
      "type": "ASIN",
      "value": "B0CL61F39H"
    },
    {
      "type": "Release date",
      "value": "December 10, 2023"
    },
    {
      "type": "Customer Reviews",
      "value": "4.74.7 out of 5 stars6,759 ratings4.7 out of 5 stars"
    },
    {
      "type": "Best Sellers Rank",
      "value": "#18 in Video Games (See Top 100 in Video Games)#1 in PlayStation 5 Consoles"
    },
    {
      "type": "Product Dimensions",
      "value": "14 x 17 x 7 inches; 10.6 Pounds"
    },
    {
      "type": "Type of item",
      "value": "Video Game"
    },
    {
      "type": "Item model number",
      "value": "CFI-2015"
    },
    {
      "type": "Item Weight",
      "value": "10.6 pounds"
    },
    {
      "type": "Manufacturer",
      "value": "Sony"
    },
    {
      "type": "Country of Origin",
      "value": "China"
    },
    {
      "type": "Batteries",
      "value": "1 Lithium Ion batteries required. (included)"
    },
    {
      "type": "Date First Available",
      "value": "December 10, 2023"
    }
  ],
  "country_of_origin": "China",
  "seller_url": "https://www.amazon.com/sp?ie=UTF8&seller=ATVPDKIKX0DER&asin=B0CL61F39H",
  "customers_say": "Customers find the PlayStation 5 console runs well and performs mind-blowingly fast, with quick loading times and smooth game performance. The graphics quality receives positive feedback, with one customer highlighting its stunning 120Hz visuals, while the console is easy to set up with an intuitive user interface. Customers consider the price worth the investment and appreciate its pristine condition. The noise level receives mixed reviews, with some customers finding it super quiet while others report it being loud.",
  "climate_pledge_friendly": false,
  "sponsered": true,
  "store_url": "https://www.amazon.com/stores/PlayStationPlayHasNoLimits/page/5AF5EF82-86EF-4699-B450-C232B3BD720E?lp_asin=B0CL61F39H&ref_=ast_bln&store_ref=bl_ast_dp_brandLogo_sto",
  "ships_from": "Amazon.com",
  "customers_say": {
    "text": "Customers find the PlayStation 5 console runs well and performs mind-blowingly fast, with quick loading times and smooth game performance. The graphics quality receives positive feedback, with one customer highlighting its stunning 120Hz visuals, while the console is easy to set up with an intuitive user interface. Customers consider the price worth the investment and appreciate its pristine condition. The noise level receives mixed reviews, with some customers finding it super quiet while others report it being loud.",
    "keywords": {
      "positive": [
        "Functionality",
        "Gaming experience",
        "Value for money",
        "Graphics quality",
        "Quality",
        "Speed",
        "Ease of setup"
      ],
      "negative": null,
      "mixed": [
        "Noise level"
      ]
    }
  },
  "max_quantity_available": 30,
  "timestamp": "2025-05-21T10:46:13.487Z"
}


Wow! 🤯


That’s astonishing!


One prompt, and you just scraped all the data from an Amazon product page.እና ምንም ጣቢያ ብቻ አይደለም—Amazon በይፋ የ CAPTCHAs እና የኮምፒውተር መከላከያዎች ሻጋታ ለማግኘት አስቸጋሪ ነው.

ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ከባድ ነው?web_data_amazon_productMCP መሣሪያ — የ Bright Data MCP Server የተጠበቀ የኃይል መሣሪያዎች መካከል አንዱ. ይህ የዱቄት ሥራ ይሰራል: CAPTCHAs መውሰድ, ቶቶን ማረጋገጫ ማከናወን, እና የሽያጭ መውሰድ.

ነገር ግን ይህ በዚያ መጨረሻም አይሆንም!

እነዚህን ውሂብ መቁረጥ ይችላሉ? ከ MCP-powered toolkit ከ መሣሪያዎችን ለመምረጥ እና በመስመር ላይ መሣሪያዎችን ለመምረጥ መጠቀም ይችላሉ.አጠቃቀም ምናልባት አነስተኛ ነው

ይህ ጠንካራ መሳሪያ ጋር, የዓለም የእርስዎ ነው!(በቶኒ ሞንታና ብቻ አግኝተናል )

መጨረሻው ጥያቄዎች

Now you know how to overcharge any AI agent built with the OpenAI Agents SDK—whether it’s running on GPT, Gemini, or whatever’s next—by plugging it into a MCP server.

በእርግጠኝነት, የእኛን ጠንካራBright Data MCP serverብቻ አንድ የብዙ አገልግሎቶች በአጠቃላይ የቴክኒካዊ AI workflows ለማሟላት የተመሰረተ ናቸው..

በ Bright Data, የእኛን ትዕዛዝ ቀላል ነው: ለሁሉም ሰዎች, በገዙ ቦታዎች የ AI ማግኘት ይቻላል. ከዚያም ቀጣይ ጊዜ ድረስ - ምናባዊ ይሆናል, ጠንካራ ይሆናል, እና በፈጠራነት የ AI ደህንነት ለመፍጠር ይሆናል.

L O A D I N G
. . . comments & more!

About Author

Bright Data HackerNoon profile picture
Bright Data@brightdata
From data collection to ready-made datasets, Bright Data allows you to retrieve the data that matters.

ተንጠልጣይ መለያዎች

ይህ ጽሑፍ ቀርቧል...

Trending Topics

blockchaincryptocurrencyhackernoon-top-storyprogrammingsoftware-developmenttechnologystartuphackernoon-booksBitcoinbooks