How to Use the Amplitude MCP in LangChain
Build product analytics chains that pull Amplitude MCP Server data directly into your LangChain agents.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Amplitude MCP to LangChain
Create your Vinkius account to connect Amplitude 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 LangChain agents for conversion analysis
`get_funnel` pulls step-by-step drop-off metrics for any comma-separated list of events. You pass the start and end dates as YYYYMMDD strings. Your ReAct agent checks the conversion rate, spots a sudden drop, and immediately decides to run a follow-up query. That next step usually involves `get_retention`. The agent feeds the acquisition event and return event into the tool, pulling cohort decay over time. LangSmith traces the exact token usage and latency for both API calls, letting you debug the reasoning pipeline.
Trace individual user activity streams
`search_users` locates specific accounts using an email, user ID, or device ID. Once the agent has the exact identifier, it passes that string into the next node of your chain. This keeps the context window focused entirely on the target user. The chain then executes `get_user_activity` to pull the raw event stream for that specific person. You get a chronological log of clicks, page views, and errors. If a customer reports a bug, your agent constructs the exact sequence of actions they took right before the crash.
Pipe Amplitude MCP Server data to databases
`revenue_analysis` fetches daily monetization metrics across any specified date range. Your agent grabs this data and can immediately write it to a Postgres database or a Google Sheet using other tools in your environment. You skip the manual CSV exports entirely. When you need behavioral segments, `list_cohorts` grabs the available groups. The agent then triggers `get_cohort` to download the actual list of users. Since this endpoint sometimes requires polling, LangChain async tool execution handles the wait time without blocking your main application thread.
Set up Amplitude 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 Amplitude 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({
"amplitude-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 Amplitude 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 Amplitude. 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 Amplitude MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Amplitude MCP today
We host it, we monitor it, we maintain it. You just paste one token.