How to Use the AdGuard Home MCP in LangChain
Build LangChain agents that analyze query logs and rewrite DNS rules in real time to stop network threats.
Works with every AI agent you already use
…and any MCP-compatible client
Connect AdGuard Home MCP to LangChain
Create your Vinkius account to connect AdGuard Home 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 DNS Threat Response with LangChain
The `get_query_log` tool lets your LangChain agents trace bad traffic patterns and immediately block them. Inspect the domains and pass them to your decision chain. If the chain flags a domain, it triggers `add_filter_url` or `set_user_rules` instantly. This setup turns passive logging into active defense. Your agent evaluates the logs, runs its reasoning loop, and updates your network blocklist without you writing custom glue code.
Dynamic DHCP and Client Provisioning via MCP Server
Using `get_dhcp_status` allows you to keep your network database updated during automated deployment workflows. When a new device connects, your LangChain chain calls the tool to find empty slots. It then uses `add_static_lease` and `add_client` to register the hardware. LangSmith traces every step of this configuration process, showing you the exact payload sent to your AdGuard Home instance. You see exactly how the agent mapped the MAC address to the static IP.
Smart Service Blocking Schedules
The `update_blocked_services` tool lets you schedule parental or focus controls without rigid cron jobs. With this MCP Server, your agent reads your calendar or team status, then invokes the tool to toggle access to distracting platforms. The agent checks current network load with `get_stats` before changing rules. If it detects heavy traffic, it waits or alerts you before running `set_protection` to toggle global filters.
Set up AdGuard Home 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 AdGuard Home 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({
"adguard-home-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 AdGuard Home 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 AdGuard Home. 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 AdGuard Home MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the AdGuard Home MCP today
We host it, we monitor it, we maintain it. You just paste one token.