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

# LangChain

Load the Norbix tools into LangChain through the MCP adapter and call one.

You have a LangChain app and want it to read and change your Norbix backend without hand-written tools.

## How Norbix models it

LangChain loads MCP servers (MCP = Model Context Protocol, the standard way AI tools call outside services) through the official [`langchain-mcp-adapters`](https://github.com/langchain-ai/langchain-mcp-adapters) package. Point it at the Norbix [MCP server](/codemash/ai/developers/mcp-server.md) with the `streamable_http` transport and an `nbsu_` key in the `Authorization` header; every Norbix tool becomes a LangChain tool.

```bash
pip install langchain-mcp-adapters
```

```python
import asyncio, os
from langchain_mcp_adapters.client import MultiServerMCPClient

async def main():
    client = MultiServerMCPClient({
        "norbix": {
            "transport": "streamable_http",
            "url": os.environ["NORBIX_MCP_URL"],  # https://hub.norbix.ai/v3/account/mcp
            "headers": {"Authorization": f"Bearer {os.environ['NORBIX_API_KEY']}"},
        }
    })
    tools = await client.get_tools()
    print(len(tools), "tools")
    by_name = {t.name: t for t in tools}
    print(await by_name["get_database_taxonomies"].ainvoke({}))

asyncio.run(main())
```

What it printed (a key with the **Viewer** role on one project, so no project id is needed):

```
418 tools
[{'type': 'text', 'text': '{"ok":true,"data":{"list":{"items":[{"viewId":"txn_3D8kZTCjIkHkBxFRcUMvHS","taxonomyName":"Genres","taxonomySlug":"genres"}, …],"hasMore":false,"hasPrevious":false}}}', 'id': 'lc_…'}]
```

Pass `tools` to any LangChain agent. A tool that changes something answers `requires_confirmation` first; your agent must ask its user and call again with `confirm: true` — see [MCP server](/codemash/ai/developers/mcp-server.md#scopes-what-a-tool-may-do).

| Version used             |        |
| ------------------------ | ------ |
| `langchain-mcp-adapters` | 0.3.2  |
| `langchain-core`         | 1.6.7  |
| `mcp`                    | 1.30.0 |

## Where you use it

* [LangGraph](/codemash/ai/products/frameworks/langgraph.md) — the same tools in an agent graph
* [MCP server](/codemash/ai/developers/mcp-server.md) · [Read-only keys](/codemash/ai/developers/read-only-keys.md) · [What agents can do](/codemash/ai/developers/what-agents-can-do.md)
