from langchain_mcp_adapters.client import MultiServerMCPClient
from 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 dashboard
client = 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 Observee
tools = await client.get_tools()
# Create a React agent with the tools
agent = create_react_agent("openai:gpt-4.1", tools)
# Use the agent - it will automatically use appropriate Observee tools
response = await agent.ainvoke({
"messages": "check my latest emails and add to my sheets"
})
print(response)