Skip to main content
LangChain adapter for MCP tools. This module provides utilities to convert MCP tools to LangChain tools.

LangChainAdapter

from mcp_use.adapters.langchain_adapter import LangChainAdapter

method init

Initialize a new LangChain adapter.Parameters
disallowed_tools
list[str] | None
default:"None"
list of tool names that should not be available.
Signature
def __init__(disallowed_tools: list[str] | None = None):

method fix_schema

Convert JSON Schema ‘type’: [‘string’, ‘null’] to ‘anyOf’ format and fix enum handling.Parameters
schema
dict
required
The JSON schema to fix.
Returns
returns
dict
The fixed JSON schema.
Signature
def fix_schema(schema: dict):
I