Agents in n8n and LangChain
Give an agent ByDomu’s tools through MCP, or the API as your own tool.
An agent in n8n
Attach an MCP Client Tool to the AI Agent node, with the server URL and Bearer authentication. Use an n8n version that offers the HTTP Streamable transport: the server doesn’t speak SSE (GET returns 405), so SSE mode won’t connect.
AI Agent
└─ Tool: MCP Client Tool
Endpoint https://mcp.bydomu.com/mcp
Server Transport HTTP Streamable (en versiones recientes; SSE no conecta)
Authentication Bearer → credencial con domu_sk_live_… (solo lectura)
Tools to Include Selected → search_properties, get_property, list_appointmentsFor fixed steps (without the model deciding), the HTTP Request node against the REST API with X-API-Key is simpler and more predictable.
LangChain and LangGraph
With LangChain’s MCP adapters, the nine tools arrive as regular agent tools (create_agent runs on LangGraph). LangChain is moving these adapters into langchain.mcp; the server configuration (URL and header) is the same.
# pip install langchain langchain-mcp-adapters langchain-anthropic
import asyncio, os
from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient
async def main():
client = MultiServerMCPClient({
"bydomu": {
"transport": "streamable_http",
"url": "https://mcp.bydomu.com/mcp",
"headers": {"Authorization": f"Bearer {os.environ['BYDOMU_API_KEY']}"},
}
})
tools = await client.get_tools()
agent = create_agent("anthropic:claude-opus-5", tools)
result = await agent.ainvoke(
{"messages": [{"role": "user", "content": "¿Qué tareas vencidas tiene el equipo?"}]}
)
print(result["messages"][-1].content)
asyncio.run(main())MCP or API?
- MCP: the model picks from nine read tools already designed for conversation (short, paginated results). It’s the fastest route for an assistant.
- REST API: everything else, including writes with their approved permission. Wrap each endpoint as your own tool, send Idempotency-Key and ask for human confirmation before writing.
What it can do, how to revoke it and good practices
The server is read-only: the AI can query, but it doesn’t create, change or delete anything, and it never messages your customers. It only sees what these permissions allow, with a secret key’s limit (60 requests per minute).
portal:readcontacts:readappointments:readconversations:readdeals:readtasks:readWith a key, the AI sees whatever that key allows. To cut access, pause or delete the key in Settings › API Keys; the next call returns 401.
- One key per integration, with only the read permissions it uses. Leave conversations:read out if you don’t need messages.
- The key goes in an environment variable or the client’s secret store, never pasted into a chat, a repository file or a URL.
- What ByDomu returns includes text your customers wrote: treat it as data, not instructions. Don’t chain this connector with tools that send emails or messages without a person approving it.
- Review Connected apps now and then and remove what’s no longer used.