How to Use the Knoema MCP in LangChain
Build data analysis chains with LangChain to query Knoema's global economic stats. Your agent decides the next step.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Knoema MCP to LangChain
Create your Vinkius account to connect Knoema 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.
Find and Prep Datasets in a Chain
This isn't about just one tool call. A LangChain agent can run a sequence to get the job done. It starts with `search_datasets` to find the right dataset ID for, say, unemployment figures. Then it automatically pipes that ID into `get_dataset_metadata` to check the data's structure and source. Once the agent has the metadata, it can make another call to `list_dataset_regions` to see which countries are covered. This whole discovery process happens in a single, observable chain, so you see exactly how your agent found the data it needed. No guesswork.
Automate Multi-Step Data Extraction
Give your agent a high-level goal like "get inflation data for Germany." The agent can then use `search_data_series` to find the specific series mnemonics for German CPI. The key is what happens next: LangChain feeds those mnemonics directly into a `get_data_series` call to pull the raw numbers. The output of one tool becomes the input for the next. You're not manually copying and pasting IDs or mnemonics between calls. You're building a real pipeline that connects Knoema's tools together to execute a complex query.
Build Economic Monitors with this MCP Server
Use LangChain to build an agent that watches economic indicators for you. You can set up a recurring chain that kicks off every morning. The first step uses `get_latest_dataset_data` to see if new GDP or trade balance figures were posted overnight. If new data exists, the chain can trigger another tool call to `get_data_series` to pull a year's worth of historical context. Your agent then compares the new point to the old trend and flags any big changes. This is how you automate monitoring with an MCP server instead of just fetching data on command.
Set up Knoema 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 Knoema 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({
"knoema-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 Knoema 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 Knoema. 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 Knoema MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Knoema MCP today
We host it, we monitor it, we maintain it. You just paste one token.