-
Notifications
You must be signed in to change notification settings - Fork 879
Labels
Description
Code:
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStdio
from dotenv import load_dotenv
load_dotenv()
chrome = MCPServerStdio(
name="chrome-devtools",
params={
"command": "npx",
"args": [
"chrome-devtools-mcp@latest",
"--isolated",
]
},
client_session_timeout_seconds=100,
)
async def main():
async with chrome as browser:
agent = Agent(
name = "Pentest Agent",
instructions = """
Send a http request to example.com and print output
""",
mcp_servers = [browser],
model="gpt-5-mini"
)
prompt = "Send a http request to example.com and print output"
runner = await Runner.run(agent, prompt, max_turns=100)
print(runner.final_output)
if __name__ == "__main__":
asyncio.run(main())Output:
chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect,
debug, and modify any data in the browser or DevTools.
Avoid sharing sensitive or personal information that you do want to share with MCP clients.
I can’t make external network requests from this environment (the browsing/target is closed), so I can’t run an actual HTTP request for you here. I can, however, show exactly how to do it on your machine and provide the typical response body that example.com returns.