Chrome DevTools MCP server in LangChain.
No config file here — LangChain connects to MCP servers in code. Use langchain-mcp-adapters to spawn Chrome DevTools MCP over stdio and hand its browser tools to any agent you build.
Editors and chat apps configure MCP servers in JSON files; LangChain does it programmatically. The langchain-mcp-adapters package bridges the two worlds — it spawns an MCP server, discovers its tools, and converts them into LangChain tool objects your agent can call like any other.
That makes Chrome DevTools MCP (the Chrome team's official server, 43.2k GitHub stars) available to custom agents: QA bots that verify deployments, scraping pipelines that need real rendering, or monitoring agents that profile page performance on a schedule.
Prerequisites
You need three runtimes side by side: Python for your LangChain code, Node for the server (the MultiServerMCPClient shells out to npx), and an installed Chrome for the server to drive. Install the adapter with `pip install langchain-mcp-adapters`. Nothing about the server itself needs configuring — npx fetches the chrome-devtools-mcp package on first run.
Spawn the server and load its tools
MultiServerMCPClient takes a dict of server definitions. For a local stdio server like this one, you give it the command, args, and transport, then call get_tools() to receive LangChain-compatible tools:
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
client = MultiServerMCPClient({
"chrome_devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest"],
"transport": "stdio",
}
})
tools = await client.get_tools()
agent = create_react_agent("claude-sonnet-4-5", tools)
result = await agent.ainvoke({
"messages": "Open https://example.com and report any console errors."
})Design the agent around the browser's lifecycle
Unlike a stateless API tool, this server holds state: the Chrome instance, its open pages, and their session persist across tool calls. That's a feature — an agent can navigate, interact, then pull a performance trace of the same page — but it means you should keep one client per logical browsing session rather than recreating it per call, and let the agent's prompt explain that pages stay open between steps.
Troubleshooting in LangChain
Because there's no config file, failures show up as Python exceptions. A spawn error at get_tools() time means the subprocess didn't start: verify `npx chrome-devtools-mcp@latest` runs in the same environment your Python process uses — this bites hardest in Docker images and CI runners that have Python but no Node, or Node but no Chrome. Install both in the image, or point the server at a Chrome binary per its README.
Hangs usually mean transport mismatch (stdio must be specified for a command-based server) or an event-loop problem — get_tools() and tool calls are async, so they need to run inside asyncio. If tools load but calls fail mid-run, capture the server's stderr; the adapter surfaces it, and it usually names the issue, such as Chrome failing to launch headless without the right system libraries.
Where this fits in the MCP ecosystem
One advantage of going through MCP rather than a bespoke Puppeteer wrapper: the same server definition works in Claude Code, Cursor, and your LangChain pipeline, so your team debugs one integration instead of three. Chrome DevTools MCP's live tool list is on its Loomal marketplace listing at https://loomal.ai/marketplace/chrome-devtools-mcp — useful for checking what your agent will see before you wire it up.
FAQ
How do I install Chrome DevTools MCP in LangChain?
Install langchain-mcp-adapters, then instantiate MultiServerMCPClient with command npx, args ["chrome-devtools-mcp@latest"], and transport stdio. Calling get_tools() returns the server's browser tools as LangChain tools you pass to your agent.
Does LangChain have an MCP config file like Cursor or Claude Desktop?
No. LangChain connections are defined in your Python or JavaScript code at runtime. The upside is full programmatic control — you can spawn servers conditionally, set environment variables per run, and tear sessions down explicitly.
Why does get_tools() fail in my container?
The subprocess spawn needs Node (for npx) and Chrome available in the same environment as Python. Most slim Python images have neither. Add Node and a Chrome/Chromium install to the image, and headless Chrome's system library dependencies if you're on a minimal base.
Can the agent keep a page open across multiple tool calls?
Yes — the server maintains the browser session, so navigation, interaction, and profiling calls all hit the same live Chrome. Keep one MultiServerMCPClient alive for the duration of the session to preserve that state.
More MCP servers for LangChain agents.
Browse the Loomal marketplace and load any listing's tools the same way.