How to Use the myDevices MCP in LangChain
Run multi-step LangChain pipelines that monitor IoT hardware and trigger remote commands based on real-time Cayenne telemetry.
Works with every AI agent you already use
…and any MCP-compatible client
Connect myDevices MCP to LangChain
Create your Vinkius account to connect myDevices 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.
Automate IoT responses with LangChain pipelines
This MCP Server exposes `send_command` and `list_alerts` directly to your LangChain chain, letting the sequence respond to active hardware warnings in real time. The chain reads incoming alert payloads, determines the root cause, and issues corrective actions to specific hardware modules without human intervention. By chaining these steps together, your LangChain system shifts from passive monitoring to active, closed-loop control. You can track every tool transition and latency metric inside LangSmith to ensure the agent executes commands within your target threshold.
Chain historical telemetry for predictive maintenance
The `get_sensor_history` tool pulls raw historical metrics from Cayenne so your LangChain chains can analyze performance degradation over time. Your LangChain agent feeds these sequential data points into a reasoning loop to predict hardware failures before they trigger an emergency. Instead of checking static thresholds, the agent compares current telemetry from `get_sensor_data` with past trends. This prevents false positives and ensures your maintenance crews only head to the field when a device actually requires physical service.
Map active hardware networks on the fly
Using `list_devices` and `list_sensors`, your LangChain agent discovers the layout of your physical deployments without hardcoded IDs. The LangChain agent queries your active applications, maps the available inputs, and dynamically routes its analysis based on what hardware is online. Once the layout is mapped, the LangChain agent targets specific components using `get_device` to verify firmware versions or connection states. This dynamic discovery keeps your automation pipelines running even when technicians add new hardware to the physical site.
Set up myDevices 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 myDevices 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({
"mydevices-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 myDevices 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 myDevices. 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 myDevices MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the myDevices MCP today
We host it, we monitor it, we maintain it. You just paste one token.