plexus.cli.procedure.mcp_adapter module

LangChain MCP Adapter for tool conversion.

Converts MCP tools into LangChain-compatible tools, handling async execution, argument formatting, and chat recording integration.

class plexus.cli.procedure.mcp_adapter.LangChainMCPAdapter(mcp_client)

Bases: object

Adapter that converts MCP tools into LangChain-compatible tools.

This allows AI models using LangChain to seamlessly access all Plexus MCP tools through the in-process MCP transport.

__init__(mcp_client)
async load_tools() List[MCPTool]

Load and convert all MCP tools to LangChain format.

plexus.cli.procedure.mcp_adapter.convert_mcp_tools_to_langchain(mcp_tools)

Convert MCP tools to LangChain StructuredTool format.

This function takes a list of MCPTool objects and converts them to LangChain StructuredTool objects for use with LangChain agents.

Args:

mcp_tools: List of MCPTool objects

Returns:

List of LangChain StructuredTool objects