> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/ai/frameworks/langgraph.md).

# LangGraph

LangGraph agents use the same MCP adapter as LangChain. Load the Norbix tools once, then hand them to your graph.

### Install

```bash
pip install langchain-mcp-adapters langgraph "langchain[anthropic]"
```

### A minimal agent

```python
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent

client = MultiServerMCPClient(
    {
        "norbix": {
            "transport": "stdio",
            "command": "npx",
            "args": ["-y", "@norbix.ai/mcp"],
            "env": {
                "NORBIX_API_KEY": "your-api-key",
                "NORBIX_HUB_URL": "https://hub.norbix.ai",
                "NORBIX_PROJECT_ID": "your-project-id",
            },
        }
    }
)

tools = await client.get_tools()
agent = create_react_agent("anthropic:claude-sonnet-4-5", tools)

result = await agent.ainvoke(
    {"messages": "How many documents are in the orders collection?"}
)
```

### Long-running graphs

For hosted graphs, prefer the [remote MCP mode](/ai/mcp-server.md#remote-mode-streamable-http) (`transport: "streamable_http"`, `url: "https://your-host/mcp"`) so workers don't each spawn a local process, and pass per-user API keys with the `Authorization` header.

{% hint style="info" %}
Norbix's event system pairs well with LangGraph: use [Triggers](/other-topics/triggers.md) and [Server Events](/norbix-cloud/notifications/server-events.md) to start or resume graphs when data changes.
{% endhint %}
