How to Use the Drift MCP in LangChain
Get live chat data into your LangChain runs to qualify leads and route chats based on real-time Drift agent availability.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Drift MCP to LangChain
Create your Vinkius account to connect Drift to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Build dynamic routing chains with this Drift MCP Server.
Let your LangChain ReAct agent decide whether to hand a Drift user to a bot or a human. By chaining `list_drift_playbooks` with `quick_agent_availability_audit`, your LangChain pipeline checks if live support is online before triggering a specific automated flow. The output of your availability check feeds directly into the next LangChain run. If agents are offline, your pipeline runs `get_contact_profile` to gather Drift context and schedules a follow-up, keeping your chat operations fluid.
Trace customer context across tools.
Monitor every API call your LangChain agent makes when pulling Drift user records. When a customer messages, the agent calls `search_contacts_by_email` and `get_conversation_details` to reconstruct the relationship timeline. LangSmith captures these Drift tool inputs and outputs, showing you exactly how much latency or token usage each Drift lookup adds to your chain. You see the exact payload from the live chat API inside your LangSmith dashboard.
Keep state across customer interactions.
Use a stateless MCP adapter but maintain chat state with a LangChain session. Your agent pulls active Drift chats using `list_drift_conversations` and processes them sequentially. The LangChain agent remembers past turns in the conversation by combining `list_latest_customer_interactions` with its own internal memory. This stops your model from repeating questions the customer already answered in the Drift widget.
Set up Drift MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes Drift tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"drift-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent Drift transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Drift. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Drift MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Drift MCP today
We host it, we monitor it, we maintain it. You just paste one token.