MCP Integration for langchain-snowflake
Provides utilities to integrate Model Context Protocol (MCP) tools with ChatSnowflake's bind_tools() functionality.
Example:
from langchain_snowflake import ChatSnowflake, bind_mcp_tools from langchain_mcp_adapters import load_mcp_tools
Load MCP tools
mcp_tools = await load_mcp_tools(mcp_session)
Bind to ChatSnowflake
agent = bind_mcp_tools(llm, mcp_tools, mcp_session)
Use normally
response = await agent.ainvoke("list databases")
Convert an MCP tool to a LangChain Tool.
Filter MCP tools based on compatibility and patterns.
Bind MCP tools to a ChatSnowflake instance.
This function filters MCP tools for compatibility, converts them to LangChain Tools, and binds them to the provided LLM using bind_tools().
Centralized error handling for Snowflake integrations.
Specialized error handler for Snowflake tools.
Wrapper to make MCP tools compatible with LangChain's tool interface.
This wrapper handles the conversion between LangChain's tool calling format and MCP's tool execution format, ensuring seamless integration.