Skip to content

Commit 832bcd0

Browse files
committed
simplified example
1 parent 268d32a commit 832bcd0

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

examples/browser_mcp.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/browser_use.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"""
99

1010
import asyncio
11-
import os
1211

1312
from dotenv import load_dotenv
1413
from langchain_openai import ChatOpenAI
@@ -21,14 +20,14 @@ async def main():
2120
# Load environment variables
2221
load_dotenv()
2322

23+
config = {
24+
"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"], "env": {"DISPLAY": ":1"}}}
25+
}
2426
# Create MCPClient from config file
25-
client = MCPClient.from_config_file(os.path.join(os.path.dirname(__file__), "browser_mcp.json"))
27+
client = MCPClient(config=config)
2628

2729
# Create LLM
2830
llm = ChatOpenAI(model="gpt-4o")
29-
# llm = init_chat_model(model="llama-3.1-8b-instant", model_provider="groq")
30-
# llm = ChatAnthropic(model="claude-3-")
31-
# llm = ChatGroq(model="llama3-8b-8192")
3231

3332
# Create agent with the client
3433
agent = MCPAgent(llm=llm, client=client, max_steps=30)

0 commit comments

Comments
 (0)