@devries-cameron20 / composio Mirror · read-only / commits / 544151151
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 08:15 UTC

fix(docs): update Claude Agent SDK Python quickstart snippets

- Consolidated MCP imports to top-level (claude_agent_sdk instead of submodules) - Removed try/except and if __name__ guard from MCP snippet - Added full banner to native snippet for consistency - Improved tool call display formatting in MCP snippet - Added flush=True for consistent streaming output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 19, 2026 at 10:24 UTC 5441511511db25f1e9cf53198faf62b3807b7cab
1 file changed +22 -29
docs/content/docs/quickstart.mdx
+22 -29
@@ -362,7 +362,14 @@ async def main():
362 )
363
364 async with ClaudeSDKClient(options=options) as client:
365 - print("Assistant ready! Type 'exit' to quit.")
365 + print("""
366 +What task would you like me to help you with?
367 +I can use tools like Gmail, GitHub, Linear, Notion, and more.
368 +(Type 'exit' to exit)
369 +Example tasks:
370 + - 'Summarize my emails from today'
371 + - 'List all open issues on the composio github repository'
372 +""")
373
374 while True:
375 user_input = input("You: ").strip()
@@ -370,7 +377,7 @@ async def main():
377 break
378
379 await client.query(user_input)
373 - print("Claude: ", end="")
380 + print("Claude: ", end="", flush=True)
381 async for message in client.receive_response():
382 if isinstance(message, AssistantMessage):
383 for block in message.content:
@@ -488,13 +495,7 @@ ANTHROPIC_API_KEY=your_anthropic_api_key
495 ```python
496 import asyncio
497 from dotenv import load_dotenv
491 -from claude_agent_sdk.client import ClaudeSDKClient
492 -from claude_agent_sdk.types import (
493 - ClaudeAgentOptions,
494 - AssistantMessage,
495 - TextBlock,
496 - ToolUseBlock,
497 -)
498 +from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage, TextBlock, ToolUseBlock
499 from composio import Composio
500
501 load_dotenv()
@@ -506,7 +507,6 @@ composio = Composio()
507 user_id = "user_123"
508 session = composio.create(user_id=user_id)
509
509 -# Configure Claude with Composio MCP server
510 options = ClaudeAgentOptions(
511 system_prompt=(
512 "You are a helpful assistant with access to external tools. "
@@ -522,7 +522,6 @@ options = ClaudeAgentOptions(
522 permission_mode="bypassPermissions",
523 )
524
525 -
525 async def main():
526 print("""
527 What task would you like me to help you with?
@@ -534,29 +533,23 @@ Example tasks:
533 """)
534
535 async with ClaudeSDKClient(options) as client:
537 - # Multi-turn conversation with agentic tool calling
536 while True:
537 user_input = input("You: ").strip()
538 if user_input.lower() == "exit":
539 break
540
543 - print("\nClaude: ", end="", flush=True)
544 - try:
545 - await client.query(user_input)
546 - async for msg in client.receive_response():
547 - if isinstance(msg, AssistantMessage):
548 - for block in msg.content:
549 - if isinstance(block, ToolUseBlock):
550 - print(f"\n[Using tool: {block.name}]", end="")
551 - elif isinstance(block, TextBlock):
552 - print(block.text, end="", flush=True)
553 - print()
554 - except Exception as e:
555 - print(f"\n[Error]: {e}")
556 -
557 -
558 -if __name__ == "__main__":
559 - asyncio.run(main())
541 + await client.query(user_input)
542 + print("Claude: ", end="", flush=True)
543 + async for msg in client.receive_response():
544 + if isinstance(msg, AssistantMessage):
545 + for block in msg.content:
546 + if isinstance(block, ToolUseBlock):
547 + print(f"\n [Using tool: {block.name}]")
548 + elif isinstance(block, TextBlock):
549 + print(block.text, end="", flush=True)
550 + print()
551 +
552 +asyncio.run(main())
553 ```
554 </Tab>
555 <Tab value="TypeScript">