Integrations / AI agent clients / LangGraph
A browser for LangGraph agents.
LangGraph runs tool calls as graph steps. With the Browz SDK, one MCP session stays open for the whole run, so a profile opened in one step is still there in the next, and the run ends with the profile cleaned up.
pip install langgraph langchain-mcp-adapters langchain-anthropic # plus the Browz Python SDK: pip install browz-mcpSetup
Set it up.
Install Browz and open it
Download Browz on the computer that runs your graph.
Install the packages
LangGraph, the MCP adapters, a model provider and the Browz Python SDK.
Terminalpip install langgraph langchain-mcp-adapters langchain-anthropic # plus the Browz Python SDK: pip install browz-mcpBuild and run the agent
langchain_tool_session()starts the local server and yields its tools;langgraph_agent()builds a prebuilt agent with the Browz instructions. SetANTHROPIC_API_KEYfirst.graph.pyimport asyncio from langchain_anthropic import ChatAnthropic from browz.agents import langchain_tool_session, langgraph_agent async def main(): async with langchain_tool_session() as tools: agent = langgraph_agent(ChatAnthropic(model="claude-haiku-5-5"), tools) out = await agent.ainvoke({"messages": [("user", "Using Browz: create a new profile called agent-check, start it, open https://example.com, tell me the page title, take a screenshot, then stop the session and delete the profile.")]}) print(out["messages"][-1].content) asyncio.run(main())Through the hosted server (beta)
Pass
remote=True; the token comes fromBROWZ_AGENT_TOKEN.Pythonfrom browz.agents import langchain_tool_session, langgraph_agent async with langchain_tool_session(remote=True) as tools: # inside an async function agent = langgraph_agent(model, tools)
Client API from LangChain MCP docs.
Example
Use the tools in your own graph.
The helpers return ordinary LangChain tools, so they also fit a graph you build yourself with a ToolNode.
import asyncio
from langchain_anthropic import ChatAnthropic
from langgraph.graph import StateGraph, MessagesState, START
from langgraph.prebuilt import ToolNode, tools_condition
from browz.agents import langchain_tool_session
async def main():
async with langchain_tool_session() as tools:
model = ChatAnthropic(model="claude-haiku-5-5").bind_tools(tools)
async def call_model(state: MessagesState):
return {"messages": [await model.ainvoke(state["messages"])]}
graph = StateGraph(MessagesState)
graph.add_node("model", call_model)
graph.add_node("tools", ToolNode(tools))
graph.add_edge(START, "model")
graph.add_conditional_edges("model", tools_condition)
graph.add_edge("tools", "model")
app = graph.compile()
out = await app.ainvoke({"messages": [("user", "Using Browz, open a throwaway session, go to https://example.com, tell me the page title and close the session.")]})
print(out["messages"][-1].content)
asyncio.run(main())Good to know
Notes and tips.
- Keep the graph inside the
async withblock: the MCP session, and the profiles it opened, end when the block ends. - The remote server at
https://mcp.gobrowz.com/mcpis in free public beta: it needs the Browz app open with Remote control on, on a computer with a hardware security chip, and offers the profile, tab and page tools. See what it needs and what it offers. - Browz has to be installed and open on the same computer: the local MCP server drives the app’s own profiles through its local API, and reads the app’s credentials itself, so no token goes in the config.
- A person completes sign-ins, 2FA codes and CAPTCHAs. The agent can pause with
browz_request_humanand hand you the profile’s window, then carry on in the same session. Browz never solves or bypasses CAPTCHAs. - Use agents only where each site’s terms allow automated use, on accounts you are entitled to use. Our acceptable use policy applies to agents the same as to people.
- The MCP server is on every plan, Free included (5 profiles). How many agent sessions can be open at once depends on the plan: see pricing.
FAQ
LangGraph and Browz.
Why one MCP session for the whole run?
Each MCP session is one connection to the server. Keeping it open means a profile the agent opened in one step is still running for the next, instead of a new connection per tool call.
Which models work?
Any chat model LangGraph supports with tool calling. The example uses Claude; swap in any provider.
Can several graphs run at once?
Yes. Each session the agent opens gets its own profile, so parallel runs never share cookies or a fingerprint.
Get started
Download Browz. Every task, its own browser.
curl -fsSL https://gobrowz.com/agents/install.sh | sh