LangChain can connect to Observee’s MCP (Model Context Protocol) server using the langchain-mcp-adapters package. This enables your LangChain applications to access Observee’s tool ecosystem through the familiar LangChain interface.
Example: Creating a React Agent with Observee Tools
This example shows how to create a simple React agent that can use tools from your Observee MCP server:
Copy
Ask AI
from langchain_mcp_adapters.client import MultiServerMCPClientfrom langgraph.prebuilt import create_react_agent# Configure the MCP client to connect to Observee# Replace {your_client_id} with your actual client ID from the Observee dashboardclient = MultiServerMCPClient( { "observee": { "transport": "streamable_http", "url": "https://mcp.observee.ai/mcp?client_id={your_client_id}", "headers": { "Authorization": "Bearer {observee_api_key}" # Replace with your API key }, } })# Get all available tools from Observeetools = await client.get_tools()# Create a React agent with the toolsagent = create_react_agent("openai:gpt-4.1", tools)# Use the agent - it will automatically use appropriate Observee toolsresponse = await agent.ainvoke({ "messages": "check my latest emails and add to my sheets"})print(response)