Set up LangChain / LangGraph
The leading Python and JavaScript LLM framework. Use langchain-mcp-adapters to convert Agentcy tools into native LangChain tools for use in agents, chains, and graphs.
- 01
Sign up at app.goagentcy.com and create an API key
- 02
Install the adapter: pip install langchain-mcp-adapters langgraph
- 03
Configure the Agentcy server with Streamable HTTP transport
- 04
Replace YOUR_AGENTCY_API_KEY with your actual key
- 05
Call client.get_tools() to convert MCP tools to LangChain tools
path: pip install langchain-mcp-adapters
# Python — LangChain MCP Adapters
# pip install langchain-mcp-adapters langgraph
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"agentcy": {
"url": "https://data.goagentcy.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_AGENTCY_API_KEY"
},
"transport": "streamable_http",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(ChatOpenAI(), tools)
result = await agent.ainvoke({
"messages": "How is my site performing?"
})Available for both Python (langchain-mcp-adapters) and JavaScript (@langchain/mcp-adapters). Supports stdio and Streamable HTTP transports. MultiServerMCPClient connects to multiple MCP servers simultaneously. Works with any LangChain-compatible LLM.
“Build a RAG pipeline that includes live marketing data”
“Create a multi-step agent that researches competitors then analyzes our traffic”
“What keywords should we target based on our GA4 and GSC data?”
“Compare our ad performance across all campaigns this month”