Gatana Documentation
Integrations

LangChain

Integrate Gatana MCP Gateway with LangChain agents

Below is a simple example on how to use Gatana with LangChain:

from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_mcp_adapters.sessions import StreamableHttpConnection
from langchain.agents import create_agent

client = MultiServerMCPClient(
    connections={
        "gatana": StreamableHttpConnection(
            transport="streamable_http",
            url="https://ORG_ID.gatana.ai/mcp",
            headers={"Authorization": f"Bearer {access_token}"},
        )
    }
)

tools = await client.get_tools()
agent = create_agent(model, tools=tools)
result = await agent.ainvoke({"messages": [HumanMessage(content="Hello")]})