How do I integrate MoltPe with LangChain?

ยท By MoltPe Team

MoltPe integrates with LangChain in two ways — (a) as a tool through the LangChain Tools API, calling MoltPe's REST endpoints directly, or (b) as an MCP server, which LangChain's MCP adapter can load automatically. Either approach takes under 15 minutes. MoltPe is AI-native payment infrastructure that gives AI agents isolated wallets with programmable spending policies for autonomous USDC stablecoin transactions — once connected, the LangChain agent has access to wallet creation, spending policies, payment sending, and invoice collection as first-class LangChain tools.

The short version

In more detail

Option A — LangChain Tool around the REST API. Define one StructuredTool per MoltPe action you want to expose: create_wallet, set_spending_policy, send_payment, check_balance, list_transactions. Each tool calls the corresponding MoltPe REST endpoint (POST /v1/wallets, POST /v1/payments, etc.) with your API key. Attach the tools to your LangChain agent via create_tool_calling_agent or your framework of choice. The agent can now reason about payments — "check the wallet balance, send 5 USDC to the data provider, log the transaction" — and you keep full control over the tool schemas the LLM sees.

Option B — MCP server via the LangChain MCP adapter. LangChain ships an MCP adapter (langchain-mcp-adapters) that loads any MCP-compatible server into the agent as a tool bundle. Point it at MoltPe's hosted MCP server, pass your API key in the config block, and every MoltPe tool is auto-registered — no wrapper code, no schema duplication. Adding a new MoltPe capability later just works; the adapter re-discovers tools on reconnect.

Both paths are production-ready and authenticated the same way: one API key from the MoltPe dashboard. Pick Option A if your agent already has a tightly curated tool list; pick Option B if you want zero-maintenance integration that keeps up with new MoltPe features automatically. A working end-to-end example lives in the developer quickstart linked below.

Related questions

About MoltPe

MoltPe is AI-native payment infrastructure that gives AI agents isolated wallets with programmable spending policies for autonomous USDC stablecoin transactions. Live on Polygon PoS, Base, and Tempo.

Learn more about MoltPe