The Anthropic Python SDK provides native support for MCP (Model Context Protocol) servers. This allows you to connect Claude directly to Observee’s tool ecosystem without additional frameworks.
Connect Claude to Observee’s MCP server and access all available tools:
Copy
Ask AI
import anthropicfrom rich import printfrom dotenv import load_dotenvimport osload_dotenv()# Your Observee MCP server URL# Replace {your_client_id} with your actual client ID from the Observee dashboardurl = 'https://mcp.observee.ai/mcp?client_id={your_client_id}'client = anthropic.Anthropic()# Create streaming response with MCP server connectionstream = client.beta.messages.create( model="claude-sonnet-4-20250514", max_tokens=1000, messages=[{"role": "user", "content": "Check my latest email"}], mcp_servers=[ { "type": "url", "url": url, "name": "observee", "authorization_token": "{observee_api_key}" # Replace with your API key } ], extra_headers={ "anthropic-beta": "mcp-client-2025-04-04" }, stream=True)# Process the streaming responseprint("Streaming response:")for chunk in stream: if chunk.type == "content_block_delta": if chunk.delta.type == "text_delta": print(chunk.delta.text, end="", flush=True) elif chunk.type == "message_stop": print("\n\nStream completed.") breakprint() # Final newline for clean output