Skip to main content
Connect LangChain agents to https://api.twexapi.io/mcp so they can discover Twexapi endpoints with explore and call allowed API paths through twexapi_request.

Prerequisites

  • Python 3.10+
  • A Twexapi API key from the dashboard
  • An LLM API key for your LangChain model provider

Install

Full example

LangChain loads the remote MCP tools with MultiServerMCPClient. The agent should call explore first, then call twexapi_request with an exact method and relative path from the catalog.

Handoff checklist

Store durable fields from MCP responses so later workflow steps do not depend on chat history.

LangGraph directly

Use LangGraph when you want to own the tool loop.

Environment variables

.env

Multiple MCP servers

Prefix server names when your agent connects to more than one MCP provider.

Package versions